Bug 1488441 - Extend cookie's expiring time from 1s to 3s r=jdm
authorKershaw Chang <kershaw@mozilla.com>
Wed, 05 Sep 2018 18:24:51 +0000
changeset 435003 8db4f905ae7af3cc59ff0832b4bac21edb810f09
parent 435002 b9e56df24edc03611d26e9b0944ef4b88b4f7fc8
child 435004 a76bc2779d81cb36ba82eda3c5325b410d36f769
push id107530
push userapavel@mozilla.com
push dateThu, 06 Sep 2018 04:44:27 +0000
treeherdermozilla-inbound@5f5d7a3ce332 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1488441
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1488441 - Extend cookie's expiring time from 1s to 3s r=jdm The fail log shows that the cookie's expiring time is too short(only 1s). The cookie could be already expired. A simple solution in this patch is just extending the expiring time to 3s. Differential Revision: https://phabricator.services.mozilla.com/D5034
netwerk/cookie/test/unit/test_eviction.js
--- a/netwerk/cookie/test/unit/test_eviction.js
+++ b/netwerk/cookie/test/unit/test_eviction.js
@@ -53,26 +53,28 @@ async function test_basic_eviction(base_
 
     // Check if cookies are evicted by last accessed time.
     cs.getCookieString(FOO_PATH, null);
     await setCookie("session_foo_path_7", null, "/foo", null, FOO_PATH);
     verifyCookies(['session_foo_path_5',
                    'session_foo_path_6',
                    'session_foo_path_7'], BASE_URI);
 
-    await setCookie("non_session_expired_foo_path_1", null, "/foo", 1, FOO_PATH);
-    await setCookie("non_session_expired_foo_path_2", null, "/foo", 1, FOO_PATH);
+    const EXPIRED_TIME = 3;
+
+    await setCookie("non_session_expired_foo_path_1", null, "/foo", EXPIRED_TIME, FOO_PATH);
+    await setCookie("non_session_expired_foo_path_2", null, "/foo", EXPIRED_TIME, FOO_PATH);
     verifyCookies(['session_foo_path_5',
                    'session_foo_path_6',
                    'session_foo_path_7',
                    'non_session_expired_foo_path_1',
                    'non_session_expired_foo_path_2'], BASE_URI);
 
     // Check if expired cookies are evicted first.
-    await new Promise(resolve => do_timeout(1000, resolve));
+    await new Promise(resolve => do_timeout(EXPIRED_TIME * 1000, resolve));
     await setCookie("session_foo_path_8", null, "/foo", null, FOO_PATH);
     verifyCookies(['session_foo_path_6',
                    'session_foo_path_7',
                    'session_foo_path_8'], BASE_URI);
 }
 
 // Verify that the given cookie names exist, and are ordered from least to most recently accessed
 function verifyCookies(names, uri) {