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

Unified Diff: LayoutTests/inspector/profiler/heap-snapshot-test.js

Issue 98273008: [DevTools] Send heap snapshot to the frontend immediatly when it is ready (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed test crash Created 6 years, 11 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
Index: LayoutTests/inspector/profiler/heap-snapshot-test.js
diff --git a/LayoutTests/inspector/profiler/heap-snapshot-test.js b/LayoutTests/inspector/profiler/heap-snapshot-test.js
index a8f788a54ecfca810de828c2305740cf82319733..601af15a96d85e9a06d54a61495cc2963742aa03 100644
--- a/LayoutTests/inspector/profiler/heap-snapshot-test.js
+++ b/LayoutTests/inspector/profiler/heap-snapshot-test.js
@@ -433,7 +433,6 @@ InspectorTest.completeProfilerTest = function()
InspectorTest.runHeapSnapshotTestSuite = function(testSuite)
{
- InspectorTest._nextUid = 1;
var testSuiteTests = testSuite.slice();
var completeTestStack;
@@ -695,22 +694,22 @@ InspectorTest.switchToView = function(title, callback)
InspectorTest.takeAndOpenSnapshot = function(generator, callback)
{
callback = InspectorTest.safeWrap(callback);
- var uid = InspectorTest._nextUid++;
var snapshot = generator();
var profileType = WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType;
- var profile = new WebInspector.HeapProfileHeader(profileType, "Mock snapshot #" + uid, uid);
- function pushGeneratedSnapshot(uid, callback)
+ function pushGeneratedSnapshot(reportProgress, callback)
{
+ var profile = profileType.profileBeingRecorded();
+ if (reportProgress) {
+ profileType.reportHeapSnapshotProgress(50, 100, false);
+ profileType.reportHeapSnapshotProgress(100, 100, true);
+ }
snapshot.snapshot.typeId = "HEAP";
- snapshot.snapshot.title = profile.title;
- snapshot.snapshot.uid = profile.uid;
- profileType.addHeapSnapshotChunk(uid, JSON.stringify(snapshot));
+ profileType.addHeapSnapshotChunk(profile.uid, JSON.stringify(snapshot));
setTimeout(callback, 0);
}
- InspectorTest.override(HeapProfilerAgent, "getHeapSnapshot", pushGeneratedSnapshot);
+ InspectorTest.override(HeapProfilerAgent, "takeHeapSnapshot", pushGeneratedSnapshot);
InspectorTest._takeAndOpenSnapshotCallback = callback;
- profileType.addProfile(profile);
- WebInspector.panels.profiles.showProfile(profile);
+ profileType._takeHeapSnapshot(function() { });
};
InspectorTest.viewColumns = function()
« no previous file with comments | « LayoutTests/inspector/profiler/heap-snapshot-loader.html ('k') | Source/core/inspector/InspectorHeapProfilerAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698