OLD | NEW |
(Empty) | |
| 1 (async function() { |
| 2 let {page, session, Protocol} = await InspectorTest.startBlank(''); |
| 3 |
| 4 await Protocol.Runtime.enable(); |
| 5 InspectorTest.log('Runtime enabled'); |
| 6 |
| 7 await Protocol.Page.enable(); |
| 8 InspectorTest.log('Page enabled'); |
| 9 |
| 10 var response = await Protocol.Page.getResourceTree(); |
| 11 var mainFrameId = response.result.frameTree.frame.id; |
| 12 InspectorTest.log('Main Frame obtained'); |
| 13 |
| 14 Protocol.Page.createIsolatedWorld({frameId: mainFrameId, worldName: 'Test worl
d'}); |
| 15 Protocol.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 InspectorTest.log('PASS - isolated world created.'); |
| 20 } else { |
| 21 InspectorTest.log('fail - main world created.'); |
| 22 InspectorTest.log(JSON.stringify(message.params)); |
| 23 } |
| 24 InspectorTest.completeTest(); |
| 25 }); |
| 26 })(); |
OLD | NEW |