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

Side by Side 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: Remove pointless check 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 message.params.context.name === "Test world") {
15 InspectorTest.log("PASS - isolated world created.");
16 } else {
17 InspectorTest.log("fail - main world created.");
18 InspectorTest.log(JSON.stringify(message.params));
19 }
20 InspectorTest.completeTest();
21 };
22
23 InspectorTest.sendCommandOrDie("Runtime.enable", {}, runtimeAgentEnabled);
24
25 function runtimeAgentEnabled() {
26 InspectorTest.log("Runtime enabled");
27
28 InspectorTest.sendCommandOrDie("Page.enable", {}, pageAgentEnabled);
29 }
30
31 function pageAgentEnabled() {
32 InspectorTest.log("Page enabled");
33 InspectorTest.sendCommandOrDie(
34 "Page.getResourceTree", {}, resourceTreeLoaded);
35 }
36
37 function resourceTreeLoaded(payload) {
38 mainFrameId = payload.frameTree.frame.id;
39 onMainFrameId(mainFrameId);
40 }
41
42 function onMainFrameId(mainFrameId)
43 {
Sami 2017/05/05 09:33:14 nit: move to end of previous line
alex clarke (OOO till 29th) 2017/05/05 14:52:29 Done.
44 InspectorTest.log("Main Frame obtained");
45 InspectorTest.sendCommandOrDie("Page.createIsolatedWorld", {
46 frameId: mainFrameId, worldName: "Test world"});
47 }
48 }
49
50 </script>
51 </head>
52 <body onload="runTest()">
53 </body>
54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698