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

Side by Side Diff: LayoutTests/inspector-protocol/heap-profiler/heap-objects-tracking.html

Issue 98273008: [DevTools] Send heap snapshot to the frontend immediatly when it is ready (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed test crash Created 6 years, 10 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
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/heap-profiler/heap-objects-tracking-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 if (window.testRunner) { 6 if (window.testRunner) {
7 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
8 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
9 } 9 }
10 10
(...skipping 10 matching lines...) Expand all
21 setInterval(junkGenerator, 0); 21 setInterval(junkGenerator, 0);
22 runTest(); 22 runTest();
23 } 23 }
24 24
25 function test() 25 function test()
26 { 26 {
27 InspectorTest.importScript("../../../../inspector-protocol/heap-profiler/res ources/heap-snapshot-common.js"); 27 InspectorTest.importScript("../../../../inspector-protocol/heap-profiler/res ources/heap-snapshot-common.js");
28 28
29 var gotLastSeenObjectIdEvent = false; 29 var gotLastSeenObjectIdEvent = false;
30 var gotHeapStatsUpdateEvent = false; 30 var gotHeapStatsUpdateEvent = false;
31 var gotHeapProfilerHeader = false;
32 function trackingStarted() 31 function trackingStarted()
33 { 32 {
34 InspectorTest.log("SUCCESS: tracking started"); 33 InspectorTest.log("SUCCESS: tracking started");
35 } 34 }
36 35
37 function trackingStopped() 36 function trackingStopped()
38 { 37 {
39 if (gotHeapStatsUpdateEvent) 38 if (gotHeapStatsUpdateEvent)
40 InspectorTest.log("SUCCESS: heapStatsUpdate arrived"); 39 InspectorTest.log("SUCCESS: heapStatsUpdate arrived");
41 if (gotLastSeenObjectIdEvent) 40 if (gotLastSeenObjectIdEvent)
42 InspectorTest.log("SUCCESS: lastSeenObjectId arrived"); 41 InspectorTest.log("SUCCESS: lastSeenObjectId arrived");
43 if (gotHeapProfilerHeader)
44 InspectorTest.log("SUCCESS: addProfileHeader arrived");
45 InspectorTest.log("SUCCESS: tracking stopped"); 42 InspectorTest.log("SUCCESS: tracking stopped");
46 InspectorTest.completeTest(); 43 InspectorTest.completeTest();
47 } 44 }
48 45
49 var fragments = []; 46 var fragments = [];
50 InspectorTest.eventHandler["HeapProfiler.lastSeenObjectId"] = function(messa geObject) 47 InspectorTest.eventHandler["HeapProfiler.lastSeenObjectId"] = function(messa geObject)
51 { 48 {
52 49
53 var params = messageObject["params"]; 50 var params = messageObject["params"];
54 InspectorTest.assert(params, "no params found in event HeapProfiler.last SeenObjectId"); 51 InspectorTest.assert(params, "no params found in event HeapProfiler.last SeenObjectId");
(...skipping 13 matching lines...) Expand all
68 InspectorTest.assert(statsUpdate.length, "statsUpdate should have non ze ro length"); 65 InspectorTest.assert(statsUpdate.length, "statsUpdate should have non ze ro length");
69 InspectorTest.assert(!(statsUpdate.length % 3), "statsUpdate length must be a multiple of three"); 66 InspectorTest.assert(!(statsUpdate.length % 3), "statsUpdate length must be a multiple of three");
70 InspectorTest.assert(!(statsUpdate.length % 3), "statsUpdate length must be a multiple of three"); 67 InspectorTest.assert(!(statsUpdate.length % 3), "statsUpdate length must be a multiple of three");
71 InspectorTest.assert(!statsUpdate[0], "statsUpdate: first fragmentIndex in first update has to be zero"); 68 InspectorTest.assert(!statsUpdate[0], "statsUpdate: first fragmentIndex in first update has to be zero");
72 InspectorTest.assert(statsUpdate[1], "statsUpdate: total count of object s should be not zero"); 69 InspectorTest.assert(statsUpdate[1], "statsUpdate: total count of object s should be not zero");
73 InspectorTest.assert(statsUpdate[2], "statsUpdate: total size of objects should be not zero"); 70 InspectorTest.assert(statsUpdate[2], "statsUpdate: total size of objects should be not zero");
74 fragments.push(statsUpdate); 71 fragments.push(statsUpdate);
75 gotHeapStatsUpdateEvent = true; 72 gotHeapStatsUpdateEvent = true;
76 } 73 }
77 74
78 InspectorTest.eventHandler["HeapProfiler.addProfileHeader"] = function(messa geObject)
79 {
80 gotHeapProfilerHeader = true;
81 }
82
83 InspectorTest.sendCommand("HeapProfiler.startTrackingHeapObjects", {}, track ingStarted); 75 InspectorTest.sendCommand("HeapProfiler.startTrackingHeapObjects", {}, track ingStarted);
84 //@ sourceURL=heap-objects-tracking.html 76 //@ sourceURL=heap-objects-tracking.html
85 } 77 }
86 </script> 78 </script>
87 </head> 79 </head>
88 <body onload="setupIntervalAndRunTest()"> 80 <body onload="setupIntervalAndRunTest()">
89 <p>Test that heap tracking actually reports data fragments.</p> 81 <p>Test that heap tracking actually reports data fragments.</p>
90 </body> 82 </body>
91 </html> 83 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/heap-profiler/heap-objects-tracking-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698