forked from web-platform-tests/wpt
-
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.
Migrate iframe-based Client Hint WPTs to import client hints lists
Introduce two new files into "client-hints/resources" to centralize the dependencies of client hint token lists across javascript and python tests: - export.js - clienthintslist.py Eventually all Client Hints tests will be migrated to using these lists to pare down the number of tests touched when creating new hints; this CL pertains to the tests that depend on "client-hints/resources/expect-client-hints-headers-iframe.py" One of change is the query strings fed to "expect-client-hints-headers-iframe.py" is now generated in "client-hints/resources/feature-policy-navigation.js". Another change is fixing tests related to `sec-ch-ua-platform` since we added platform to client hints returned by default in getHighEntropyValues in https://crrev.com/c/3389295. Bug: 1304740 Change-Id: Id41ddbe1ee29c10f7b7c96a283f7eca2abec438b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3549556 Reviewed-by: Ali Beyad <[email protected]> Commit-Queue: Victor Tan <[email protected]> Cr-Commit-Position: refs/heads/main@{#993338}
- Loading branch information
1 parent
b941021
commit 0f27025
Showing
19 changed files
with
154 additions
and
43 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
client-hints/accept-ch/feature-policy-navigation/__dir__.headers
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 +1 @@ | ||
Accept-CH: Sec-CH-Device-Memory, Device-Memory, Sec-CH-DPR, DPR, Sec-CH-Viewport-Width, Viewport-Width | ||
Accept-CH: device-memory, dpr, width, viewport-width, rtt, downlink, ect, sec-ch-ua, sec-ch-ua-arch, sec-ch-ua-platform, sec-ch-ua-model, sec-ch-ua-mobile, sec-ch-ua-full-version, sec-ch-ua-platform-version, sec-ch-prefers-color-scheme, sec-ch-ua-bitness, sec-ch-viewport-height, sec-ch-device-memory, sec-ch-dpr, sec-ch-width, sec-ch-viewport-width, sec-ch-ua-full-version-list, sec-ch-ua-wow64 |
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
2 changes: 1 addition & 1 deletion
2
client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html.headers
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 +1 @@ | ||
Feature-Policy: ch-device-memory *; ch-dpr 'none'; ch-viewport-width 'self'; ch-ua 'self'; ch-ua-mobile 'none'; ch-prefers-color-scheme 'none' | ||
Feature-Policy: ch-device-memory *; ch-dpr 'none'; ch-viewport-width 'self'; ch-ua 'self'; ch-ua-mobile 'none' |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def client_hints_list(): | ||
return [b"device-memory", | ||
b"dpr", | ||
# b"width", (Only available for images) | ||
b"viewport-width", | ||
b"rtt", | ||
b"downlink", | ||
b"ect", | ||
b"sec-ch-ua", | ||
b"sec-ch-ua-arch", | ||
b"sec-ch-ua-platform", | ||
b"sec-ch-ua-model", | ||
b"sec-ch-ua-mobile", | ||
b"sec-ch-ua-full-version", | ||
b"sec-ch-ua-platform-version", | ||
b"sec-ch-prefers-color-scheme", | ||
b"sec-ch-ua-bitness", | ||
b"sec-ch-viewport-height", | ||
b"sec-ch-device-memory", | ||
b"sec-ch-dpr", | ||
# b"sec-ch-width", (Only available for images) | ||
b"sec-ch-viewport-width", | ||
b"sec-ch-ua-full-version-list", | ||
b"sec-ch-ua-wow64", | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const client_hints_list = [ | ||
"device-memory", | ||
"dpr", | ||
// "width", (only available for images) | ||
"viewport-width", | ||
"rtt", | ||
"downlink", | ||
"ect", | ||
"sec-ch-ua", | ||
"sec-ch-ua-arch", | ||
"sec-ch-ua-platform", | ||
"sec-ch-ua-model", | ||
"sec-ch-ua-mobile", | ||
"sec-ch-ua-full-version", | ||
"sec-ch-ua-platform-version", | ||
"sec-ch-prefers-color-scheme", | ||
"sec-ch-ua-bitness", | ||
"sec-ch-viewport-height", | ||
"sec-ch-device-memory", | ||
"sec-ch-dpr", | ||
// "sec-ch-width", (Only available for images) | ||
"sec-ch-viewport-width", | ||
"sec-ch-ua-full-version-list", | ||
"sec-ch-ua-wow64", | ||
]; | ||
|
||
const default_on_client_hints = [ | ||
"sec-ch-ua", | ||
"sec-ch-ua-mobile", | ||
"sec-ch-ua-platform", | ||
]; | ||
|
||
const iframe_src = | ||
"/client-hints/resources/expect-client-hints-headers-iframe.py?"; | ||
|
||
const expect_iframe_no_hints = iframe_src + | ||
client_hints_list.map((e) => { | ||
if(default_on_client_hints.includes(e)) { | ||
return e+"=true"; | ||
} else { | ||
return e+"=false"; | ||
} | ||
}).join("&"); | ||
|
||
const expect_iframe_hints = iframe_src + | ||
client_hints_list.map(e => e+"=true").join("&"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Accept-CH: sec-ch-device-memory, device-memory, sec-ch-dpr, dpr, sec-ch-viewport-width, viewport-width, rtt, downlink, ect | ||
Accept-CH: device-memory, dpr, width, viewport-width, rtt, downlink, ect, sec-ch-ua, sec-ch-ua-arch, sec-ch-ua-platform, sec-ch-ua-model, sec-ch-ua-mobile, sec-ch-ua-full-version, sec-ch-ua-platform-version, sec-ch-prefers-color-scheme, sec-ch-ua-bitness, sec-ch-viewport-height, sec-ch-device-memory, sec-ch-dpr, sec-ch-width, sec-ch-viewport-width, sec-ch-ua-full-version-list, sec-ch-ua-wow64 |
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
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
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
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