Bug 1644901 [wpt PR 24101] - CookieStore: change set() to use CookieInit, a=testonly
authorAyu Ishii <ayui@chromium.org>
Mon, 22 Jun 2020 10:43:02 +0000
changeset 536831 899bf600e00344ca7f0d85b9df8f7dce064f11a8
parent 536830 44e745f12a23b24f76307d635854f8d42cced469
child 536832 b7ebb9c9a0fe13d816f6789082ebdf5c87f6e72d
push id37533
push userdluca@mozilla.com
push dateTue, 23 Jun 2020 21:38:40 +0000
treeherdermozilla-central@d48aa0f0aa0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1644901, 24101, 1087580, 2220556, 779365
milestone79.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 1644901 [wpt PR 24101] - CookieStore: change set() to use CookieInit, a=testonly Automatic update from web-platform-tests CookieStore: change set() to use CookieInit Per TAG review discussion [1], this change updates the set() method as follows: Promise<void> set(USVString name, USVString value); Promise<void> set(CookieInit cookieInit); dictionary CookieInit { required USVString name; required USVString value; USVString? domain = null; USVString path = "/"; DOMTimeStamp? expires = null; CookieSameSite sameSite = "strict"; }; [1] https://github.com/WICG/cookie-store/pull/141 Bug: 1087580 Change-Id: Ic22ae0bc7dfc3df71ac849b9acd894316fe01377 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220556 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Victor Costan <pwnall@chromium.org> Commit-Queue: Ayu Ishii <ayui@chromium.org> Cr-Commit-Position: refs/heads/master@{#779365} -- wpt-commits: c3a358ca3746433553b0a8764731f19eda8f4bbc wpt-pr: 24101
testing/web-platform/tests/cookie-store/cookieListItem_attributes.tentative.https.any.js
testing/web-platform/tests/cookie-store/cookieStore_delete_arguments.tentative.https.any.js
testing/web-platform/tests/cookie-store/cookieStore_set_arguments.tentative.https.any.js
testing/web-platform/tests/cookie-store/cookieStore_special_names.tentative.https.any.js
--- a/testing/web-platform/tests/cookie-store/cookieListItem_attributes.tentative.https.any.js
+++ b/testing/web-platform/tests/cookie-store/cookieListItem_attributes.tentative.https.any.js
@@ -47,18 +47,18 @@ promise_test(async testCase => {
   assert_equals(cookie.secure, true);
   assert_equals(cookie.sameSite, 'strict');
   assert_array_equals(Object.keys(cookie).sort(), kCookieListItemKeys);
 }, 'CookieListItem - cookieStore.set defaults with name and value in options');
 
 promise_test(async testCase => {
   await cookieStore.delete('cookie-name');
 
-  await cookieStore.set('cookie-name', 'cookie-value',
-                        { expires: kTenYearsFromNow });
+  await cookieStore.set({ name: 'cookie-name', value: 'cookie-value',
+                          expires: kTenYearsFromNow });
   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, '/');
@@ -68,75 +68,35 @@ promise_test(async testCase => {
   assert_array_equals(Object.keys(cookie).sort(), kCookieListItemKeys);
 }, 'CookieListItem - cookieStore.set with expires set to a timestamp 10 ' +
    'years in the future');
 
 promise_test(async testCase => {
   await cookieStore.delete('cookie-name');
 
   await cookieStore.set({ name: 'cookie-name', value: 'cookie-value',
-                          expires: kTenYearsFromNow });
-  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_equals(cookie.secure, true);
-  assert_equals(cookie.sameSite, 'strict');
-  assert_array_equals(Object.keys(cookie).sort(), kCookieListItemKeys);
-}, 'CookieListItem - cookieStore.set with name and value in options and ' +
-   'expires set to a future timestamp');
-
-promise_test(async testCase => {
-  await cookieStore.delete('cookie-name');
-
-  await cookieStore.set('cookie-name', 'cookie-value',
-                        { expires: new Date(kTenYearsFromNow) });
+                          expires: new Date(kTenYearsFromNow) });
   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_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('cookie-name');
+  await cookieStore.delete({ name: 'cookie-name', domain: kCurrentHostname });
 
   await cookieStore.set({ name: 'cookie-name', value: 'cookie-value',
-                          expires: new Date(kTenYearsFromNow) });
-  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_equals(cookie.secure, true);
-  assert_equals(cookie.sameSite, 'strict');
-  assert_array_equals(Object.keys(cookie).sort(), kCookieListItemKeys);
-}, 'CookieListItem - cookieStore.set with name and value in options and ' +
-   'expires set to a future Date');
-
-promise_test(async testCase => {
-  await cookieStore.delete({ name: 'cookie-name', domain: kCurrentHostname });
-
-  await cookieStore.set('cookie-name', 'cookie-value',
-                        { domain: kCurrentHostname });
+                          domain: kCurrentHostname });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', domain: kCurrentHostname });
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
   assert_equals(cookie.domain, kCurrentHostname);
   assert_equals(cookie.path, '/');
@@ -148,18 +108,18 @@ promise_test(async testCase => {
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory =
       currentPath.substr(0, currentPath.lastIndexOf('/') + 1);
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
 
-  await cookieStore.set('cookie-name', 'cookie-value',
-                        { path: currentDirectory });
+  await cookieStore.set({ name: 'cookie-name', value: 'cookie-value',
+                          path: currentDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
   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, currentDirectory);
@@ -170,18 +130,18 @@ promise_test(async testCase => {
 }, 'CookieListItem - cookieStore.set with path set to the current directory');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory = currentPath.substr(0, currentPath.lastIndexOf('/'));
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
 
-  await cookieStore.set('cookie-name', 'cookie-value',
-                        { path: currentDirectory });
+  await cookieStore.set({ name: 'cookie-name', value: 'cookie-value',
+                          path: currentDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
   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, currentDirectory + '/');
@@ -206,28 +166,9 @@ promise_test(async testCase => {
     assert_equals(cookie.domain, null);
     assert_equals(cookie.path, '/');
     assert_equals(cookie.expires, null);
     assert_equals(cookie.secure, true);
     assert_equals(cookie.sameSite, sameSiteValue);
     assert_array_equals(Object.keys(cookie).sort(), kCookieListItemKeys);
   }, `CookieListItem - cookieStore.set with sameSite set to ${sameSiteValue}`);
 
-  promise_test(async testCase => {
-    await cookieStore.delete('cookie-name');
-
-    await cookieStore.set('cookie-name', 'cookie-value',
-                          { sameSite: sameSiteValue });
-    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_equals(cookie.expires, null);
-    assert_equals(cookie.secure, true);
-    assert_equals(cookie.sameSite, sameSiteValue);
-    assert_array_equals(Object.keys(cookie).sort(), kCookieListItemKeys);
-  }, 'CookieListItem - cookieStore.set with positional name and value and ' +
-     `sameSite set to ${sameSiteValue}`);
 });
--- a/testing/web-platform/tests/cookie-store/cookieStore_delete_arguments.tentative.https.any.js
+++ b/testing/web-platform/tests/cookie-store/cookieStore_delete_arguments.tentative.https.any.js
@@ -18,44 +18,34 @@ promise_test(async testCase => {
   });
 
   await cookieStore.delete({ name: 'cookie-name' });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.delete with name in options');
 
 promise_test(async testCase => {
-  await cookieStore.set('cookie-name', 'cookie-value');
-  testCase.add_cleanup(async () => {
-    await cookieStore.delete('cookie-name');
-  });
-
-  await cookieStore.delete('cookie-name', { name: 'wrong-cookie-name' });
-  const cookie = await cookieStore.get('cookie-name');
-  assert_equals(cookie, null);
-}, 'cookieStore.delete with name in both positional arguments and options');
-
-promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
 
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: `.${currentDomain}` }));
+      { name: 'cookie-name', value: 'cookie-value',
+        domain: `.${currentDomain}` }));
 }, 'cookieStore.delete domain starts with "."');
 
 promise_test(async testCase => {
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: 'example.com' }));
+      { name: 'cookie-name', value: 'cookie-value', domain: 'example.com' }));
 }, 'cookieStore.delete with domain that is not equal current host');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: currentDomain });
+      { name: 'cookie-name', value: 'cookie-value', domain: currentDomain });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
   });
 
   await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.delete with domain set to the current hostname');
@@ -78,91 +68,56 @@ promise_test(async testCase => {
 
   await promise_rejects_js(testCase, TypeError, cookieStore.delete(
       { name: 'cookie-name', domain: domainSuffix }));
 }, 'cookieStore.delete with domain set to a non-domain-matching suffix of ' +
    'the current hostname');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
-  const currentDomain = currentUrl.hostname;
-  await cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: currentDomain });
-  testCase.add_cleanup(async () => {
-    await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
-  });
-
-  await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
-  const cookie = await cookieStore.get('cookie-name');
-  assert_equals(cookie, null);
-}, 'cookieStore.delete with name in options and domain set to the current ' +
-   'hostname');
-
-promise_test(async testCase => {
-  const currentUrl = new URL(self.location.href);
-  const currentDomain = currentUrl.hostname;
-  const subDomain = `sub.${currentDomain}`;
-
-  await promise_rejects_js(testCase, TypeError, cookieStore.delete(
-      { name: 'cookie-name', domain: subDomain }));
-}, 'cookieStore.delete with name in options and domain set to a subdomain of ' +
-   'the current hostname');
-
-promise_test(async testCase => {
-  const currentUrl = new URL(self.location.href);
-  const currentDomain = currentUrl.hostname;
-  assert_not_equals(currentDomain[0] === '.',
-      'this test assumes that the current hostname does not start with .');
-  const domainSuffix = currentDomain.substr(1);
-
-  await promise_rejects_js(testCase, TypeError, cookieStore.delete(
-      { name: 'cookie-name', domain: domainSuffix }));
-}, 'cookieStore.delete with name in options and domain set to a ' +
-   'non-domain-matching suffix of the current hostname');
-
-promise_test(async testCase => {
-  const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory =
       currentPath.substr(0, currentPath.lastIndexOf('/') + 1);
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { path: currentDirectory });
+      { name: 'cookie-name', value: 'cookie-value', path: currentDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
 
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.delete with path set to the current directory');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory =
       currentPath.substr(0, currentPath.lastIndexOf('/') + 1);
   const subDirectory = currentDirectory + "subdir/";
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { path: currentDirectory });
+      { name: 'cookie-name', value: 'cookie-value', path: currentDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
 
   await cookieStore.delete({ name: 'cookie-name', path: subDirectory });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
 }, 'cookieStore.delete with path set to subdirectory of the current directory');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory = currentPath.substr(0, currentPath.lastIndexOf('/'));
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { path: currentDirectory + '/' });
+      { name: 'cookie-name',
+        value: 'cookie-value',
+        path: currentDirectory + '/' });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
 
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.delete with missing / at the end of path');
--- a/testing/web-platform/tests/cookie-store/cookieStore_set_arguments.tentative.https.any.js
+++ b/testing/web-platform/tests/cookie-store/cookieStore_set_arguments.tentative.https.any.js
@@ -24,107 +24,57 @@ promise_test(async testCase => {
     await cookieStore.delete('cookie-name');
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
 }, 'cookieStore.set with name and value in options');
 
 promise_test(async testCase => {
-  await cookieStore.delete('cookie-name');
-
-  cookieStore.set('cookie-name', 'cookie-value', { name: 'wrong-cookie-name' });
-  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');
-}, 'cookieStore.set with name in both positional arguments and options');
-
-promise_test(async testCase => {
   await promise_rejects_js(testCase, TypeError,
       cookieStore.set('', 'suspicious-value=resembles-name-and-value'));
 }, "cookieStore.set with empty name and an '=' in value");
 
 promise_test(async testCase => {
   await cookieStore.delete('cookie-name');
   cookieStore.set('cookie-name', 'suspicious-value=resembles-name-and-value');
   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, 'suspicious-value=resembles-name-and-value');
 }, "cookieStore.set with normal name and an '=' in value");
 
 promise_test(async testCase => {
-  await cookieStore.delete('cookie-name');
-
-  cookieStore.set('cookie-name', 'cookie-value',
-                  { value: 'wrong-cookie-value' });
-  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');
-}, 'cookieStore.set with value in both positional arguments and options');
-
-promise_test(async testCase => {
   const tenYears = 10 * 365 * 24 * 60 * 60 * 1000;
   const tenYearsFromNow = Date.now() + tenYears;
   await cookieStore.delete('cookie-name');
 
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { expires: tenYearsFromNow });
-  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');
-}, 'cookieStore.set with expires set to a future timestamp');
-
-promise_test(async testCase => {
-  const tenYears = 10 * 365 * 24 * 60 * 60 * 1000;
-  const tenYearsAgo = Date.now() - tenYears;
-  await cookieStore.delete('cookie-name');
-
-  await cookieStore.set(
-      'cookie-name', 'cookie-value', { expires: tenYearsAgo });
-  testCase.add_cleanup(async () => {
-    await cookieStore.delete('cookie-name');
-  });
-  const cookie = await cookieStore.get('cookie-name');
-  assert_equals(cookie, null);
-}, 'cookieStore.set with expires set to a past timestamp');
-
-promise_test(async testCase => {
-  const tenYears = 10 * 365 * 24 * 60 * 60 * 1000;
-  const tenYearsFromNow = Date.now() + tenYears;
-  await cookieStore.delete('cookie-name');
-
-  await cookieStore.set(
-      'cookie-name', 'cookie-value', { expires: new Date(tenYearsFromNow) });
+      { name: 'cookie-name',
+        value: 'cookie-value',
+        expires: new Date(tenYearsFromNow) });
   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');
 }, 'cookieStore.set with expires set to a future Date');
 
 promise_test(async testCase => {
   const tenYears = 10 * 365 * 24 * 60 * 60 * 1000;
   const tenYearsAgo = Date.now() - tenYears;
   await cookieStore.delete('cookie-name');
 
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { expires: new Date(tenYearsAgo) });
+      { name :'cookie-name',
+        value: 'cookie-value',
+        expires: new Date(tenYearsAgo) });
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.set with expires set to a past Date');
 
 promise_test(async testCase => {
@@ -135,96 +85,98 @@ promise_test(async testCase => {
   await cookieStore.set(
       { name: 'cookie-name', value: 'cookie-value', expires: tenYearsFromNow });
   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');
-}, 'cookieStore.set with name and value in options and expires in the future');
+}, 'cookieStore.set with expires set to a future timestamp');
 
 promise_test(async testCase => {
   const tenYears = 10 * 365 * 24 * 60 * 60 * 1000;
   const tenYearsAgo = Date.now() - tenYears;
   await cookieStore.delete('cookie-name');
 
   await cookieStore.set(
       { name: 'cookie-name', value: 'cookie-value', expires: tenYearsAgo });
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
-}, 'cookieStore.set with name and value in options and expires in the past');
+}, 'cookieStore.set with expires set to a past timestamp');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
 
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: `.${currentDomain}` }));
+      { name: 'cookie-name',
+        value: 'cookie-value',
+        domain: `.${currentDomain}` }));
 }, 'cookieStore.set domain starts with "."');
 
 promise_test(async testCase => {
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: 'example.com' }));
+      { name: 'cookie-name', value: 'cookie-value', domain: 'example.com' }));
 }, 'cookieStore.set with domain that is not equal current host');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
   await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
 
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: currentDomain });
+      { name: 'cookie-name', value: 'cookie-value', domain: currentDomain });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
 }, 'cookieStore.set with domain set to the current hostname');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
   const subDomain = `sub.${currentDomain}`;
 
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: subDomain }));
+      { name: 'cookie-name', value: 'cookie-value', domain: subDomain }));
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.set with domain set to a subdomain of the current hostname');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
   assert_not_equals(currentDomain[0] === '.',
       'this test assumes that the current hostname does not start with .');
   const domainSuffix = currentDomain.substr(1);
 
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { domain: domainSuffix }));
+      { name: 'cookie-name', value: 'cookie-value', domain: domainSuffix }));
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.set with domain set to a non-domain-matching suffix of the ' +
    'current hostname');
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
   await cookieStore.delete('cookie-name');
 
   await cookieStore.set('cookie-name', 'cookie-value1');
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
-  await cookieStore.set('cookie-name', 'cookie-value2',
-                        { domain: currentDomain });
+  await cookieStore.set(
+      { name: 'cookie-name', value: 'cookie-value2', domain: currentDomain });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', domain: currentDomain });
   });
 
   const cookies = await cookieStore.getAll('cookie-name');
   assert_equals(cookies.length, 2);
 
   assert_equals(cookies[0].name, 'cookie-name');
@@ -238,17 +190,17 @@ promise_test(async testCase => {
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory =
       currentPath.substr(0, currentPath.lastIndexOf('/') + 1);
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
 
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { path: currentDirectory });
+      { name: 'cookie-name', value: 'cookie-value', path: currentDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
 }, 'cookieStore.set with path set to the current directory');
 
@@ -257,32 +209,33 @@ promise_test(async testCase => {
   const currentPath = currentUrl.pathname;
   const currentDirectory =
       currentPath.substr(0, currentPath.lastIndexOf('/') + 1);
   const subDirectory = currentDirectory + "subdir/";
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   await cookieStore.delete({ name: 'cookie-name', path: subDirectory });
 
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { path: subDirectory });
+      { name: 'cookie-name', value: 'cookie-value', path: subDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: subDirectory });
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie, null);
 }, 'cookieStore.set with path set to a subdirectory of the current directory');
 
 promise_test(async testCase => {
   await cookieStore.delete('cookie-name');
 
   await cookieStore.set('cookie-name', 'cookie-old-value');
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
-  await cookieStore.set('cookie-name', 'cookie-new-value', { path: '/' });
+  await cookieStore.set(
+      { name: 'cookie-name', value: 'cookie-new-value', path: '/' });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name',  path: '/' });
   });
 
   const cookies = await cookieStore.getAll('cookie-name');
   assert_equals(cookies.length, 1);
   assert_equals(cookies[0].name, 'cookie-name');
   assert_equals(cookies[0].value, 'cookie-new-value');
@@ -290,17 +243,17 @@ promise_test(async testCase => {
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory = currentPath.substr(0, currentPath.lastIndexOf('/'));
   await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
 
   await cookieStore.set(
-      'cookie-name', 'cookie-value', { path: currentDirectory });
+      { name: 'cookie-name', value: 'cookie-value', path: currentDirectory });
   testCase.add_cleanup(async () => {
     await cookieStore.delete({ name: 'cookie-name', path: currentDirectory });
   });
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.name, 'cookie-name');
   assert_equals(cookie.value, 'cookie-value');
   assert_equals(cookie.path, currentDirectory + '/');
 }, 'cookieStore.set adds / to path that does not end with /');
@@ -308,17 +261,17 @@ promise_test(async testCase => {
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentPath = currentUrl.pathname;
   const currentDirectory =
       currentPath.substr(0, currentPath.lastIndexOf('/') + 1);
   const invalidPath = currentDirectory.substr(1);
 
   await promise_rejects_js(testCase, TypeError, cookieStore.set(
-      'cookie-name', 'cookie-value', { path: invalidPath }));
+      { name: 'cookie-name', value: 'cookie-value', path: invalidPath }));
 }, 'cookieStore.set with path that does not start with /');
 
 promise_test(async testCase => {
   await cookieStore.set('cookie-name', 'old-cookie-value');
   testCase.add_cleanup(async () => {
     await cookieStore.delete('cookie-name');
   });
 
--- a/testing/web-platform/tests/cookie-store/cookieStore_special_names.tentative.https.any.js
+++ b/testing/web-platform/tests/cookie-store/cookieStore_special_names.tentative.https.any.js
@@ -14,42 +14,40 @@
     try { await cookieStore.delete(`${prefix}cookie-name`); } catch (e) {}
   }, `cookieStore.set with ${prefix} name on secure origin`);
 
   promise_test(async testCase => {
     // This test is for symmetry with the non-secure case. In non-secure
     // contexts, the set() should fail even if the expiration date makes
     // the operation a no-op.
     await cookieStore.set(
-      `${prefix}cookie-name`, `secure-cookie-value`, {
-        expires: Date.now() - (24 * 60 * 60 * 1000)
-      });
+        { name: `${prefix}cookie-name`, value: `secure-cookie-value`,
+          expires: Date.now() - (24 * 60 * 60 * 1000)});
     assert_equals(await cookieStore.get(`${prefix}cookie-name`), null);
     try { await cookieStore.delete(`${prefix}cookie-name`); } catch (e) {}
   }, `cookieStore.set of expired ${prefix} cookie name on secure origin`);
 
   promise_test(async testCase => {
     assert_equals(
       await cookieStore.delete(`${prefix}cookie-name`), undefined,
       `Deleting ${prefix} cookies should not fail in secure context`);
   }, `cookieStore.delete with ${prefix} name on secure origin`);
 });
 
 promise_test(async testCase => {
   const currentUrl = new URL(self.location.href);
   const currentDomain = currentUrl.hostname;
   await promise_rejects_js(testCase, TypeError,
-      cookieStore.set('__Host-cookie-name', 'cookie-value', {
-        domain: currentDomain
-      }));
+      cookieStore.set({ name: '__Host-cookie-name', value: 'cookie-value',
+                        domain: currentDomain }));
 }, 'cookieStore.set with __Host- prefix and a domain option');
 
 promise_test(async testCase => {
-  await cookieStore.set('__Host-cookie-name', 'cookie-value', { path: "/" });
+  await cookieStore.set({ name: '__Host-cookie-name', value: 'cookie-value',
+                          path: "/" });
 
   assert_equals(
       (await cookieStore.get(`__Host-cookie-name`)).value, "cookie-value");
 
   await promise_rejects_js(testCase, TypeError,
-      cookieStore.set('__Host-cookie-name', 'cookie-value', {
-        path: "/path"
-      }));
+      cookieStore.set( { name: '__Host-cookie-name', value: 'cookie-value',
+                         path: "/path" }));
 }, 'cookieStore.set with __Host- prefix a path option');