Integrate media query evaluation into HTML5 event loop
[WebKit-https.git] / LayoutTests / fast / events / before-unload-javascript-navigation.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This test ensures setting location.href with javascript scheme  properly executes the script even while beforeunload event is being fired. You should see PASS 1/2 and PASS 2/2 below:</p>
5 <pre id="log">FAIL</pre>
6 <script>
7
8 if (window.testRunner) {
9     testRunner.dumpAsText();
10     testRunner.waitUntilDone();
11 }
12
13 var log = document.getElementById('log');
14
15 function test(iframe) {
16     if (iframe.done)
17         return;
18     iframe.done = true;
19     iframe.contentWindow.location.href = 'resources/before-unload-in-subframe-child.html';
20 }
21
22 function done() {
23     log.innerHTML = 'PASS';
24     if (window.testRunner)
25         testRunner.notifyDone();
26 }
27
28 function fired(contentWindow) {
29     location.href = 'javascript:top.done()';
30 }
31
32 </script>
33 <iframe onload="test(this);" src="resources/before-unload-in-subframe-child.html"></iframe>
34 </body>
35 </html>