Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / before-unload-javascript-navigation.html
blobadb12d1f80550f249139d45b48ac7827d3b52055
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>
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.waitUntilDone();
13 var log = document.getElementById('log');
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';
22 function done() {
23 log.innerHTML = 'PASS';
24 if (window.testRunner)
25 testRunner.notifyDone();
28 function fired(contentWindow) {
29 location.href = 'javascript:top.done()';
32 </script>
33 <iframe onload="test(this);" src="resources/before-unload-in-subframe-child.html"></iframe>
34 </body>
35 </html>