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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html

Issue 2801813005: Only show a beforeunload dialog if a frame has had a user gesture since its load. (Closed)
Patch Set: one last bit Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html b/third_party/WebKit/LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html
index e0790a75e7d1d0450d255cf2ee7e50e52c4d21b0..0b31c37760acc5e19ee01b996d5e15d2984f61aa 100644
--- a/third_party/WebKit/LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html
@@ -1,6 +1,13 @@
<html>
<body>
<script>
+// JavaScript onbeforeunload dialogs require a user gesture.
+if (window.eventSender) {
+ eventSender.mouseMoveTo(5, 5);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
window.onbeforeunload = function() {
window.close();
return "This should only appear once.";

Powered by Google App Engine
This is Rietveld 408576698