| OLD | NEW |
| (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 InspectorTest.log("Main Frame obtained"); | |
| 44 InspectorTest.sendCommandOrDie("Page.createIsolatedWorld", { | |
| 45 frameId: mainFrameId, worldName: "Test world"}); | |
| 46 } | |
| 47 } | |
| 48 | |
| 49 </script> | |
| 50 </head> | |
| 51 <body onload="runTest()"> | |
| 52 </body> | |
| 53 </html> | |
| OLD | NEW |