OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.startBlank(`This tests how navigati
on is handled from inside debugger code (console.log).`); |
| 3 |
| 4 await session.evaluateAsync(` |
| 5 function appendIframe(url) { |
| 6 var frame = document.createElement('iframe'); |
| 7 frame.id = 'iframe'; |
| 8 frame.src = url; |
| 9 document.body.appendChild(frame); |
| 10 return new Promise(resolve => frame.onload = resolve); |
| 11 } |
| 12 appendIframe('${testRunner.url('../resources/console-log-navigate-on-load.ht
ml')}') |
| 13 `); |
| 14 |
| 15 await dp.Runtime.enable(); |
| 16 await checkExpression('logArray()'); |
| 17 await checkExpression('logDate()'); |
| 18 await checkExpression('logDateWithArg()'); |
| 19 testRunner.completeTest(); |
| 20 |
| 21 async function checkExpression(expression) { |
| 22 var contextId; |
| 23 dp.Runtime.onceExecutionContextCreated().then(result => contextId = result.p
arams.context.id); |
| 24 await session.evaluateAsync(`appendIframe('${testRunner.url('../resources/co
nsole-log-navigate.html')}')`); |
| 25 testRunner.log(`Got new context: ${contextId !== undefined}`); |
| 26 testRunner.logMessage(await dp.Runtime.evaluate({ expression: expression, co
ntextId: contextId })); |
| 27 } |
| 28 }) |
OLD | NEW |