Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / cross-frame-access-get-override.html
blobb69d89a1756d52a6e0f9715b50da0a8bf1b18503
1 <html>
2 <head>
3 <script src="resources/cross-frame-access.js"></script>
4 <script>
5 window.onload = function()
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
12 window.addEventListener('message', function () {
13 runTest();
14 if (window.testRunner)
15 testRunner.notifyDone();
16 });
19 runTest = function()
21 window.targetWindow = frames[0];
23 log("----- tests for getting a targetWindow's functions which have custom overrides. The desired " +
24 " behavior is for the targetWindow to return the built-in function, not the override -----\n");
26 // Overriden using window.focus = function() { return "new focus" }
27 shouldBeTrue("canGet('targetWindow.focus')");
28 shouldBe("toString('targetWindow.focus')", "toString('window.focus')");
30 // Overriden using window.__proto__.blur = function() { return "new blur;" }
31 shouldBeTrue("canGet('targetWindow.blur')");
32 shouldBe("toString('targetWindow.blur')", "toString('window.blur')");
34 // Overriden using window.history.close = "new close"
35 shouldBeTrue("canGet('targetWindow.close')");
36 shouldBe("toString('targetWindow.close')", "toString('window.close')");
38 </script>
39 </head>
40 <body>
41 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get-override-test.html"></iframe>
42 <pre id="console"></pre>
43 </body>
44 </html>