<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<script>
description("Make sure that windows opened via window.open are not targetable by their opener after it is disowned. If testing manually, you should see 2 tabs open.");
jsTestIsAsync = true;

onload = function() {
    w = window.open("/navigation/resources/otherpage.html", "foo");
    w.opener = null;

    setTimeout(function() {
        w = open("/navigation/resources/otherpage.html", "foo"); // Should create a new window.
        shouldBeEqualToString("w.location.href", "about:blank");
        w.onload = function() {
            if (window.testRunner)
                shouldBe("testRunner.windowCount()", "3");
            finishJSTest();
        }
    }, 100);
}    
</script>
</body>
</html>
