Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / isolatedWorld / didClearWindowObject.html
blobf9e95bb9dc81e37555a292c4afc45030988a36a5
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <div id="console"></div>
5 <script>
6 var message;
7 if ("__worldID" in window)
8 message = "FAIL: __worldID in normal world is " + __worldID + ".";
9 else
10 message = "PASS: __worldID is undefined in normal world.";
11 var pre = document.createElement("pre");
12 pre.appendChild(document.createTextNode(message));
13 document.getElementById("console").appendChild(pre);
15 if (window.testRunner) {
16 testRunner.dumpAsText();
17 var worldID = 1;
18 testRunner.evaluateScriptInIsolatedWorld(
19 worldID,
21 var message; \
22 if (!("__worldID" in window)) \
23 message = "FAIL: __worldID is undefined in isolated world ' + worldID + '."; \
24 else if (__worldID != ' + worldID + ') \
25 message = "FAIL: __worldID in isolated world is " + __worldID + " but should be ' + worldID + '."; \
26 else \
27 message = "PASS: __worldID in isolated world should be ' + worldID + ' and is."; \
28 var pre = document.createElement("pre"); \
29 pre.appendChild(document.createTextNode(message)); \
30 document.getElementById("console").appendChild(pre); \
31 ');
33 </script>
34 </body>
35 </html>