forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Sec-CH-UA tests: fix existing tests, and test brand size.
As of WICG/ua-client-hints#179, https://wicg.github.io/ua-client-hints/#user-agent-brand now requires that a brand in a brand list not be longer than 32 bytes. This CL adds a new test for the userAgentData.brands interface, and modifies the existing sec-ch-ua HTTP tests. Also, the existing sec-ch-ua HTTP tests were updated to more closely reflect the current state of UA-CH ("UA" is not a valid token, and "Accept-CH-Lifetime" is not shipping). Bug: 1263180 Change-Id: Ifa7cbf18d67271e2dd1dc1d485f432d4ca9327fa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3243544 Commit-Queue: Aaron Tagliaboschi <[email protected]> Auto-Submit: Mike Taylor <[email protected]> Reviewed-by: Aaron Tagliaboschi <[email protected]> Cr-Commit-Position: refs/heads/main@{#935138}
- Loading branch information
Showing
4 changed files
with
41 additions
and
26 deletions.
There are no files selected for viewing
4 changes: 1 addition & 3 deletions
4
third_party/blink/web_tests/external/wpt/client-hints/resources/sec-ch-ua.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
third_party/blink/web_tests/external/wpt/ua-client-hints/useragentdata.https.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// META: title=tests for navigator.userAgentData | ||
|
||
test(t => { | ||
const brands = navigator.userAgentData.brands; | ||
assert_true(brands.every(brand => brand.brand.length < 32), | ||
"No brand should be longer than 32 characters."); | ||
}); |
5 changes: 3 additions & 2 deletions
5
...ble-user-agent-client-hint-feature/external/wpt/client-hints/sec-ch-ua.https-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
This is a testharness.js-based test. | ||
FAIL Open HTTPS window prior to opt-in: `Sec-CH-UA` header with minor version. assert_not_equals: The `Sec-CH-UA` header is delivered. got disallowed value "" | ||
FAIL Open HTTPS window post-opt-in: `Sec-CH-UA` header with minor version. assert_not_equals: The `Sec-CH-UA` header is delivered. got disallowed value "" | ||
FAIL Open HTTPS window: `Sec-CH-UA` header returned by default. assert_not_equals: `Sec-CH-UA` is sent. got disallowed value "" | ||
FAIL Open HTTPS window: `Sec-CH-UA` header is consistent across versions. assert_not_equals: The `Sec-CH-UA` header is delivered. got disallowed value "" | ||
FAIL Open HTTPS window: No brand in `Sec-CH-UA` header is > than 32 chars. assert_true: A well-formed Sec-CH-UA header must have version (v=) params expected true got false | ||
Harness: the test ran to completion. | ||
|