OLD | NEW |
(Empty) | |
| 1 (async function() { |
| 2 let {page, session, Protocol} = await InspectorTest.startBlank( |
| 3 'Test that profiler is able to record a profile. ' + |
| 4 'Also it tests that profiler returns an error when it unable to find the p
rofile.'); |
| 5 |
| 6 Protocol.Profiler.enable(); |
| 7 var messageObject = await Protocol.Profiler.start(); |
| 8 if (!InspectorTest.expectedSuccess('startFrontendProfile', messageObject)) |
| 9 return; |
| 10 |
| 11 messageObject = await Protocol.Runtime.evaluate({expression: 'console.profile(
"Profile 1");'}); |
| 12 if (!InspectorTest.expectedSuccess('startConsoleProfile', messageObject)) |
| 13 return; |
| 14 |
| 15 messageObject = await Protocol.Runtime.evaluate({expression: 'console.profileE
nd("Profile 1");'}); |
| 16 if (!InspectorTest.expectedSuccess('stopConsoleProfile', messageObject)) |
| 17 return; |
| 18 |
| 19 messageObject = await Protocol.Profiler.stop(); |
| 20 if (!InspectorTest.expectedSuccess('stoppedFrontendProfile', messageObject)) |
| 21 return; |
| 22 |
| 23 messageObject = await Protocol.Profiler.start(); |
| 24 if (!InspectorTest.expectedSuccess('startFrontendProfileSecondTime', messageOb
ject)) |
| 25 return; |
| 26 |
| 27 messageObject = await Protocol.Profiler.stop(); |
| 28 InspectorTest.expectedSuccess('stopFrontendProfileSecondTime', messageObject); |
| 29 InspectorTest.completeTest(); |
| 30 })(); |
OLD | NEW |