blob: 75d79636e4d44ef71396b1ad5fe46c1ca67e5def [file] [log] [blame]
<html>
<head>
<script src="resources/cross-frame-access.js"></script>
<script>
window.onload = function()
{
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.targetWindow = frames[0];
log("----- tests for getting a targetWindow's functions which have custom overrides. The desired " +
" behavior is for the targetWindow to return the built-in function, not the override -----\n");
// Overriden using window.focus = function() { return "new focus" }
shouldBeTrue("canGet('targetWindow.focus')");
shouldBe("toString('targetWindow.focus')", "toString('window.focus')");
// Overriden using window.__proto__.blur = function() { return "new blur;" }
shouldBeTrue("canGet('targetWindow.blur')");
shouldBe("toString('targetWindow.blur')", "toString('window.blur')");
// Overriden using window.history.close = "new close"
shouldBeTrue("canGet('targetWindow.close')");
shouldBe("toString('targetWindow.close')", "toString('window.close')");
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body>
<iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get-override-test.html"></iframe>
<pre id="console"></pre>
</body>
</html>