Bug 1705346 [wpt PR 28503] - [Credentialless]: Make fetch.tentative.https.html more reliable., a=testonly
authorarthursonzogni <arthursonzogni@chromium.org>
Fri, 23 Apr 2021 10:19:34 +0000
changeset 577259 cbd9801fb01a33f3b52b426bfa8133c801175d2e
parent 577258 48966ae59398b6cbf4c909f6da363f30b0d21d30
child 577260 75d42ecd99073485ad5fb28800208c7b2bae6731
push id141827
push userwptsync@mozilla.com
push dateSat, 24 Apr 2021 02:11:12 +0000
treeherderautoland@3a7d9d49c316 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1705346, 28503, 1175099, 1198255, 2825904, 872837
milestone90.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 1705346 [wpt PR 28503] - [Credentialless]: Make fetch.tentative.https.html more reliable., a=testonly Automatic update from web-platform-tests [Credentialless]: Make fetch.tentative.https.html more reliable. Previously, the test was assuming the window can be closed immediately after sending the last fetch request. This is not true, because closing the window might interrupt previously scheduled fetch requests and fails the test. We need to wait for the test completion before assuming we can close the windows. I did a local test with 100 wpt run: - without fix: 16/100 failures. - with fix: 0/100 failures. Bug: 1175099,1198255 Change-Id: I70a56ba4821d46d12f45c38d8850c876c5957649 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2825904 Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Antonio Sartori <antoniosartori@chromium.org> Commit-Queue: Antonio Sartori <antoniosartori@chromium.org> Cr-Commit-Position: refs/heads/master@{#872837} -- wpt-commits: 6d4fca70173368916259efd9d0d713a9c232bedf wpt-pr: 28503
testing/web-platform/tests/html/cross-origin-embedder-policy/credentialless/cors-or-credentialless/fetch.tentative.https.html
--- a/testing/web-platform/tests/html/cross-origin-embedder-policy/credentialless/cors-or-credentialless/fetch.tentative.https.html
+++ b/testing/web-platform/tests/html/cross-origin-embedder-policy/credentialless/cors-or-credentialless/fetch.tentative.https.html
@@ -18,22 +18,24 @@ promise_test(async test => {
     setCookie(cross_origin, cookie_key, cookie_cross_origin),
   ]);
 
   // One window with COEP:none. (control)
   const w_control_token = token();
   const w_control_url = same_origin + executor_path +
     coep_none + `&uuid=${w_control_token}`
   const w_control = window.open(w_control_url);
+  add_completion_callback(() => w_control.close());
 
   // One window with COEP:credentialless. (experiment)
   const w_credentialless_token = token();
   const w_credentialless_url = same_origin + executor_path +
     coep_credentialless + `&uuid=${w_credentialless_token}`;
   const w_credentialless = window.open(w_credentialless_url);
+  add_completion_callback(() => w_credentialless.close());
 
   const fetchTest = function(
     description, origin, mode, credentials,
     expected_cookies_control,
     expected_cookies_credentialless)
   {
     promise_test_parallel(async test => {
       const token_1 = token();
@@ -118,15 +120,11 @@ promise_test(async test => {
     cross_origin, 'no-cors', 'include',
     cookie_cross_origin,
     undefined);
 
   fetchTest("cross-origin + no-cors + credentials:same-origin",
     cross_origin, 'no-cors', 'same-origin',
     undefined,
     undefined);
-
-  // Cleanup. Safe, because scheduled after every requests from `fetchTest`.
-  send(w_control_token, `close()`);
-  send(w_credentialless_token, `close()`);
 }, "");
 
 </script>