| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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> |
| OLD | NEW |