Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js

Issue 27000005: Remove HeapProfiler.finishHeapSnapshot event from remote debugging protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed heap profiler test Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f1af0deeadb85daa180bddae4f1f9a49721c624..c1b2fab9f0fc7f601e33cc8213b11bbe4de98776 100644
--- a/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js
+++ b/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js
@@ -28,8 +28,18 @@ InspectorTest.takeHeapSnapshot = function(callback)
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);
}
@@ -38,21 +48,6 @@ InspectorTest.takeHeapSnapshot = function(callback)
{
InspectorTest.completeTest();
}
-
- }
-
- var chunks = [];
- InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(messageObject)
- {
- chunks.push(messageObject["params"]["chunk"]);
- }
-
- InspectorTest.eventHandler["HeapProfiler.finishHeapSnapshot"] = function(messageObject)
- {
- var serializedSnapshot = chunks.join("");
- var parsed = JSON.parse(serializedSnapshot);
- var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspector.HeapSnapshotProgress());
- callback(snapshot);
}
InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {});
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698