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

Unified Diff: content/test/data/hang_before_unload.html

Issue 1825523002: Do not reset navigation state when BeforeUnload is cancelled by a commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed nit Created 4 years, 9 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: content/test/data/hang_before_unload.html
diff --git a/content/test/data/hang_before_unload.html b/content/test/data/hang_before_unload.html
new file mode 100644
index 0000000000000000000000000000000000000000..bd48d4a1198fbd50a6746f8fc02d99aa8d06aeea
--- /dev/null
+++ b/content/test/data/hang_before_unload.html
@@ -0,0 +1,29 @@
+<html>
+
+ <head><title>BeforeUnload dialog</title>
+ <script>
+ function clickLink() {
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false,
+ false, false, 0, null);
+ var target = document.getElementById("link");
+ target.dispatchEvent(evt);
+ }
+
+ function clickLinkSoon() {
+ window.setTimeout(clickLink, 100);
+ return true;
+ }
+
+ window.addEventListener("beforeunload", function(e) {
+ var confirmationMessage = "foo";
+ e.returnValue = confirmationMessage;
+ return confirmationMessage;
+ });
+
+ </script>
+ </head>
+
+<a href="title2.html" id="link">link</a><br>
+
+</html>

Powered by Google App Engine
This is Rietveld 408576698