OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="heap-snapshot-test.js"></script> | 4 <script src="heap-snapshot-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function handleLoad() | 7 function handleLoad() |
8 { | 8 { |
9 // Make sure there is a body wrapper. | 9 // Make sure there is a body wrapper. |
10 document.body.fieldOnDomWrapper = 2012; | 10 document.body.fieldOnDomWrapper = 2012; |
11 runTest(); | 11 runTest(); |
12 } | 12 } |
13 | 13 |
14 function test() | 14 function test() |
15 { | 15 { |
16 WebInspector.showPanel("profiles"); | 16 WebInspector.showPanel("profiles"); |
17 WebInspector.panels.profiles._createTemporaryProfile("HEAP"); | 17 WebInspector.panels.profiles._createTemporaryProfile("HEAP"); |
18 var heapProfileType = WebInspector.panels.profiles.getProfileType("HEAP"); | 18 var heapProfileType = WebInspector.panels.profiles.getProfileType("HEAP"); |
19 InspectorTest.addSniffer(heapProfileType, "finishHeapSnapshot", finishHeapSn
apshot); | 19 heapProfileType.addEventListener(WebInspector.HeapSnapshotProfileType.Snapsh
otReceived, finishHeapSnapshot); |
20 InspectorTest.addSniffer(heapProfileType, "_snapshotReceived", snapshotRecei
ved); | 20 InspectorTest.addSniffer(heapProfileType, "_snapshotReceived", snapshotRecei
ved); |
21 HeapProfilerAgent.takeHeapSnapshot(function() { }); | 21 heapProfileType._takeHeapSnapshot(function() {}); |
22 | 22 |
23 function finishHeapSnapshot(uid) | 23 function finishHeapSnapshot(uid) |
24 { | 24 { |
25 InspectorTest.addResult("PASS: snapshot was taken"); | 25 InspectorTest.addResult("PASS: snapshot was taken"); |
26 var profiles = heapProfileType.getProfiles(); | 26 var profiles = heapProfileType.getProfiles(); |
27 | 27 |
28 if (!profiles.length) | 28 if (!profiles.length) |
29 return clear("FAILED: no profiles found"); | 29 return clear("FAILED: no profiles found"); |
30 | 30 |
31 if (profiles.length > 1) | 31 if (profiles.length > 1) |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 </script> | 107 </script> |
108 </head> | 108 </head> |
109 | 109 |
110 <body onload="handleLoad()"> | 110 <body onload="handleLoad()"> |
111 <p> | 111 <p> |
112 Test that resolving heap snaphot object to a JS object will not crash on DOM wra
pper boilerplate. Test passes if it doesn't crash. | 112 Test that resolving heap snaphot object to a JS object will not crash on DOM wra
pper boilerplate. Test passes if it doesn't crash. |
113 </p> | 113 </p> |
114 | 114 |
115 </body> | 115 </body> |
116 </html> | 116 </html> |
OLD | NEW |