| OLD | NEW |
| 1 // This script is supposed to be evaluated in dummy inspector front-end which is
loaded from | 1 // This script is supposed to be evaluated in dummy inspector front-end which is
loaded from |
| 2 // ../../../http/tests/inspector-protocol/resources/protocol-test.html and the r
elative paths | 2 // ../../../http/tests/inspector-protocol/resources/protocol-test.html and the r
elative paths |
| 3 // below are relative to that location. | 3 // below are relative to that location. |
| 4 | 4 |
| 5 if (!window.WebInspector) | 5 if (!window.WebInspector) |
| 6 window.WebInspector = {}; | 6 window.WebInspector = {}; |
| 7 InspectorTest.importScript("../../../../../Source/devtools/front_end/HeapSnapsho
tCommon.js"); | 7 InspectorTest.importScript("../../../../../Source/devtools/front_end/HeapSnapsho
tCommon.js"); |
| 8 InspectorTest.importScript("../../../../../Source/devtools/front_end/HeapSnapsho
t.js"); | 8 InspectorTest.importScript("../../../../../Source/devtools/front_end/HeapSnapsho
t.js"); |
| 9 InspectorTest.importScript("../../../../../Source/devtools/front_end/JSHeapSnaps
hot.js"); | 9 InspectorTest.importScript("../../../../../Source/devtools/front_end/JSHeapSnaps
hot.js"); |
| 10 InspectorTest.importScript("../../../../../Source/devtools/front_end/UIString.js
"); | 10 InspectorTest.importScript("../../../../../Source/devtools/front_end/UIString.js
"); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 var chunks = []; | 27 var chunks = []; |
| 28 InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(m
essageObject) | 28 InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(m
essageObject) |
| 29 { | 29 { |
| 30 chunks.push(messageObject["params"]["chunk"]); | 30 chunks.push(messageObject["params"]["chunk"]); |
| 31 } | 31 } |
| 32 | 32 |
| 33 function didTakeHeapSnapshot(messageObject) | 33 function didTakeHeapSnapshot(messageObject) |
| 34 { | 34 { |
| 35 var serializedSnapshot = chunks.join(""); | 35 var serializedSnapshot = chunks.join(""); |
| 36 var parsed = JSON.parse(serializedSnapshot); | 36 var parsed = JSON.parse(serializedSnapshot); |
| 37 parsed.nodes = new Uint32Array(parsed.nodes); |
| 38 parsed.edges = new Uint32Array(parsed.edges); |
| 37 var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspector.
HeapSnapshotProgress()); | 39 var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspector.
HeapSnapshotProgress()); |
| 38 callback(snapshot); | 40 callback(snapshot); |
| 39 InspectorTest.log("SUCCESS: didGetHeapSnapshot"); | 41 InspectorTest.log("SUCCESS: didGetHeapSnapshot"); |
| 40 InspectorTest.completeTest(); | 42 InspectorTest.completeTest(); |
| 41 } | 43 } |
| 42 InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {}, didTakeHeapSn
apshot); | 44 InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {}, didTakeHeapSn
apshot); |
| 43 } | 45 } |
| OLD | NEW |