3 <script src="resources/cross-frame-access.js"></script>
5 window.onload = function()
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
12 window.addEventListener('message', function () {
14 if (window.testRunner)
15 testRunner.notifyDone();
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')");
41 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get-override-test.html"></iframe>
42 <pre id="console"></pre>