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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue.html b/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue.html
index 979567c439a00997a5675087c56071152abe65f0..190cbc40530ec06e8ecc91aed681f4474806d511 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue.html
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue.html
@@ -6,6 +6,13 @@
if (window.testRunner)
testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true);
+// JavaScript onbeforeunload dialogs require a user gesture.
+if (window.eventSender) {
+ eventSender.mouseMoveTo(5, 5);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
window.onload = function() {
window.location.href = "resources/does-not-exist.html";
setTimeout(finishJSTest, 0);

Powered by Google App Engine
This is Rietveld 408576698