OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.startBlank(`Tests checks that depre
cation messages for console.`); |
| 3 |
| 4 var messagesLeft = 3; |
| 5 dp.Runtime.onConsoleAPICalled(data => { |
| 6 var text = data.params.args[0].value; |
| 7 if (text.indexOf('deprecated') === -1) |
| 8 return; |
| 9 testRunner.log(text); |
| 10 if (!--messagesLeft) |
| 11 testRunner.completeTest(); |
| 12 }); |
| 13 |
| 14 dp.Runtime.enable(); |
| 15 var deprecatedMethods = [ |
| 16 `console.timeline('42')`, |
| 17 `console.timeline('42')`, |
| 18 `console.timeline('42')`, // three calls should produce one warning message |
| 19 `console.timelineEnd('42')`, |
| 20 `console.markTimeline('42')`, |
| 21 ]; |
| 22 dp.Runtime.evaluate({ expression: deprecatedMethods.join(';') }); |
| 23 }) |
OLD | NEW |