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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/page/ensureIsolatedWorld.html

Issue 2848653003: Add a DevTools command to create an isolated world for a given frame (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script>
5
6 function test()
7 {
8 var mainFrameId = "";
9 InspectorTest.eventHandler["Runtime.executionContextCreated"] =
10 function(message) {
11 if (message.params.context.auxData.frameId !== mainFrameId)
12 return;
13 if (message.params.context.auxData.isDefault === false) {
14 InspectorTest.log("PASS - isolated world created.");
15 } else {
16 InspectorTest.log("fail - main world created.");
17 }
18 InspectorTest.completeTest();
19 };
20
21 InspectorTest.sendCommandOrDie("Runtime.enable", {}, runtimeAgentEnabled);
22
23 function runtimeAgentEnabled() {
24 InspectorTest.log("Runtime enabled");
25
26 InspectorTest.sendCommandOrDie("Page.enable", {}, pageAgentEnabled);
27 }
28
29 function pageAgentEnabled() {
30 InspectorTest.log("Page enabled");
31 InspectorTest.sendCommandOrDie(
32 "Page.getResourceTree", {}, resourceTreeLoaded);
33 }
34
35 function resourceTreeLoaded(payload) {
36 mainFrameId = payload.frameTree.frame.id;
37 onMainFrameId(mainFrameId);
38 }
39
40 function onMainFrameId(mainFrameId)
41 {
42 InspectorTest.log("Main Frame obtained");
43 InspectorTest.sendCommandOrDie("Page.ensureIsolatedWorld", {
44 frameId: mainFrameId, worldId:1});
45 }
46 }
47
48 </script>
49 </head>
50 <body onload="runTest()">
51 </body>
52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698