mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Update web-platform-tests to revision b202bbb5aa0d235b22bac11fe902eab1094ef9d2
This commit is contained in:
parent
9a6c96808b
commit
e90dd8bc6b
43 changed files with 669 additions and 286 deletions
|
@ -0,0 +1,30 @@
|
|||
<html>
|
||||
<body>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
// If the response for the HTML file contains "Accept-CH: device-memory" in
|
||||
// the response headers, then the browser should attach device-memory client
|
||||
// hint in the HTTP request headers. Test this functionality by fetching an
|
||||
// XHR from this page. The response headers for this page include
|
||||
// "Accept-CH: device-memory".
|
||||
//
|
||||
// echo_device_memory_header_received.py includes "device-memory-received" in
|
||||
// the response headers only if the request included "device-memory" in the
|
||||
// headers.
|
||||
|
||||
promise_test(t => {
|
||||
return fetch("/client-hints/echo_device_memory_header_received.py").then(r => {
|
||||
assert_equals(r.status, 200)
|
||||
// Verify that the browser included "device-memory" in the headers when
|
||||
// fetching the XHR.
|
||||
assert_true(r.headers.has("device-memory-received"));
|
||||
});
|
||||
}, "Accept-CH header test");
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
Accept-CH: device-memory
|
|
@ -0,0 +1,8 @@
|
|||
def main(request, response):
|
||||
"""
|
||||
Simple handler that sets a response header based on if device-memory
|
||||
request header was received or not.
|
||||
"""
|
||||
|
||||
if "device-memory" in request.headers:
|
||||
response.headers.set("device-memory-received", "true")
|
Loading…
Add table
Add a link
Reference in a new issue