Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / frameNavigation / not-opener.html
blobbdc9c6984c6a6da4cda2f4a18ee974620ff7b150
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
7 testRunner.setCanOpenWindows();
10 function log(msg) {
11 var div = document.createElement("div");
12 div.appendChild(document.createTextNode(msg));
13 document.getElementById("console").appendChild(div);
16 var readyCount = 0;
17 window.addEventListener("message", function(e) {
18 if (e.data == "ready") {
19 ++readyCount;
20 if (readyCount == 2) {
21 helper.postMessage("set", "*");
23 } else if (e.data == "pass") {
24 target.document.body.innerHTML = "Should have navigated this window. It should be still be same-origin.";
25 log("PASS");
26 target.close();
27 helper.postMessage("cleanup", "*");
28 } else if (e.data == "done") {
29 helper.close();
30 if (window.testRunner)
31 testRunner.notifyDone();
33 }, false);
35 window.onload = function() {
36 target = window.open("resources/ready.html", "targetWindow");
37 helper = window.open("http://localhost:8000/security/frameNavigation/resources/not-opener-helper.html");
39 </script>
40 </head>
41 <body>
42 <div id="console"></div>
43 </body>
44 </html>