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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 t.js"); 7 InspectorTest.importScript("../../../../../Source/devtools/front_end/HeapSnapsho t.js");
8 InspectorTest.importScript("../../../../../Source/devtools/front_end/JSHeapSnaps hot.js"); 8 InspectorTest.importScript("../../../../../Source/devtools/front_end/JSHeapSnaps hot.js");
9 InspectorTest.importScript("../../../../../Source/devtools/front_end/UIString.js "); 9 InspectorTest.importScript("../../../../../Source/devtools/front_end/UIString.js ");
10 InspectorTest.importScript("../../../../../Source/devtools/front_end/utilities.j s"); 10 InspectorTest.importScript("../../../../../Source/devtools/front_end/utilities.j s");
(...skipping 10 matching lines...) Expand all
21 InspectorTest.fail(message); 21 InspectorTest.fail(message);
22 } 22 }
23 23
24 InspectorTest.takeHeapSnapshot = function(callback) 24 InspectorTest.takeHeapSnapshot = function(callback)
25 { 25 {
26 InspectorTest.eventHandler["HeapProfiler.addProfileHeader"] = function(messa geObject) 26 InspectorTest.eventHandler["HeapProfiler.addProfileHeader"] = function(messa geObject)
27 { 27 {
28 var profileId = messageObject["params"]["header"]["uid"]; 28 var profileId = messageObject["params"]["header"]["uid"];
29 InspectorTest.sendCommand("HeapProfiler.getHeapSnapshot", { "uid": profi leId }, didGetHeapSnapshot); 29 InspectorTest.sendCommand("HeapProfiler.getHeapSnapshot", { "uid": profi leId }, didGetHeapSnapshot);
30 30
31 var chunks = [];
32 InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = functi on(messageObject)
33 {
34 chunks.push(messageObject["params"]["chunk"]);
35 }
36
31 function didGetHeapSnapshot(messageObject) 37 function didGetHeapSnapshot(messageObject)
32 { 38 {
39 var serializedSnapshot = chunks.join("");
40 var parsed = JSON.parse(serializedSnapshot);
41 var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspec tor.HeapSnapshotProgress());
42 callback(snapshot);
33 InspectorTest.log("SUCCESS: didGetHeapSnapshot"); 43 InspectorTest.log("SUCCESS: didGetHeapSnapshot");
34 InspectorTest.sendCommand("HeapProfiler.removeProfile", { "uid": pro fileId }, didRemoveSnapshot); 44 InspectorTest.sendCommand("HeapProfiler.removeProfile", { "uid": pro fileId }, didRemoveSnapshot);
35 } 45 }
36 46
37 function didRemoveSnapshot(messageObject) 47 function didRemoveSnapshot(messageObject)
38 { 48 {
39 InspectorTest.completeTest(); 49 InspectorTest.completeTest();
40 } 50 }
41
42 }
43
44 var chunks = [];
45 InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(m essageObject)
46 {
47 chunks.push(messageObject["params"]["chunk"]);
48 }
49
50 InspectorTest.eventHandler["HeapProfiler.finishHeapSnapshot"] = function(mes sageObject)
51 {
52 var serializedSnapshot = chunks.join("");
53 var parsed = JSON.parse(serializedSnapshot);
54 var snapshot = new WebInspector.JSHeapSnapshot(parsed, new WebInspector. HeapSnapshotProgress());
55 callback(snapshot);
56 } 51 }
57 52
58 InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {}); 53 InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {});
59 } 54 }
OLDNEW
« 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