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

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

Issue 2848653003: Add a DevTools command to create an isolated world for a given frame (Closed)
Patch Set: Rebased Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.html b/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.html
new file mode 100644
index 0000000000000000000000000000000000000000..5936158b7ef79faa1367c133a5a1b1ecbba56d39
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.html
@@ -0,0 +1,53 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script>
+
+function test()
+{
+ var mainFrameId = "";
+ InspectorTest.eventHandler["Runtime.executionContextCreated"] =
+ function(message) {
+ if (message.params.context.auxData.frameId !== mainFrameId)
+ return;
+ if (message.params.context.auxData.isDefault === false &&
+ message.params.context.name === "Test world") {
+ InspectorTest.log("PASS - isolated world created.");
+ } else {
+ InspectorTest.log("fail - main world created.");
+ InspectorTest.log(JSON.stringify(message.params));
+ }
+ InspectorTest.completeTest();
+ };
+
+ InspectorTest.sendCommandOrDie("Runtime.enable", {}, runtimeAgentEnabled);
+
+ function runtimeAgentEnabled() {
+ InspectorTest.log("Runtime enabled");
+
+ InspectorTest.sendCommandOrDie("Page.enable", {}, pageAgentEnabled);
+ }
+
+ function pageAgentEnabled() {
+ InspectorTest.log("Page enabled");
+ InspectorTest.sendCommandOrDie(
+ "Page.getResourceTree", {}, resourceTreeLoaded);
+ }
+
+ function resourceTreeLoaded(payload) {
+ mainFrameId = payload.frameTree.frame.id;
+ onMainFrameId(mainFrameId);
+ }
+
+ function onMainFrameId(mainFrameId) {
+ InspectorTest.log("Main Frame obtained");
+ InspectorTest.sendCommandOrDie("Page.createIsolatedWorld", {
+ frameId: mainFrameId, worldName: "Test world"});
+ }
+}
+
+</script>
+</head>
+<body onload="runTest()">
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698