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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 // Copyright 2013 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 -->
6 <html>
7 <head>
8 <title>unload_sleep_before_cookie</title>
9 <script>
10 function sleep_ms(ms) {
11 var start_ms = Number(new Date());
12 var remaining_ms = ms;
13 while (remaining_ms > 0) {
14 remaining_ms = ms - (Number(new Date()) - start_ms);
15 }
16 }
17 addEventListener("unload", function() {
18 sleep_ms(200);
19
20 var expires = new Date();
21 expires.setMinutes(expires.getMinutes() + 1);
22 document.cookie = "unloaded=ohyeah;path=/;expires=" + expires.toUTCString();
23 console.log("set the cookie");
24 }, false);
25 </script>
26 </head>
27 <body></body>
28 </html>
OLDNEW
« 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