Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 (async function(testRunner) { | |
| 2 // <a href='https://bugs.webkit.org/show_bug.cgi?id=105759'>Bug 105759.</a> | |
| 3 let {page, session, dp} = await testRunner.startBlank('Tests that "console.pro fileEnd()" does not cause crash.\nBug 105759.'); | |
| 4 | |
| 5 function fail(message) { | |
| 6 testRunner.log('FAIL: ' + message); | |
| 7 testRunner.completeTest(); | |
| 8 } | |
| 9 | |
| 10 var headers = []; | |
| 11 dp.Profiler.onConsoleProfileFinished(messageObject => { | |
| 12 headers.push({title: messageObject['params']['title']}); | |
| 13 }); | |
| 14 | |
| 15 dp.Profiler.enable(); | |
| 16 await session.evaluate(` | |
| 17 (function collectProfiles() { | |
| 18 console.profile(); | |
| 19 console.profile('titled'); | |
| 20 console.profileEnd(); | |
| 21 console.profileEnd(); | |
| 22 })(); | |
| 23 `); | |
| 24 | |
| 25 | |
| 26 if (headers.length !== 2) | |
| 27 return fail('Cannot retrive headers: ' + JSON.stringify(messageObject, null, 4)); | |
| 28 | |
| 29 testRunner.log('SUCCESS: found 2 profile headers'); | |
| 30 for (var i = 0; i < headers.length; i++) { | |
|
alph
2017/06/22 01:30:54
for-of
dgozman
2017/06/22 17:14:32
Done.
| |
| 31 if (headers[i].title === 'titled') { | |
| 32 testRunner.log('SUCCESS: titled profile found'); | |
| 33 testRunner.completeTest(); | |
| 34 return; | |
| 35 } | |
| 36 } | |
| 37 fail('Cannot find titled profile'); | |
| 38 }) | |
| OLD | NEW |