Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / resources / sandboxed-iframe-close-top-does-not-close.html
blob5b4d70535638b9b3890d123227879341e6880f4a
1 <script>
2 var waitingForClose = true;
3 window.addEventListener('beforeunload', function() {
4 if (waitingForClose)
5 alert("FAIL");
6 }, false);
8 window.onload = function() {
9 // There's no real way to know whether the iframe's attempt to close us
10 // actually failed because it would succeed asynchronously and there is no
11 // failure event. The best we can do is wait around for a while. The one
12 // saving grace is that this test is deterministic when it passes.
13 window.setTimeout(function() {
14 waitingForClose = false;
15 opener.done();
16 }, 100);
18 </script>
19 <iframe sandbox="allow-scripts" src="close-top.html"></iframe>