Bug 1769346 [wpt PR 34064] - Reland "[Cookie Expires/Max-Age Upper Limit] (3) Enable by default", a=testonly
authorAri Chivukula <arichiv@chromium.org>
Wed, 18 May 2022 03:34:51 +0000
changeset 618479 903e182c6f5d3221be4e9fb0eab71567662adce6
parent 618478 3086fc419c644073d2805c4193a3b44903b0a532
child 618480 4215d4e3a498b08d250eec832ca05990ab309bdf
push id163295
push userwptsync@mozilla.com
push dateSun, 22 May 2022 08:42:45 +0000
treeherderautoland@28d8297085fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1769346, 34064, 1264458, 3561385, 1003286, 1325493, 3648321, 1003366, 3645552, 1004201
milestone102.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 1769346 [wpt PR 34064] - Reland "[Cookie Expires/Max-Age Upper Limit] (3) Enable by default", a=testonly Automatic update from web-platform-tests Reland "[Cookie Expires/Max-Age Upper Limit] (3) Enable by default" This reverts commit c8b12486f3e497a3477614f3c2d9fc0d66f9d568. Reason for revert: Fixing broken bots, underlying change is correct one Original change's description: > Revert "[Cookie Expires/Max-Age Upper Limit] (3) Enable by default" > > This reverts commit caff7911aeddc8d231dc335715d1dda404320f67. > > Reason for revert: Failing multiple bots > > Original change's description: > > [Cookie Expires/Max-Age Upper Limit] (3) Enable by default > > > > This won't be committed until after shipping is approved. > > For now, this is just for vetting. > > > > This CL is a part of a series: > > (1) Add new UMA > > (2) Implement limit behind flag > > (3) Enable by default > > > > Spec: > > https://github.com/httpwg/http-extensions/pull/1732 > > > > Bug: 1264458 > > Change-Id: Idc0469d260c4a5706a9c64feec9af5a0f490d311 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561385 > > Reviewed-by: Christian Dullweber <dullweber@chromium.org> > > Reviewed-by: Clark DuVall <cduvall@chromium.org> > > Auto-Submit: Ari Chivukula <arichiv@chromium.org> > > Reviewed-by: David Roger <droger@chromium.org> > > Reviewed-by: Steven Bingler <bingler@chromium.org> > > Commit-Queue: Ari Chivukula <arichiv@chromium.org> > > Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1003286} > > Bug: 1264458, 1325493 > Change-Id: Ia10ffe2f5b6b21a6de3f6bc3a3014510ac3a0e68 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3648321 > Commit-Queue: Lijin Shen <lazzzis@google.com> > Owners-Override: Lijin Shen <lazzzis@google.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1003366} Bug: 1264458, 1325493 Change-Id: Id9a059fe1c9755420aacc5fb0fc428883259facf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645552 Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Commit-Queue: Christian Dullweber <dullweber@chromium.org> Reviewed-by: Clark DuVall <cduvall@chromium.org> Reviewed-by: Christian Dullweber <dullweber@chromium.org> Auto-Submit: Ari Chivukula <arichiv@chromium.org> Reviewed-by: David Roger <droger@chromium.org> Reviewed-by: Steven Bingler <bingler@chromium.org> Cr-Commit-Position: refs/heads/main@{#1004201} -- wpt-commits: 4d6b7ec2c615f8736db9cee73deaacdaf2c17490 wpt-pr: 34064
testing/web-platform/tests/cookie-store/cookieListItem_attributes.https.any.js
--- a/testing/web-platform/tests/cookie-store/cookieListItem_attributes.https.any.js
+++ b/testing/web-platform/tests/cookie-store/cookieListItem_attributes.https.any.js
@@ -1,17 +1,19 @@
 // META: title=Cookie Store API: cookieListItem attributes
 // META: global=window,serviceworker
 
 'use strict';
 
 const kCurrentHostname = (new URL(self.location.href)).hostname;
 
 const kOneDay = 24 * 60 * 60 * 1000;
+const kFourHundredDays = 400 * kOneDay;
 const kTenYears = 10 * 365 * kOneDay;
+const kFourHundredDaysFromNow = Date.now() + kFourHundredDays;
 const kTenYearsFromNow = Date.now() + kTenYears;
 
 const kCookieListItemKeys =
     ['domain', 'expires', 'name', 'path', 'sameSite', 'secure', 'value'].sort();
 
 promise_test(async testCase => {
   await cookieStore.delete('cookie-name');
 
@@ -63,17 +65,17 @@ promise_test(async testCase => {
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
   assert_equals(cookie.domain, null);
   assert_equals(cookie.path, '/');
-  assert_approx_equals(cookie.expires, kTenYearsFromNow, kOneDay);
+  assert_approx_equals(cookie.expires, kFourHundredDaysFromNow, kOneDay);
   assert_equals(cookie.secure, true);
   assert_equals(cookie.sameSite, 'strict');
   const itemKeys = Object.keys(cookie);
   for (const key of kCookieListItemKeys) {
     assert_in_array(key, itemKeys);
   }
 }, 'CookieListItem - cookieStore.set with expires set to a timestamp 10 ' +
    'years in the future');
@@ -86,17 +88,17 @@ promise_test(async testCase => {
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
   assert_equals(cookie.domain, null);
   assert_equals(cookie.path, '/');
-  assert_approx_equals(cookie.expires, kTenYearsFromNow, kOneDay);
+  assert_approx_equals(cookie.expires, kFourHundredDaysFromNow, kOneDay);
   assert_equals(cookie.secure, true);
 }, 'CookieListItem - cookieStore.set with expires set to a Date 10 ' +
    'years in the future');
 
 promise_test(async testCase => {
   await cookieStore.delete({ name: 'cookie-name', domain: kCurrentHostname });
 
   await cookieStore.set({ name: 'cookie-name', value: 'cookie-value',