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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.js

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.js b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.js
new file mode 100644
index 0000000000000000000000000000000000000000..c1b44fda519244000394e36daa700225df8074ad
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.js
@@ -0,0 +1,30 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank(
+ 'Test that profiler is able to record a profile. ' +
+ 'Also it tests that profiler returns an error when it unable to find the profile.');
+
+ dp.Profiler.enable();
+ var messageObject = await dp.Profiler.start();
+ if (!testRunner.expectedSuccess('startFrontendProfile', messageObject))
+ return;
+
+ messageObject = await dp.Runtime.evaluate({expression: 'console.profile("Profile 1");'});
+ if (!testRunner.expectedSuccess('startConsoleProfile', messageObject))
+ return;
+
+ messageObject = await dp.Runtime.evaluate({expression: 'console.profileEnd("Profile 1");'});
+ if (!testRunner.expectedSuccess('stopConsoleProfile', messageObject))
+ return;
+
+ messageObject = await dp.Profiler.stop();
+ if (!testRunner.expectedSuccess('stoppedFrontendProfile', messageObject))
+ return;
+
+ messageObject = await dp.Profiler.start();
+ if (!testRunner.expectedSuccess('startFrontendProfileSecondTime', messageObject))
+ return;
+
+ messageObject = await dp.Profiler.stop();
+ testRunner.expectedSuccess('stopFrontendProfileSecondTime', messageObject);
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698