Index: third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.js b/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..25946db5b623f58d1ddf63a80d5692f99f0275c2 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.js |
@@ -0,0 +1,26 @@ |
+(async function(testRunner) { |
+ let {page, session, dp} = await testRunner.startBlank(''); |
+ |
+ await dp.Runtime.enable(); |
+ testRunner.log('Runtime enabled'); |
+ |
+ await dp.Page.enable(); |
+ testRunner.log('Page enabled'); |
+ |
+ var response = await dp.Page.getResourceTree(); |
+ var mainFrameId = response.result.frameTree.frame.id; |
+ testRunner.log('Main Frame obtained'); |
+ |
+ dp.Page.createIsolatedWorld({frameId: mainFrameId, worldName: 'Test world'}); |
+ dp.Runtime.onExecutionContextCreated(message => { |
+ if (message.params.context.auxData.frameId !== mainFrameId) |
+ return; |
+ if (message.params.context.auxData.isDefault === false && message.params.context.name === 'Test world') { |
+ testRunner.log('PASS - isolated world created.'); |
+ } else { |
+ testRunner.log('fail - main world created.'); |
+ testRunner.log(JSON.stringify(message.params)); |
+ } |
+ testRunner.completeTest(); |
+ }); |
+}) |