Files
firefox/testing/web-platform/tests/client-hints/meta-equiv-delegate-ch-malformed-header.https.html
Ari Chivukula 5528b79ecd Bug 1774104 [wpt PR 34416] - [Delegate-CH] (1) Add support to chromium, a=testonly
Automatic update from web-platform-tests
[Delegate-CH] (1) Add support to chromium

This adds support for the delegate-ch meta tag. It works like the
accept-ch meta tag, except it uses the same syntax as the allow iframe
attribute. https://groups.google.com/a/chromium.org/g/blink-dev/c/cGOjmfOamsE/

This CL is part of a series:
(1) Add support to chromium
(2) Add tests to devtools

Bug: 1334152
Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3702967
Reviewed-by: Yue Ru Sun <[email protected]>
Commit-Queue: Ari Chivukula <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Commit-Queue: Maks Orlovich <[email protected]>
Auto-Submit: Ari Chivukula <[email protected]>
Reviewed-by: Victor Tan <[email protected]>
Reviewed-by: Yoav Weiss <[email protected]>
Reviewed-by: Ian Clelland <[email protected]>
Reviewed-by: Maks Orlovich <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1025731}

--

wpt-commits: f830fcfb39d68d271b6b5a558784de69bb8fdfce
wpt-pr: 34416
2022-07-21 00:25:20 +00:00

33 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html>
<meta http-equiv="Delegate-CH" content="Sec-CH-DPR= Sec-CH-Width">
<title>Delegate-CH malformed meta-equiv test</title>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(t => {
return fetch("/client-hints/resources/echo-client-hints-received.py").then(r => {
assert_equals(r.status, 200)
// Verify that the browser does not include client hints in the headers
// since Delegate-CH value in meta-equiv is malformed (includes whitespace
// between attributes instead of comma).
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
assert_false(r.headers.has("device-memory-deprecated-received"), "device-memory-deprecated-received");
assert_false(r.headers.has("dpr-received"), "dpr-received");
assert_false(r.headers.has("dpr-deprecated-received"), "dpr-deprecated-received");
assert_false(r.headers.has("viewport-width-received"), "viewport-width-received");
assert_false(r.headers.has("viewport-width-deprecated-received"), "viewport-width-deprecated-received");
assert_false(r.headers.has("rtt-received"), "rtt-received");
assert_false(r.headers.has("downlink-received"), "downlink-received");
assert_false(r.headers.has("ect-received"), "ect-received");
});
}, "Delegate-CH malformed meta-equiv test");
</script>
</body>
</html>