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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.html

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp Created 3 years, 6 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9
10 function test()
11 {
12 InspectorTest.sendCommand("Profiler.enable", {});
13 InspectorTest.sendCommand("Profiler.start", {}, didStartFrontendProfile);
14 function didStartFrontendProfile(messageObject)
15 {
16 if (!InspectorTest.expectedSuccess("startFrontendProfile", messageObject ))
17 return;
18 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.prof ile('Profile 1');"}, didStartConsoleProfile);
19 }
20
21 function didStartConsoleProfile(messageObject)
22 {
23 if (!InspectorTest.expectedSuccess("startConsoleProfile", messageObject) )
24 return;
25 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.prof ileEnd('Profile 1');"}, didStopConsoleProfile);
26 }
27
28 function didStopConsoleProfile(messageObject)
29 {
30 if (!InspectorTest.expectedSuccess("stopConsoleProfile", messageObject))
31 return;
32 InspectorTest.sendCommand("Profiler.stop", {}, didStopFrontendProfile);
33 }
34
35 function didStopFrontendProfile(messageObject)
36 {
37 if (!InspectorTest.expectedSuccess("stoppedFrontendProfile", messageObje ct))
38 return;
39 InspectorTest.sendCommand("Profiler.start", {}, didStartFrontendProfile2 );
40 }
41
42 function didStartFrontendProfile2(messageObject)
43 {
44 if (!InspectorTest.expectedSuccess("startFrontendProfileSecondTime", mes sageObject))
45 return;
46 InspectorTest.sendCommand("Profiler.stop", {}, didStopFrontendProfile2);
47 }
48
49 function didStopFrontendProfile2(messageObject)
50 {
51 InspectorTest.expectedSuccess("stopFrontendProfileSecondTime", messageOb ject)
52 InspectorTest.completeTest();
53 }
54 }
55 </script>
56 </head>
57 <body onload="runTest()">
58 <p>
59 Test that profiler is able to record a profile.
60 Also it tests that profiler returns an error when it unable to find the profile.
61 </body>
62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698