Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.js

Issue 2947303002: [DevTools] Migrate inspector-protocol/{page,dom-snapshot} tests to new harness (Closed)
Patch Set: rebased Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..08fff78e9c7d9bf23ce8d810b4b1b6299ff4dc5f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.js
@@ -0,0 +1,34 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank('');
+
+ var reportedExecutionContextId;
+ 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') {
+ reportedExecutionContextId = message.params.context.id;
+ } else {
+ testRunner.log('fail - main world created.');
+ testRunner.log(JSON.stringify(message.params));
+ testRunner.completeTest();
+ }
+ });
+
+ 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');
+
+ response = await dp.Page.createIsolatedWorld({frameId: mainFrameId, worldName: 'Test world'});
+ if (reportedExecutionContextId === response.result.executionContextId)
+ testRunner.log('PASS - execution context id match.');
+ else
+ testRunner.log('fail - execution context id differ.');
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698