Keep around a pre-warmed process when doing process swap on navigation
[WebKit.git] / LayoutTests / fast / events / beforeunload-alert-user-interaction.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test-pre.js"></script>
5 <script>
6 description("Tests that the beforeunload alert is shown when the user interacted with the page. You should see a 'CONFIRM NAVIGATION' message at the top.");
7 jsTestIsAsync = true;
8
9 onload = function() {
10     const testFrame = document.getElementById("testFrame");
11     testFrame.contentWindow.onbeforeunload = function(e) {
12         return "PASS: a beforeunload alert was shown.";
13     };
14     // Simulate a user interaction.
15     const testInput = document.getElementById("testInput");
16     testInput.focus();
17     if (window.eventSender)
18         eventSender.keyDown("a");
19     setTimeout(function() {
20         testFrame.src = "about:blank";
21         setTimeout(finishJSTest, 0);
22     }, 0);
23 };
24 </script>
25 <iframe id="testFrame" src="resources/onclick.html"></iframe>
26 <input id="testInput" type="text"></input>
27 <script src="../../resources/js-test-post.js"></script>
28 </body>
29 </html>