| 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 var source = InspectorTest.createHeapSnapshotMockRaw(); | 9 var source = InspectorTest.createHeapSnapshotMockRaw(); |
| 10 var sourceStringified = JSON.stringify(source); | 10 var sourceStringified = JSON.stringify(source); |
| 11 var partSize = sourceStringified.length >> 3; | 11 var partSize = sourceStringified.length >> 3; |
| 12 | 12 |
| 13 function injectMockProfile(callback) { | 13 function injectMockProfile(callback) { |
| 14 var dispatcher = InspectorBackend._connection._dispatchers["HeapProfiler
"]._dispatcher; | 14 var dispatcher = InspectorTest.connection._dispatchers["HeapProfiler"]._
dispatcher; |
| 15 var panel = WebInspector.panels.profiles; | 15 var panel = WebInspector.panels.profiles; |
| 16 panel._reset(); | 16 panel._reset(); |
| 17 | 17 |
| 18 var profileType = WebInspector.ProfileTypeRegistry.instance.heapSnapsho
tProfileType; | 18 var profileType = WebInspector.ProfileTypeRegistry.instance.heapSnapsho
tProfileType; |
| 19 | 19 |
| 20 InspectorTest.override(InspectorTest.HeapProfilerAgent, "takeHeapSnapsho
t", takeHeapSnapshotMock); | 20 InspectorTest.override(InspectorTest.HeapProfilerAgent, "takeHeapSnapsho
t", takeHeapSnapshotMock); |
| 21 function takeHeapSnapshotMock(reportProgress, callback) { | 21 function takeHeapSnapshotMock(reportProgress, callback) { |
| 22 if (reportProgress) { | 22 if (reportProgress) { |
| 23 profileType._reportHeapSnapshotProgress({data: {done: 50, total:
100, finished: false}}); | 23 profileType._reportHeapSnapshotProgress({data: {done: 50, total:
100, finished: false}}); |
| 24 profileType._reportHeapSnapshotProgress({data: {done: 100, total
: 100, finished: true}}); | 24 profileType._reportHeapSnapshotProgress({data: {done: 100, total
: 100, finished: true}}); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 </script> | 134 </script> |
| 135 </head> | 135 </head> |
| 136 | 136 |
| 137 <body onload="runTest()"> | 137 <body onload="runTest()"> |
| 138 <p> | 138 <p> |
| 139 This test checks HeapSnapshots loader. | 139 This test checks HeapSnapshots loader. |
| 140 </p> | 140 </p> |
| 141 | 141 |
| 142 </body> | 142 </body> |
| 143 </html> | 143 </html> |
| OLD | NEW |