blob: 1ec518e9e49ecef39da5a3207938deb89086352d [file] [log] [blame]
<!DOCTYPE html>
<html>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description("Test that a Window can be focused / closed by its opener");
window.jsTestIsAsync = true;
if (window.testRunner)
testRunner.setCanOpenWindows(true);
debug("* Opening new window");
newWindow = window.open('about:blank', '_blank');
newWindow.onfocus = function() {
testPassed("New Window focused");
newWindow.close();
setTimeout(function() {
shouldBeTrue("newWindow.closed");
finishJSTest();
}, 0);
}
shouldBe("newWindow.opener", "window");
evalAndLog("newWindow.focus()");
</script>
<script src="../../../resources/js-test-post.js"></script>
</html>