Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / resources / cross-frame-iframe-for-location-put-test.html
blobbe276849e4065df1157d2e9bc262592fa377abc5
1 <html>
2 <head>
3 <script src="cross-frame-access.js"></script>
4 <script>
5 var assignOld;
6 var replaceOld;
7 var reloadOld;
8 var toStringOld;
9 var customAttributeOld;
11 receiver = function(e)
13 if (e.data == "settingValuesComplete")
14 setCheck();
16 addEventListener('message', receiver, false);
18 window.onload = function()
20 // Add manuel run buttons if the browser does not support window.postMessage
21 if (!window.postMessage) {
22 var button = document.createElement("button");
23 button.appendChild(document.createTextNode("Step 2 - Set Check"));
24 button.onclick = setCheck;
25 document.body.appendChild(button);
28 window.location.customAttribute = "customAttribute";
30 assignOld = window.location.assign;
31 replaceOld = window.location.replace;
32 reloadOld = window.location.reload;
33 toStringOld = window.location.toString;
34 customAttributeOld = window.location.customAttribute;
36 if (window.postMessage)
37 window.parent.postMessage("storedOldValuesComplete", "*");
40 setCheck = function()
42 log("\n----- tests for putting window.history and its properties -----\n");
44 shouldBe("window.location.assign", "assignOld");
45 shouldBe("window.location.replace", "replaceOld");
46 shouldBe("window.location.reload", "reloadOld");
47 shouldBe("window.location.toString", "toStringOld");
48 shouldBe("window.location.customAttribute", "customAttributeOld");
50 if (window.testRunner)
51 testRunner.notifyDone();
53 </script>
54 </head>
55 <body>
56 <pre id="console"></pre>
57 </body>
58 </html>