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

Side by Side Diff: test/inspector/cpu-profiler/record-cpu-profile.js

Issue 2369753004: [inspector] added inspector test runner [part 5] (Closed)
Patch Set: addressed comments Created 4 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
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 print("Test that profiler is able to record a profile. Also it tests that profil er returns an error when it unable to find the profile.");
6
7 InspectorTest.sendCommand("Profiler.enable", {});
8 InspectorTest.sendCommand("Profiler.start", {}, didStartFrontendProfile);
9 function didStartFrontendProfile(messageObject)
10 {
11 if (!InspectorTest.expectedSuccess("startFrontendProfile", messageObject))
12 return;
13 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.profile('P rofile 1');"}, didStartConsoleProfile);
14 }
15
16 function didStartConsoleProfile(messageObject)
17 {
18 if (!InspectorTest.expectedSuccess("startConsoleProfile", messageObject))
19 return;
20 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.profileEnd ('Profile 1');"}, didStopConsoleProfile);
21 }
22
23 function didStopConsoleProfile(messageObject)
24 {
25 if (!InspectorTest.expectedSuccess("stopConsoleProfile", messageObject))
26 return;
27 InspectorTest.sendCommand("Profiler.stop", {}, didStopFrontendProfile);
28 }
29
30 function didStopFrontendProfile(messageObject)
31 {
32 if (!InspectorTest.expectedSuccess("stoppedFrontendProfile", messageObject))
33 return;
34 InspectorTest.sendCommand("Profiler.start", {}, didStartFrontendProfile2);
35 }
36
37 function didStartFrontendProfile2(messageObject)
38 {
39 if (!InspectorTest.expectedSuccess("startFrontendProfileSecondTime", messageOb ject))
40 return;
41 InspectorTest.sendCommand("Profiler.stop", {}, didStopFrontendProfile2);
42 }
43
44 function didStopFrontendProfile2(messageObject)
45 {
46 InspectorTest.expectedSuccess("stopFrontendProfileSecondTime", messageObject)
47 InspectorTest.completeTest();
48 }
OLDNEW
« no previous file with comments | « test/inspector/cpu-profiler/enable-disable-expected.txt ('k') | test/inspector/cpu-profiler/record-cpu-profile-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698