| 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..a54209b4e68d607b85a07be99189978a00b31347
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.js
|
| @@ -0,0 +1,30 @@
|
| +(async function() {
|
| + let {page, session, Protocol} = await InspectorTest.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.');
|
| +
|
| + Protocol.Profiler.enable();
|
| + var messageObject = await Protocol.Profiler.start();
|
| + if (!InspectorTest.expectedSuccess('startFrontendProfile', messageObject))
|
| + return;
|
| +
|
| + messageObject = await Protocol.Runtime.evaluate({expression: 'console.profile("Profile 1");'});
|
| + if (!InspectorTest.expectedSuccess('startConsoleProfile', messageObject))
|
| + return;
|
| +
|
| + messageObject = await Protocol.Runtime.evaluate({expression: 'console.profileEnd("Profile 1");'});
|
| + if (!InspectorTest.expectedSuccess('stopConsoleProfile', messageObject))
|
| + return;
|
| +
|
| + messageObject = await Protocol.Profiler.stop();
|
| + if (!InspectorTest.expectedSuccess('stoppedFrontendProfile', messageObject))
|
| + return;
|
| +
|
| + messageObject = await Protocol.Profiler.start();
|
| + if (!InspectorTest.expectedSuccess('startFrontendProfileSecondTime', messageObject))
|
| + return;
|
| +
|
| + messageObject = await Protocol.Profiler.stop();
|
| + InspectorTest.expectedSuccess('stopFrontendProfileSecondTime', messageObject);
|
| + InspectorTest.completeTest();
|
| +})();
|
|
|