Bug 1888257 [wpt PR 45387] - [FedCM] Explicitly clear state when needed, a=testonly

Automatic update from web-platform-tests
[FedCM] Explicitly clear state when needed

The test assumes a clean state, but that's not the case on wpt.fyi:
https://wpt.fyi/results/credential-management/fedcm-auto-selected-flag.https.html?label=experimental&label=master&aligned

Try fixing that using an explicit delete_all_cookies call, which should
also clear FedCM state (AFAIK).

In addition, call set_fedcm_delay_enabled(false).
This is already the default for content_shell, but makes running tests
against chrome faster, such as when using run_wpt_tests or `wpt run`.

Bug: 331237776
Change-Id: Ic81c407c66537e17b25eff6c7eab0f74c763f790
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5403249
Commit-Queue: Yi Gu <yigu@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1279826}

--

wpt-commits: 43ea40c0e9a3d26547ca378bbc71ed0420684b5e
wpt-pr: 45387
This commit is contained in:
Christian Biesinger 2024-04-08 17:01:41 +00:00 коммит произвёл moz-wptsync-bot
Родитель 22ec186a63
Коммит 996a75ea18
3 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -3,6 +3,8 @@
<link rel="help" href="https://fedidcg.github.io/FedCM">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<body>

Просмотреть файл

@ -2,6 +2,8 @@
<link rel="help" href="https://wicg.github.io/FedCM">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<div id=log>
<script type="module">

Просмотреть файл

@ -104,6 +104,15 @@ credential-management/support/fedcm/${manifest_filename}`;
// Test wrapper which does FedCM-specific setup.
export function fedcm_test(test_func, test_name) {
promise_test(async t => {
// Ensure we start from a clean slate.
await test_driver.delete_all_cookies();
// Turn off delays that are not useful in tests.
try {
await test_driver.set_fedcm_delay_enabled(false);
} catch (e) {
// Failure is not critical; it just might slow down tests.
}
await set_fedcm_cookie();
await set_alt_fedcm_cookie();
await test_func(t);