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

Unified 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: 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/inspector-protocol/page/javascriptDialogEvents.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/javascriptDialogEvents.html b/third_party/WebKit/LayoutTests/inspector-protocol/page/javascriptDialogEvents.html
index 87c7f0843b449bd010e4524777e8d270331e0ca3..4e002c7d871908c33d48e657e2299d3efdb0a064 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/page/javascriptDialogEvents.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/javascriptDialogEvents.html
@@ -5,6 +5,13 @@
testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true);
+// JavaScript onbeforeunload dialogs require a user gesture.
+if (window.eventSender) {
+ eventSender.mouseMoveTo(5, 5);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
window.onbeforeunload = onBeforeUnload;
function onBeforeUnload()

Powered by Google App Engine
This is Rietveld 408576698