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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/page/javascriptDialogEvents.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 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true); 6 testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true);
7 7
8 // JavaScript onbeforeunload dialogs require a user gesture.
9 if (window.eventSender) {
10 eventSender.mouseMoveTo(5, 5);
11 eventSender.mouseDown();
12 eventSender.mouseUp();
13 }
14
8 window.onbeforeunload = onBeforeUnload; 15 window.onbeforeunload = onBeforeUnload;
9 16
10 function onBeforeUnload() 17 function onBeforeUnload()
11 { 18 {
12 window.removeEventListener("beforeunload", onBeforeUnload); 19 window.removeEventListener("beforeunload", onBeforeUnload);
13 return "beforeunload in javascriptDialogEvents"; 20 return "beforeunload in javascriptDialogEvents";
14 } 21 }
15 22
16 function test() 23 function test()
17 { 24 {
(...skipping 28 matching lines...) Expand all
46 { 53 {
47 InspectorTest.completeTest(); 54 InspectorTest.completeTest();
48 } 55 }
49 } 56 }
50 57
51 </script> 58 </script>
52 </head> 59 </head>
53 <body onload="runTest()"> 60 <body onload="runTest()">
54 </body> 61 </body>
55 </html> 62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698