| 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 test() | 7 function test() |
| 8 { | 8 { |
| 9 WebInspector.showPanel("profiles"); | 9 WebInspector.showPanel("profiles"); |
| 10 var source = InspectorTest.createHeapSnapshotMockRaw(); | 10 var source = InspectorTest.createHeapSnapshotMockRaw(); |
| 11 var sourceStringified = JSON.stringify(source); | 11 var sourceStringified = JSON.stringify(source); |
| 12 var partSize = sourceStringified.length >> 3; | 12 var partSize = sourceStringified.length >> 3; |
| 13 | 13 |
| 14 function injectMockProfile(callback) { | 14 function injectMockProfile(callback) { |
| 15 var dispatcher = InspectorBackend._domainDispatchers["HeapProfiler"]; | 15 var dispatcher = InspectorBackend._domainDispatchers["HeapProfiler"]; |
| 16 var panel = WebInspector.panels.profiles; | 16 var panel = WebInspector.panels.profiles; |
| 17 panel._reset(); | 17 panel._reset(); |
| 18 | 18 |
| 19 var profileType = panel.getProfileType("HEAP"); | 19 var profileType = WebInspector.ProfileTypeRegistry.instance.heapSnapsho
tProfileType; |
| 20 | 20 |
| 21 InspectorTest.override(HeapProfilerAgent, "getHeapSnapshot", getHeapSnap
shotMock); | 21 InspectorTest.override(HeapProfilerAgent, "getHeapSnapshot", getHeapSnap
shotMock); |
| 22 function getHeapSnapshotMock(uid, callback) { | 22 function getHeapSnapshotMock(uid, callback) { |
| 23 for (var i = 0, l = sourceStringified.length; i < l; i += partSize) | 23 for (var i = 0, l = sourceStringified.length; i < l; i += partSize) |
| 24 dispatcher.addHeapSnapshotChunk(uid, sourceStringified.slice(i,
i + partSize)); | 24 dispatcher.addHeapSnapshotChunk(uid, sourceStringified.slice(i,
i + partSize)); |
| 25 setTimeout(callback, 0); | 25 setTimeout(callback, 0); |
| 26 } | 26 } |
| 27 | 27 |
| 28 function tempFileReady() | 28 function tempFileReady() |
| 29 { | 29 { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 </script> | 136 </script> |
| 137 </head> | 137 </head> |
| 138 | 138 |
| 139 <body onload="runTest()"> | 139 <body onload="runTest()"> |
| 140 <p> | 140 <p> |
| 141 This test checks HeapSnapshots loader. | 141 This test checks HeapSnapshots loader. |
| 142 </p> | 142 </p> |
| 143 | 143 |
| 144 </body> | 144 </body> |
| 145 </html> | 145 </html> |
| OLD | NEW |