blob: b984c69d47f66f91ebee95b9e8e2ca8d6336f8a9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Tests opening a new about://webkit.org window and accessing its document");
jsTestIsAsync = true;
var newWindow;
if (window.testRunner) {
testRunner.setCanOpenWindows();
testRunner.setPopupBlockingEnabled(false);
}
function finish()
{
clearInterval(handle);
finishJSTest();
}
function checkCannotAccessDocument()
{
try {
newWindow.document;
if (newWindow.document.URL != "about:blank") {
testFailed("Managed to access the document at URL " + newWindow.document.URL);
finish();
}
} catch (_e) {
e = _e;
shouldBeEqualToString("e.name", "SecurityError");
finish();
}
}
onload = function () {
newWindow = window.open("about://webkit.org");
handle = setInterval(checkCannotAccessDocument, 5);
}
</script>
</body>
</html>