Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / onbeforeunload-focused-iframe.html
blobfddecd73c7274086d8fe53e7d43e996ce316be72
1 <html>
2 <body>
3 New window with beforeUnload handler.<br>
4 You should see an alert with "beforeUnload" if you try to close the window.<br>
5 <iframe src="resources/onbeforeunload-focused-iframe-frame.html" name="focusedFrame"></iframe>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.dumpChildFramesAsText();
10 testRunner.waitUntilDone();
13 window.onbeforeunload = beforeUnload;
14 function beforeUnload()
16 alert("beforeUnload");
17 window.onbeforeunload = null;
21 function simulateCloseWindow()
23 if (window.testRunner) {
24 // Simulate an attempt to close the window
25 if (!testRunner.callShouldCloseOnWebView())
26 alert("Should have run the beforeUnload handler.");
27 testRunner.notifyDone();
30 </script>
31 </body>
32 </html>