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

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: Addressed comments 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..8c7c1f014cf9043bfa8cefe8989f57aed053c126
--- /dev/null
+++ b/content/test/data/hang_before_unload.html
@@ -0,0 +1,30 @@
+<html>
+
+<head><title>Possible BeforeUnload</title>
Charlie Reis 2016/03/29 18:33:21 Why "Possible"?
clamy 2016/03/30 13:31:11 Because the first version did not have the dialog
+ <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() {
Charlie Reis 2016/03/29 18:33:21 nit: Use consistent indent.
clamy 2016/03/30 13:31:11 Done.
+ window.setTimeout(clickLink, 100);
+ return true;
+}
+
+ window.addEventListener("beforeunload", function(e){
Charlie Reis 2016/03/29 18:33:21 nit: Space before {
clamy 2016/03/30 13:31:11 Done.
+ var confirmationMessage = "foo";
+ e.returnValue = confirmationMessage;
+ return confirmationMessage;
+ });
Charlie Reis 2016/03/29 18:33:21 nit: 2 fewer spaces.
clamy 2016/03/30 13:31:11 Done.
+
+ </script>
+ </head>
+
+ <a href="title2.html" id="link">link</a><br>
+
+ </html>

Powered by Google App Engine
This is Rietveld 408576698