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

Unified Diff: chrome/test/data/fast_tab_close/unload_sleep_before_cookie.html

Issue 11016023: Quickly close tabs/window with long-running unload handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 7 years, 6 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/fast_tab_close/unload_sleep_before_cookie.html
diff --git a/chrome/test/data/fast_tab_close/unload_sleep_before_cookie.html b/chrome/test/data/fast_tab_close/unload_sleep_before_cookie.html
new file mode 100644
index 0000000000000000000000000000000000000000..93b700bb45f6f97e5b08dc43791b01e5ed0f29b5
--- /dev/null
+++ b/chrome/test/data/fast_tab_close/unload_sleep_before_cookie.html
@@ -0,0 +1,28 @@
+<!--
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+-->
+<html>
+<head>
+ <title>unload_sleep_before_cookie</title>
+<script>
+function sleep_ms(ms) {
+ var start_ms = Number(new Date());
+ var remaining_ms = ms;
+ while (remaining_ms > 0) {
+ remaining_ms = ms - (Number(new Date()) - start_ms);
+ }
+}
+addEventListener("unload", function() {
+ sleep_ms(200);
+
+ var expires = new Date();
+ expires.setMinutes(expires.getMinutes() + 1);
+ document.cookie = "unloaded=ohyeah;path=/;expires=" + expires.toUTCString();
+ console.log("set the cookie");
+}, false);
+</script>
+</head>
+<body></body>
+</html>
« no previous file with comments | « chrome/test/data/fast_tab_close/unload_sets_cookie.html ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698