mirror of
https://github.com/servo/servo.git
synced 2025-08-24 14:48:21 +01:00
Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee
This commit is contained in:
parent
fe1a057bd1
commit
24183668c4
1960 changed files with 29853 additions and 10555 deletions
|
@ -10,11 +10,10 @@
|
|||
// HTTP request headers depending on whether the resource is being fetched from
|
||||
// the same origin or a different origin. Test this functionality by fetching
|
||||
// same-origin and cross-origin resources from this page. The response headers
|
||||
// for this page include "Accept-CH: device-memory, dpr, viewport-width".
|
||||
// for this page include "Accept-CH: device-memory, dpr, viewport-width, rtt, downlink, ect".
|
||||
//
|
||||
// echo_client_hints_received.py includes "device-memory-received",
|
||||
// "dpr-received" and "viewport-width-received" in the response headers
|
||||
// depending on the set of client hints it receives in the request headers.
|
||||
// echo_client_hints_received.py sets the response headers depending on the set
|
||||
// of client hints it receives in the request headers.
|
||||
|
||||
promise_test(t => {
|
||||
return fetch("https://{{domains[]}}:{{ports[https][0]}}/client-hints/echo_client_hints_received.py", {"mode": "no-cors"}).then(r => {
|
||||
|
@ -24,6 +23,20 @@ promise_test(t => {
|
|||
assert_true(r.headers.has("device-memory-received"), "device-memory-received");
|
||||
assert_true(r.headers.has("dpr-received"), "dpr-received");
|
||||
assert_true(r.headers.has("viewport-width-received"), "viewport-width-received");
|
||||
|
||||
assert_true(r.headers.has("rtt-received"), "rtt-received");
|
||||
var rtt = parseInt(r.headers.get("rtt-received"));
|
||||
assert_greater_than_equal(rtt, 0);
|
||||
assert_less_than_equal(rtt, 3000);
|
||||
assert_equals(rtt % 50, 0, 'rtt must be a multiple of 50 msec');
|
||||
|
||||
assert_true(r.headers.has("downlink-received"), "downlink-received");
|
||||
var downlinkKbps = r.headers.get("downlink-received") * 1000;
|
||||
assert_greater_than_equal(downlinkKbps, 0);
|
||||
assert_less_than_equal(downlinkKbps, 10000);
|
||||
|
||||
assert_in_array(r.headers.get("ect-received"), ["slow-2g", "2g",
|
||||
"3g", "4g"], 'ect-received is unexpected');
|
||||
});
|
||||
}, "Accept-CH header test");
|
||||
|
||||
|
@ -35,6 +48,9 @@ promise_test(t => {
|
|||
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
|
||||
assert_false(r.headers.has("dpr-received"), "dpr-received");
|
||||
assert_false(r.headers.has("viewport-width-received"), "viewport-width-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");
|
||||
});
|
||||
}, "Cross-Origin Accept-CH header test");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue