| 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 var heapProfileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotPro
fileType; | 16 var heapProfileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotPro
fileType; |
| 17 heapProfileType.addEventListener(Profiler.HeapSnapshotProfileType.SnapshotRe
ceived, finishHeapSnapshot); | 17 heapProfileType.addEventListener(Profiler.HeapSnapshotProfileType.SnapshotRe
ceived, finishHeapSnapshot); |
| 18 InspectorTest.addSniffer(heapProfileType, "_snapshotReceived", snapshotRecei
ved); | 18 InspectorTest.addSniffer(heapProfileType, "_snapshotReceived", snapshotRecei
ved); |
| 19 heapProfileType._takeHeapSnapshot(function() {}); | 19 heapProfileType._takeHeapSnapshot(); |
| 20 | 20 |
| 21 function finishHeapSnapshot(uid) | 21 function finishHeapSnapshot(uid) |
| 22 { | 22 { |
| 23 InspectorTest.addResult("PASS: snapshot was taken"); | 23 InspectorTest.addResult("PASS: snapshot was taken"); |
| 24 var profiles = heapProfileType.getProfiles(); | 24 var profiles = heapProfileType.getProfiles(); |
| 25 | 25 |
| 26 if (!profiles.length) | 26 if (!profiles.length) |
| 27 return clear("FAILED: no profiles found"); | 27 return clear("FAILED: no profiles found"); |
| 28 | 28 |
| 29 if (profiles.length > 1) | 29 if (profiles.length > 1) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 </script> | 102 </script> |
| 103 </head> | 103 </head> |
| 104 | 104 |
| 105 <body onload="handleLoad()"> | 105 <body onload="handleLoad()"> |
| 106 <p> | 106 <p> |
| 107 Test that resolving heap snapshot object to a JS object will not crash on DOM wr
apper boilerplate. Test passes if it doesn't crash. | 107 Test that resolving heap snapshot object to a JS object will not crash on DOM wr
apper boilerplate. Test passes if it doesn't crash. |
| 108 </p> | 108 </p> |
| 109 | 109 |
| 110 </body> | 110 </body> |
| 111 </html> | 111 </html> |
| OLD | NEW |