Bug 1508530 [wpt PR 14136] - Async Cookies: Fix cross-frame test cleanup., a=testonly
authorJarryd <jarrydg@chromium.org>
Thu, 22 Nov 2018 10:34:26 +0000
changeset 447913 5c99519fee0949fb0d26fd9d6b036143e672d0ac
parent 447912 39b43922cd8e6cf159f4d09f869508eab41fe614
child 447914 c46b59962f2e00e7f1d5e3957c4186e9b056888c
push id35093
push userdluca@mozilla.com
push dateSat, 24 Nov 2018 09:48:01 +0000
treeherdermozilla-central@76c1898f6b02 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1508530, 14136, 729800, 1226199, 609547
milestone65.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 1508530 [wpt PR 14136] - Async Cookies: Fix cross-frame test cleanup., a=testonly Automatic update from web-platform-testsAsync Cookies: Fix cross-frame test cleanup. Fixed the cleanup functions to return a Promise and use explicit domains to make sure the cookies are cleaned up afterwards. Bug: 729800 Change-Id: Iba3ca150431e21be26536658d3b5d77648edfe83 Reviewed-on: https://chromium-review.googlesource.com/c/1226199 Commit-Queue: Jarryd Goodman <jarrydg@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Reviewed-by: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#609547} -- wpt-commits: ef959fb1c35bcc93f5165caad50498d756e1de4e wpt-pr: 14136
testing/web-platform/tests/cookie-store/cookieStore_get_set_across_frames.tentative.https.html
testing/web-platform/tests/cookie-store/cookieStore_get_set_across_origins.tentative.sub.https.html
--- a/testing/web-platform/tests/cookie-store/cookieStore_get_set_across_frames.tentative.https.html
+++ b/testing/web-platform/tests/cookie-store/cookieStore_get_set_across_frames.tentative.https.html
@@ -10,31 +10,33 @@
 <script>
 'use strict';
 
 promise_test(async t => {
   const iframe = document.getElementById('iframe');
   const frameCookieStore = iframe.contentWindow.cookieStore;
 
   const oldCookie = await frameCookieStore.get('cookie-name');
-  assert_equals(oldCookie, null);
+  assert_equals(oldCookie, null,
+      'Precondition not met: cookie store should be empty');
 
   await cookieStore.set('cookie-name', 'cookie-value');
   t.add_cleanup(() => cookieStore.delete('cookie-name'));
 
   const frameCookie = await frameCookieStore.get('cookie-name');
   assert_equals(frameCookie.value, 'cookie-value');
 }, 'cookieStore.get() sees cookieStore.set() in frame');
 
 promise_test(async t => {
   const iframe = document.getElementById('iframe');
   const frameCookieStore = iframe.contentWindow.cookieStore;
 
   const oldCookie = await frameCookieStore.get('cookie-name');
-  assert_equals(oldCookie, null);
+  assert_equals(oldCookie, null,
+      'Precondition not met: cookie store should be empty');
 
   await frameCookieStore.set('cookie-name', 'cookie-value');
   t.add_cleanup(() => frameCookieStore.delete('cookie-name'));
 
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.value, 'cookie-value');
 }, 'cookieStore.get() in frame sees cookieStore.set()')
 </script>
--- a/testing/web-platform/tests/cookie-store/cookieStore_get_set_across_origins.tentative.sub.https.html
+++ b/testing/web-platform/tests/cookie-store/cookieStore_get_set_across_origins.tentative.sub.https.html
@@ -19,44 +19,49 @@ promise_test(async t => {
   const iframe = await createIframe(kCorsUrl, t);
   assert_true(iframe != null);
 
   iframe.contentWindow.postMessage({
     opname: 'set-cookie',
     name: 'cookie-name',
     value: 'cookie-value',
   }, kCorsBase);
-  t.add_cleanup(() => {
-    cookieStore.delete('cookie-name');
-  });
-
+  t.add_cleanup(() => cookieStore.delete({
+    name: 'cookie-name',
+    domain: '{{host}}',
+  }));
   await waitForMessage();
 
   const cookies = await cookieStore.getAll();
   assert_equals(cookies.length, 1);
   assert_equals(cookies[0].name, 'cookie-name');
   assert_equals(cookies[0].value, 'cookie-value');
 }, 'cookieStore.get() sees cookieStore.set() in cross-origin frame');
 
 promise_test(async t => {
   const iframe = await createIframe(kCorsUrl, t);
   assert_true(iframe != null);
 
-  await cookieStore.set('cookie-name', 'cookie-value');
+  await cookieStore.set({
+    name: 'cookie-name',
+    value: 'cookie-value',
+    domain: '{{host}}',
+  });
 
   const cookie = await cookieStore.get('cookie-name');
   assert_equals(cookie.value, 'cookie-value');
 
   iframe.contentWindow.postMessage({
     opname: 'get-cookie',
     name: 'cookie-name',
   }, kCorsBase);
-  t.add_cleanup(() => {
-    cookieStore.delete('cookie-name');
-  })
+  t.add_cleanup(() => cookieStore.delete({
+    name: 'cookie-name',
+    domain: '{{host}}',
+  }));
 
   const message = await waitForMessage();
 
   const { frameCookie } = message;
   assert_not_equals(frameCookie, null);
   assert_equals(frameCookie.name, 'cookie-name');
   assert_equals(frameCookie.value, 'cookie-value');
 }, 'cookieStore.get() in cross-origin frame sees cookieStore.set()');