<!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;

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>
