Chromium Code Reviews| 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..a10ec827931411e48f014a9c580e9f8d09e0a702 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/createIsolatedWorld.html |
| @@ -0,0 +1,54 @@ |
| +<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) |
| + { |
|
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.
|
| + InspectorTest.log("Main Frame obtained"); |
| + InspectorTest.sendCommandOrDie("Page.createIsolatedWorld", { |
| + frameId: mainFrameId, worldName: "Test world"}); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +</body> |
| +</html> |