Automatic update from web-platform-tests Add WPT for no challenge in the Secure-Session-Registration header This CL adds a WPT validating this works. Bug: 469801418 Change-Id: Iab681dc69b039aa948ad45b307c60b8a6a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7282522 Reviewed-by: Natalie Chanfreau <thefrog@chromium.org> Commit-Queue: Daniel Rubery <drubery@chromium.org> Cr-Commit-Position: refs/heads/main@{#1565062} -- wpt-commits: 52a614a57006f9f4b932fa2f4b5a2ca67af1746b wpt-pr: 56947
34 lines
1.4 KiB
HTML
34 lines
1.4 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 never send back a challenge.
|
|
await configureServer({
|
|
allowsChallenges: 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 expiring the cookie does refresh because registration succeeded.
|
|
expireCookie(expectedCookieAndAttributes);
|
|
assert_false(documentHasCookie(expectedCookieAndValue));
|
|
const authResponseAfterExpiry = await fetch('verify_authenticated.py');
|
|
assert_equals(authResponseAfterExpiry.status, 200);
|
|
assert_true(documentHasCookie(expectedCookieAndValue));
|
|
}, "Registration header doesn't need a challenge");
|
|
</script>
|