Index: LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js |
diff --git a/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js b/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js |
index c1b2fab9f0fc7f601e33cc8213b11bbe4de98776..7cbf4900569909e4975fc90c1c1e64ebcfc7730c 100644 |
--- a/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js |
+++ b/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js |
@@ -23,32 +23,20 @@ InspectorTest.assert = function(result, message) |
InspectorTest.takeHeapSnapshot = function(callback) |
{ |
- InspectorTest.eventHandler["HeapProfiler.addProfileHeader"] = function(messageObject) |
+ var chunks = []; |
+ InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(messageObject) |
{ |
- var profileId = messageObject["params"]["header"]["uid"]; |
- InspectorTest.sendCommand("HeapProfiler.getHeapSnapshot", { "uid": profileId }, didGetHeapSnapshot); |
- |
- var chunks = []; |
- InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(messageObject) |
- { |
- chunks.push(messageObject["params"]["chunk"]); |
- } |
- |
- function didGetHeapSnapshot(messageObject) |
- { |
- var serializedSnapshot = chunks.join(""); |
- var parsed = JSON.parse(serializedSnapshot); |
- var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspector.HeapSnapshotProgress()); |
- callback(snapshot); |
- InspectorTest.log("SUCCESS: didGetHeapSnapshot"); |
- InspectorTest.sendCommand("HeapProfiler.removeProfile", { "uid": profileId }, didRemoveSnapshot); |
- } |
- |
- function didRemoveSnapshot(messageObject) |
- { |
- InspectorTest.completeTest(); |
- } |
+ chunks.push(messageObject["params"]["chunk"]); |
} |
- InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {}); |
+ function didTakeHeapSnapshot(messageObject) |
+ { |
+ var serializedSnapshot = chunks.join(""); |
+ var parsed = JSON.parse(serializedSnapshot); |
+ var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspector.HeapSnapshotProgress()); |
+ callback(snapshot); |
+ InspectorTest.log("SUCCESS: didGetHeapSnapshot"); |
+ InspectorTest.completeTest(); |
+ } |
+ InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {}, didTakeHeapSnapshot); |
} |