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

Unified Diff: chrome/test/data/beforeunload_slow.html

Issue 1968933002: Fix: tabs slow to response to beforeunload are closed prematurely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct order of checks Created 4 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: chrome/test/data/beforeunload_slow.html
diff --git a/chrome/test/data/beforeunload_slow.html b/chrome/test/data/beforeunload_slow.html
new file mode 100644
index 0000000000000000000000000000000000000000..8331a2281b1df2df68d2c5f6ccb9bac8686e311a
--- /dev/null
+++ b/chrome/test/data/beforeunload_slow.html
@@ -0,0 +1,19 @@
+<html>
+ <head>
+ <title>Loading...</title>
+ <script>
+ window.onbeforeunload = function(e) {
+ // Delay must be slightly bigger than
+ // RenderViewHostImpl::kUnloadTimeoutMS to trigger
+ // "renderer unresponsive".
+ var delay = 1500;
+ var finishTime = new Date().getTime() + delay;
+ while (new Date() < finishTime) {}
+ return null;
+ };
+ </script>
+ </head>
+ <body>
+ <p>Navigate to another page to trigger beforeunload handler.</p>
+ </body>
+</html>
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager_browsertest.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698