| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |