blob: 5b4d70535638b9b3890d123227879341e6880f4a [file] [log] [blame]
<script>
var waitingForClose = true;
window.addEventListener('beforeunload', function() {
if (waitingForClose)
alert("FAIL");
}, false);
window.onload = function() {
// There's no real way to know whether the iframe's attempt to close us
// actually failed because it would succeed asynchronously and there is no
// failure event. The best we can do is wait around for a while. The one
// saving grace is that this test is deterministic when it passes.
window.setTimeout(function() {
waitingForClose = false;
opener.done();
}, 100);
}
</script>
<iframe sandbox="allow-scripts" src="close-top.html"></iframe>