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 ()
15 if (window
.testRunner
)
16 testRunner
.notifyDone();
22 window
.targetWindow
= frames
[0];
24 log("----- tests for getting a targetWindow's location object's functions which have custom overrides. The" +
25 " desired behavior is for the targetWindow to return the builtin function, not the override -----\n");
27 // We should test overriding using window.location.__proto__ once the Location object has a proper prototype.
29 // Overriden using window.location.assign = function() { return "new assign" }
30 shouldBeTrue("canGet('targetWindow.location.assign')");
31 shouldBe("toString('targetWindow.location.assign')", "toString('window.location.assign')");
33 // Overriden using window.location.reload = "new reload"
34 shouldBeFalse("canGet('targetWindow.location.reload')");
36 // Overriden using window.location.reload = "new replace"
37 shouldBeTrue("canGet('targetWindow.location.replace')");
38 shouldBe("toString('targetWindow.location.replace')", "toString('window.location.replace')");
43 <iframe src=
"http://localhost:8000/security/resources/cross-frame-iframe-for-location-get-override-test.html"></iframe>
44 <pre id=
"console"></pre>