OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.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 dp.Profiler.enable(); |
| 7 var messageObject = await dp.Profiler.start(); |
| 8 if (!testRunner.expectedSuccess('startFrontendProfile', messageObject)) |
| 9 return; |
| 10 |
| 11 messageObject = await dp.Runtime.evaluate({expression: 'console.profile("Profi
le 1");'}); |
| 12 if (!testRunner.expectedSuccess('startConsoleProfile', messageObject)) |
| 13 return; |
| 14 |
| 15 messageObject = await dp.Runtime.evaluate({expression: 'console.profileEnd("Pr
ofile 1");'}); |
| 16 if (!testRunner.expectedSuccess('stopConsoleProfile', messageObject)) |
| 17 return; |
| 18 |
| 19 messageObject = await dp.Profiler.stop(); |
| 20 if (!testRunner.expectedSuccess('stoppedFrontendProfile', messageObject)) |
| 21 return; |
| 22 |
| 23 messageObject = await dp.Profiler.start(); |
| 24 if (!testRunner.expectedSuccess('startFrontendProfileSecondTime', messageObjec
t)) |
| 25 return; |
| 26 |
| 27 messageObject = await dp.Profiler.stop(); |
| 28 testRunner.expectedSuccess('stopFrontendProfileSecondTime', messageObject); |
| 29 testRunner.completeTest(); |
| 30 }) |
OLD | NEW |