Files
sousa-gecko/testing/web-platform/tests/device-bound-session-credentials/refresh-does-not-send-challenge.https.html
T
Daniel Rubery 5477add355 Bug 1990044 [wpt PR 54988] - Rename DBSC headers, a=testonly
Automatic update from web-platform-tests
Rename DBSC headers

Due to spec feedback, we want to replace "Sec-Session-" with
"Secure-Session-". This CL adds helper functions in a number of files
rather than create a new header utils file since we'll want to touch
every file to inline all the helper functions once we eventually
remove OriginTrialFeedback.

Fixed: 416191041
Change-Id: I846f100802db2b048e7ed782e0a4f6114c157be7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6970309
Reviewed-by: thefrog <thefrog@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1518765}

--

wpt-commits: 7dd6b8127eadd3f8efe695c60950e67aff92c2d8
wpt-pr: 54988
2025-09-24 11:07:05 +00:00

36 lines
1.6 KiB
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="helper.js" type="module"></script>
<script type="module">
import { expireCookie, waitForCookie, addCookieAndSessionCleanup, configureServer, setupShardedServerState, documentHasCookie } from "./helper.js";
promise_test(async t => {
await setupShardedServerState();
const expectedCookieAndValue = "auth_cookie=abcdef0123";
const expectedCookieAndAttributes = `${expectedCookieAndValue};Domain=${location.hostname};Path=/device-bound-session-credentials`;
addCookieAndSessionCleanup(t);
// Configure server to avoid sending back a challenge during refresh.
await configureServer({ refreshSendsChallenge: false });
// Prompt starting a session, and wait until registration completes.
const loginResponse = await fetch('login.py');
assert_equals(loginResponse.status, 200);
await waitForCookie(expectedCookieAndValue, /*expectCookie=*/true);
// Confirm that a request has the cookie set.
const authResponse = await fetch('verify_authenticated.py');
assert_equals(authResponse.status, 200);
// Trigger refresh and confirm that the cookie gets set again.
expireCookie(expectedCookieAndAttributes);
assert_false(documentHasCookie(expectedCookieAndValue));
const authResponseAfterExpiry = await fetch('verify_authenticated.py');
assert_equals(authResponseAfterExpiry.status, 200);
assert_true(documentHasCookie(expectedCookieAndValue));
}, "Refresh does not send back Secure-Session-Challenge");
</script>