The first of these tests is in https://chromium-review.googlesource.com/c/chromium/src/+/951867
Some thoughts about other bits that should be tested:
- Use of "equivalent HTML markup"
- What happens if the main frame document *doesn't* have a Accept-CH header but a response in an iframe does, and the iframe requests a resource. (I think it shouldn't work per spec?)
- That it doesn't work on non-secure contexts
- Parsing tests, to check that the value of the Accept-CH header is parsed per spec with regard to comma separation (that it's not a whitespace-separated list)
The Accept-CH-Lifetime header itself seems kinda tricky to test. What I think you could do is to have the test first open a window from another domain which sends the Accept-CH header and a Accept-CH-Lifetime header with a long timeout. Then close the window, open it again, and check if the client hint headers were sent on the navigation request the second time.
http://web-platform-tests.org/writing-tests/server-features.html is documentation for how to do the cross-origin bits.
Comment 1 by tbansal@chromium.org
, Mar 9 2018