Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/loader/show-only-one-beforeunload-dialog.html

Issue 2801813005: Only show a beforeunload dialog if a frame has had a user gesture since its load. (Closed)
Patch Set: aw Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script> 4 <script>
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 } 8 }
9 9
10 // JavaScript onbeforeunload dialogs require a user gesture.
11 if (window.eventSender) {
12 eventSender.mouseMoveTo(5, 5);
13 eventSender.mouseDown();
14 eventSender.mouseUp();
15 }
16
10 window.onload = function() 17 window.onload = function()
11 { 18 {
12 window.setTimeout("window.location.href = 'resources/notify-done.html';" , 0); 19 window.setTimeout("window.location.href = 'resources/notify-done.html';" , 0);
13 } 20 }
14 21
15 window.onbeforeunload = function() 22 window.onbeforeunload = function()
16 { 23 {
17 return "This is beforeunload from the top level frame."; 24 return "This is beforeunload from the top level frame.";
18 } 25 }
19 </script> 26 </script>
20 <body> 27 <body>
21 <p>This page registers a 'beforeunload' handler, and contains multiple IFram es that each do the same. Only the initial dialog from this top-level frame shou ld display. The IFrame dialogs should be suppressed.</p> 28 <p>This page registers a 'beforeunload' handler, and contains multiple IFram es that each do the same. Only the initial dialog from this top-level frame shou ld display. The IFrame dialogs should be suppressed.</p>
22 <iframe src="resources/iframe-with-beforeunload.html"></iframe> 29 <iframe src="resources/iframe-with-beforeunload.html"></iframe>
23 <iframe src="resources/iframe-with-beforeunload.html"></iframe> 30 <iframe src="resources/iframe-with-beforeunload.html"></iframe>
24 </body> 31 </body>
25 </html> 32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698