Clean up partitioned cookies WPT

This CL removes some unnecessary promise_test calls,
reducing the number of test expectations.

It also replaces single quote strings with double quotes,
since the latter seems to be the style of other WPTs. ES6
template strings were left unchanged.

Bug: None
Change-Id: I3b1c3c0b8df13c134bbb774ae7150d3d25a75b05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3267632
Reviewed-by: Mike Taylor <miketaylr@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/main@{#939530}
diff --git a/cookies/partitioned-cookies/partitioned-cookies.tentative.https.html b/cookies/partitioned-cookies/partitioned-cookies.tentative.https.html
index 1512d3b..a2d92c5 100644
--- a/cookies/partitioned-cookies/partitioned-cookies.tentative.https.html
+++ b/cookies/partitioned-cookies/partitioned-cookies.tentative.https.html
@@ -12,25 +12,25 @@
 <body>
 <script>
 
-promise_test(async t => {
+document.body.onload = async () => {
   // First, the test sets a SameSite=None;Partitioned; cookie.
-  const attributes = 'Secure;Path=/;SameSite=None;Partitioned';
-  const httpCookieName = '__Host-pchttp';
+  const attributes = "Secure;Path=/;SameSite=None;Partitioned";
+  const httpCookieName = "__Host-pchttp";
   await credFetch(
       `${self.origin}/cookies/resources/set.py?${httpCookieName}=foobar;${
           attributes}`);
 
   // Set another partitioned cookie using document.cookie.
-  const domCookieName = '__Host-pcdom';
+  const domCookieName = "__Host-pcdom";
   document.cookie = `${domCookieName}=foobar;${attributes}`;
 
   // Set another partitioned cookie using the CookieStore API.
-  const cookieStoreCookieName = '__Host-pccookistore';
+  const cookieStoreCookieName = "__Host-pccookistore";
   await cookieStore.set({
     name: cookieStoreCookieName,
-    value: 'foobar',
-    path: '/',
-    sameSite: 'none',
+    value: "foobar",
+    path: "/",
+    sameSite: "none",
     partitioned: true,
   });
 
@@ -62,7 +62,7 @@
       get_host_info().HTTPS_NOTSAMESITE_ORIGIN + self.location.pathname);
   const popup = window.open(crossSiteUrl);
   fetch_tests_from_window(popup);
-}, 'Test partitioned cookies');
+};
 
 </script>
 </body>
diff --git a/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-embed.html b/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-embed.html
index 4c6d0a8..f48268d 100644
--- a/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-embed.html
+++ b/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-embed.html
@@ -10,7 +10,7 @@
 <body>
 <script>
 
-const cookieNames = ['__Host-pchttp', '__Host-pcdom', '__Host-pccookiestore'];
+const cookieNames = ["__Host-pchttp", "__Host-pcdom", "__Host-pccookiestore"];
 
 testDomPartitionedCookies({
   cookieNames,
diff --git a/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-window.html b/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-window.html
index 27e1405..e341993 100644
--- a/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-window.html
+++ b/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-window.html
@@ -14,30 +14,30 @@
 
 // Test that parent window passed its origin in the URL parameters correctly.
 test(() => {
-  assert_true(window.location.search.startsWith('?origin='));
+  assert_true(window.location.search.startsWith("?origin="));
   origin = decodeURIComponent(window.location.search.slice(
-      window.location.search.indexOf('?origin=') + 8));
-}, 'Cross-site window opened correctly');
+      window.location.search.indexOf("?origin=") + 8));
+}, "Cross-site window opened correctly");
 
 // Test that the request to the parent window's origin does not contain the
 // partitioned cookie.
 testHttpPartitionedCookies({
   origin,
-  cookieNames: ['__Host-pchttp', '__Host-pcdom'],
+  cookieNames: ["__Host-pchttp", "__Host-pcdom"],
   expectsCookie: false,
 });
 
-promise_test(async t => {
-  // Create a cross-site <iframe> which embeds the cookies' origin into this
-  // page.
-  const iframe = document.createElement('iframe');
-  const url = new URL(
-      '/cookies/partitioned-cookies/resources/partitioned-cookies-cross-site-embed.html', origin);
-  iframe.src = String(url);
-  document.body.appendChild(iframe);
+// Create a cross-site <iframe> which embeds the cookies' origin into this
+// page.
+const iframe = document.createElement("iframe");
+const url = new URL(
+    "/cookies/partitioned-cookies/resources/" +
+        "partitioned-cookies-cross-site-embed.html",
+    origin);
+iframe.src = String(url);
+document.body.appendChild(iframe);
 
-  fetch_tests_from_window(iframe.contentWindow);
-}, 'Opening embedded cookie site frame');
+fetch_tests_from_window(iframe.contentWindow);
 
 </script>
 </body>
diff --git a/cookies/partitioned-cookies/resources/test-helpers.js b/cookies/partitioned-cookies/resources/test-helpers.js
index 4864e74..6ba7f89 100644
--- a/cookies/partitioned-cookies/resources/test-helpers.js
+++ b/cookies/partitioned-cookies/resources/test-helpers.js
@@ -12,25 +12,25 @@
           cookies.hasOwnProperty(cookieName), expectsCookie,
           getPartitionedCookieAssertDesc(expectsCookie, cookieName));
     }
-  }, getPartitionedCookieTestName(expectsCookie, 'HTTP'));
+  }, getPartitionedCookieTestName(expectsCookie, "HTTP"));
 }
 
 function getPartitionedCookieTestName(expectsCookie, cookieType) {
   if (expectsCookie) {
-    return 'Partitioned cookies accessible on the top-level site they are ' +
+    return "Partitioned cookies accessible on the top-level site they are " +
         `created in via ${cookieType}`;
   }
-  return 'Partitioned cookies are not accessible on a different top-level ' +
+  return "Partitioned cookies are not accessible on a different top-level " +
       `site via ${cookieType}`;
 }
 
 function getPartitionedCookieAssertDesc(expectsCookie, cookieName) {
   if (expectsCookie) {
     return `Expected ${cookieName} to be available on the top-level site it ` +
-        'was created in';
+        "was created in";
   }
   return `Expected ${cookieName} to not be available on a different ` +
-      'top-level site';
+      "top-level site";
 }
 
 function testDomPartitionedCookies({cookieNames, expectsCookie}) {
@@ -40,7 +40,7 @@
           document.cookie.includes(cookieName), expectsCookie,
           getPartitionedCookieAssertDesc(expectsCookie, cookieName));
     }
-  }, getPartitionedCookieTestName(expectsCookie, 'DOM'));
+  }, getPartitionedCookieTestName(expectsCookie, "DOM"));
 }
 
 function testCookieStorePartitionedCookies({cookieNames, expectsCookie}) {
@@ -51,5 +51,5 @@
           !!cookies.find(c => c.name === cookieName), expectsCookie,
           getPartitionedCookieAssertDesc(expectsCookie, cookieName));
     }
-  }, getPartitionedCookieTestName(expectsCookie, 'CookieStore'));
+  }, getPartitionedCookieTestName(expectsCookie, "CookieStore"));
 }