Skip to content

Commit

Permalink
[Credentialless]: Make fetch.tentative.https.html more reliable.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
ArthurSonzogni authored and chromium-wpt-export-bot committed Apr 15, 2021
1 parent 7abd3a7 commit 6d4fca7
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
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,
Expand Down Expand Up @@ -123,10 +125,6 @@
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>

0 comments on commit 6d4fca7

Please sign in to comment.