3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"profiler-test.js"></script>
9 InspectorTest
.runProfilerTestSuite([
10 function testProfiling(next
)
12 var cpuProfiler
= WebInspector
.targetManager
.mainTarget().cpuProfilerModel
;
13 var targetManager
= WebInspector
.targetManager
;
14 var profilesPanel
= WebInspector
.panels
.profiles
;
15 InspectorTest
.addSniffer(cpuProfiler
, "stopRecording", stopRecording
);
16 InspectorTest
.addSniffer(profilesPanel
, "_addProfileHeader", onAddProfileHeader
);
17 profilesPanel
.toggleRecordButton(); // Start profiling.
19 function onAddProfileHeader()
21 targetManager
.addEventListener(WebInspector
.TargetManager
.Events
.SuspendStateChanged
, stateChanged
);
22 profilesPanel
.toggleRecordButton(); // Stop profiling.
23 profilesPanel
._reset(); // ... and remove the profile before it actually stopped.
26 function stateChanged()
28 InspectorTest
.addResult("resumed");
31 function stopRecording(resultPromise
)
33 InspectorTest
.addResult("Stop recording command issued.");
34 resultPromise
.then(didStopRecording
);
37 function didStopRecording(profile
)
39 InspectorTest
.addResult("Recording stopped. profile (should be null): " + profile
);
40 InspectorTest
.completeProfilerTest();
48 <body onload=
"runTest()">
50 Tests that profile removal right after stop profiling issued works.
52 <a href=
"http://crbug.com/476430">Bug
476430.
</a>