Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / inspector / heap-snapshot-performance-test.js
bloba084b8809128c393a883237d0bd315ede136d37e
1 function test()
3 WebInspector.showPanel("profiles");
4 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildEdgeIndexes");
5 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildRetainers");
6 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildDominatedNodes");
7 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateFlags");
8 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildAggregates");
9 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateClassesRetainedSize");
10 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateDistances");
11 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateRetainedSizes");
12 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_markDetachedDOMTreeNodes");
13 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_markQueriableHeapObjects");
14 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_markPageOwnedNodes");
15 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_splitNodesAndContainmentEdges");
16 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildPostOrderIndex");
17 InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildDominatorTree");
18 InspectorTest.measureFunction(WebInspector.HeapSnapshotConstructorsDataGrid.prototype, "_aggregatesReceived");
20 function performanceTest(timer)
22 var transferTimerCookie;
23 var showTimerCookie;
24 var changeViewTimerCookie;
25 var clearTimerCookie;
27 var testName = /([^\/]+)\.html$/.exec(WebInspector.inspectedPageURL)[1];
28 var fullTimerCookie = timer.start("full-summary-snapshot-time");
29 var type = WebInspector.panels.profiles.getProfileType("HEAP");
31 var backendTimerCookie = timer.start("take-snapshot");
32 type._takeHeapSnapshot(step0);
34 function step0()
36 timer.finish(backendTimerCookie);
37 transferTimerCookie = timer.start("transfer-snapshot");
38 var profiles = type.getProfiles();
39 InspectorTest.addSniffer(profiles[0]._transferHandler, "_updateProgress", onUpdateProgress, true);
40 InspectorTest.addSniffer(profiles[0], "_wasShown", step2);
43 function onUpdateProgress(saved, total)
45 if (saved !== total)
46 return;
47 timer.finish(transferTimerCookie);
48 showTimerCookie = timer.start("show-snapshot");
51 function step2()
53 timer.finish(showTimerCookie);
54 changeViewTimerCookie = timer.start("switch-to-containment-view");
55 InspectorTest.switchToView("Containment", cleanup);
58 function cleanup()
60 timer.finish(changeViewTimerCookie);
61 timer.finish(fullTimerCookie);
62 clearTimerCookie = timer.start("clear-snapshot");
63 HeapProfilerAgent.clearProfiles(done);
64 WebInspector.panels.profiles._reset();
67 function done()
69 timer.finish(clearTimerCookie);
70 timer.done(testName);
74 InspectorTest.runPerformanceTest(performanceTest, 60000);