OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.startBlank(''); |
| 3 |
| 4 await dp.Runtime.enable(); |
| 5 testRunner.log('Runtime enabled'); |
| 6 |
| 7 await dp.Page.enable(); |
| 8 testRunner.log('Page enabled'); |
| 9 |
| 10 var response = await dp.Page.getResourceTree(); |
| 11 var mainFrameId = response.result.frameTree.frame.id; |
| 12 testRunner.log('Main Frame obtained'); |
| 13 |
| 14 dp.Page.createIsolatedWorld({frameId: mainFrameId, worldName: 'Test world'}); |
| 15 dp.Runtime.onExecutionContextCreated(message => { |
| 16 if (message.params.context.auxData.frameId !== mainFrameId) |
| 17 return; |
| 18 if (message.params.context.auxData.isDefault === false && message.params.con
text.name === 'Test world') { |
| 19 testRunner.log('PASS - isolated world created.'); |
| 20 } else { |
| 21 testRunner.log('fail - main world created.'); |
| 22 testRunner.log(JSON.stringify(message.params)); |
| 23 } |
| 24 testRunner.completeTest(); |
| 25 }); |
| 26 }) |
OLD | NEW |