<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.dumpChildFramesAsText();
    testRunner.waitUntilDone();
}

function removeIframeA()
{
    document.body.removeChild(document.querySelector("iframe[name=A]"));
}
</script>
</head>
<body>
<p>Tests that we do not crash when removing the opener after using window.open() to load a resource that redirects.</p>
<iframe name="A" srcdoc='
<script>
window.open("http://127.0.0.1:8000/cache/resources/cache-control-redirect.py?url=http://127.0.0.1:8000/navigation/resources/window-open-redirect-and-remove-opener.html", "B");
parent.removeIframeA();
</script>
'></iframe>
<iframe name="B"></iframe>
</body>
</html>
