Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: LayoutTests/inspector/profiler/memory-instrumentation-test.js

Issue 13973026: remove memoryinstrumentation Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove the rest part of MemoryInstrumentation Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 var initialize_MemoryInstrumentationTest = function() {
2
3 InspectorTest._memoryBlockSize = function(path, root)
4 {
5 var pathPos = 0;
6 var children = [root];
7
8 while (true) {
9 var name = path[pathPos++];
10 var child = null;
11 for (var i = 0; i < children.length; i++) {
12 if (children[i].name === name) {
13 if (pathPos === path.length)
14 return children[i].size;
15 else {
16 child = children[i];
17 break;
18 }
19 }
20 }
21 if (child) {
22 children = child.children;
23 if (!children) {
24 InspectorTest.addResult(name + " has no children");
25 return -1;
26 }
27 } else {
28 InspectorTest.addResult(name + " not found");
29 return -1;
30 }
31 }
32 return -1;
33 };
34
35 InspectorTest.validateMemoryBlockSize = function(path, expectedMinimalSize)
36 {
37 function didReceiveMemorySnapshot(error, memoryBlock)
38 {
39 var size = InspectorTest._memoryBlockSize(path, memoryBlock);
40 if (size > expectedMinimalSize)
41 InspectorTest.addResult("PASS: block size for path = [" + path.join( ", ") + "] is OK.");
42 else {
43 InspectorTest.addResult("FAIL: block size for path = [" + path.join( ", ") + "] is too small.");
44 InspectorTest.addResult("expected minimal block size is " + expected MinimalSize + " actual is " + size);
45 }
46 InspectorTest.completeTest();
47 }
48
49 MemoryAgent.getProcessMemoryDistribution(didReceiveMemorySnapshot.bind(this) );
50 };
51
52 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698