Skip to content

Commit 33daab9

Browse files
chore: update WPT (#4100)
Co-authored-by: Uzlopak <[email protected]>
1 parent 0ba30ce commit 33daab9

File tree

11 files changed

+148
-55
lines changed

11 files changed

+148
-55
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
features:
2+
- name: zstd
3+
files: "**"

test/fixtures/wpt/fetch/private-network-access/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ See also:
88
* [The specification](https://wicg.github.io/private-network-access/)
99
* [The repository](https://github.com/WICG/private-network-access/)
1010
* [Open issues](https://github.com/WICG/private-network-access/issues/)
11+
12+
Private Network Access is deprecated and will eventually be replaced by [Local
13+
Network Access](https://github.com/explainers-by-googlers/local-network-access).

test/fixtures/wpt/interfaces/fedcm.idl

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface IdentityCredential : Credential {
1212
static Promise<undefined> disconnect(IdentityCredentialDisconnectOptions options);
1313
readonly attribute USVString? token;
1414
readonly attribute boolean isAutoSelected;
15+
readonly attribute USVString configURL;
1516
};
1617

1718
dictionary DisconnectedAccount {
@@ -78,6 +79,7 @@ dictionary IdentityProviderAPIConfig {
7879
required USVString login_url;
7980
USVString disconnect_endpoint;
8081
IdentityProviderBranding branding;
82+
USVString account_label;
8183
};
8284

8385
dictionary IdentityProviderAccount {
@@ -89,6 +91,7 @@ dictionary IdentityProviderAccount {
8991
sequence<USVString> approved_clients;
9092
sequence<DOMString> login_hints;
9193
sequence<DOMString> domain_hints;
94+
sequence<DOMString> label_hints;
9295
};
9396
dictionary IdentityProviderAccountList {
9497
sequence<IdentityProviderAccount> accounts;

test/fixtures/wpt/interfaces/webaudio.idl

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
enum AudioContextState {
77
"suspended",
88
"running",
9-
"closed"
9+
"closed",
10+
"interrupted"
1011
};
1112

1213
enum AudioContextRenderSizeCategory {

test/fixtures/wpt/interfaces/webgpu.idl

+6-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ interface GPUAdapterInfo {
6464
readonly attribute DOMString description;
6565
readonly attribute unsigned long subgroupMinSize;
6666
readonly attribute unsigned long subgroupMaxSize;
67+
readonly attribute boolean isFallbackAdapter;
6768
};
6869

6970
interface mixin NavigatorGPU {
@@ -96,7 +97,6 @@ interface GPUAdapter {
9697
[SameObject] readonly attribute GPUSupportedFeatures features;
9798
[SameObject] readonly attribute GPUSupportedLimits limits;
9899
[SameObject] readonly attribute GPUAdapterInfo info;
99-
readonly attribute boolean isFallbackAdapter;
100100

101101
Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
102102
};
@@ -936,12 +936,16 @@ interface GPUCommandEncoder {
936936
GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
937937
GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {});
938938

939+
undefined copyBufferToBuffer(
940+
GPUBuffer source,
941+
GPUBuffer destination,
942+
optional GPUSize64 size);
939943
undefined copyBufferToBuffer(
940944
GPUBuffer source,
941945
GPUSize64 sourceOffset,
942946
GPUBuffer destination,
943947
GPUSize64 destinationOffset,
944-
GPUSize64 size);
948+
optional GPUSize64 size);
945949

946950
undefined copyBufferToTexture(
947951
GPUTexelCopyBufferInfo source,

test/fixtures/wpt/interfaces/webxr.idl

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ enum XRVisibilityState {
7070
dictionary XRRenderStateInit {
7171
double depthNear;
7272
double depthFar;
73+
boolean passthroughFullyObscured;
7374
double inlineVerticalFieldOfView;
7475
XRWebGLLayer? baseLayer;
7576
sequence<XRLayer>? layers;
@@ -78,6 +79,7 @@ dictionary XRRenderStateInit {
7879
[SecureContext, Exposed=Window] interface XRRenderState {
7980
readonly attribute double depthNear;
8081
readonly attribute double depthFar;
82+
readonly attribute boolean? passthroughFullyObscured;
8183
readonly attribute double? inlineVerticalFieldOfView;
8284
readonly attribute XRWebGLLayer? baseLayer;
8385
};

test/fixtures/wpt/resources/testdriver.js

+33-4
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@
14281428
* Causes a virtual pressure source to report a new reading.
14291429
*
14301430
* Matches the `Update virtual pressure source
1431-
* <https://w3c.github.io/compute-pressure/#update-virtual-pressure-source>`_
1431+
* <https://w3c.github.io/compute-pressure/?experimental=1#update-virtual-pressure-source>`_
14321432
* WebDriver command.
14331433
*
14341434
* @param {String} source_type - A `virtual pressure source type
@@ -1437,6 +1437,8 @@
14371437
* @param {String} sample - A `virtual pressure state
14381438
* <https://w3c.github.io/compute-pressure/#dom-pressurestate>`_
14391439
* such as "critical".
1440+
* @param {number} estimate - Optional, A `virtual own contribution estimate`
1441+
* <https://w3c.github.io/compute-pressure/?experimental=1#the-owncontributionestimate-attribute>`_
14401442
* @param {WindowProxy} [context=null] - Browsing context in which to
14411443
* run the call, or null for the
14421444
* current browsing context.
@@ -1447,8 +1449,8 @@
14471449
* virtual pressure source of the given type does not
14481450
* exist).
14491451
*/
1450-
update_virtual_pressure_source: function(source_type, sample, context=null) {
1451-
return window.test_driver_internal.update_virtual_pressure_source(source_type, sample, context);
1452+
update_virtual_pressure_source: function(source_type, sample, estimate, context=null) {
1453+
return window.test_driver_internal.update_virtual_pressure_source(source_type, sample, estimate, context);
14521454
},
14531455

14541456
/**
@@ -1472,6 +1474,29 @@
14721474
*/
14731475
remove_virtual_pressure_source: function(source_type, context=null) {
14741476
return window.test_driver_internal.remove_virtual_pressure_source(source_type, context);
1477+
},
1478+
1479+
/**
1480+
* Sets which hashes are considered k-anonymous for the Protected
1481+
* Audience interest group with specified `owner` and `name`.
1482+
*
1483+
* Matches the `Set Protected Audience K-Anonymity
1484+
* <https://wicg.github.io/turtledove/#sctn-automation-set-protected-audience-k-anonymity>
1485+
* WebDriver command.
1486+
*
1487+
* @param {String} owner - Origin of the owner of the interest group
1488+
* to modify
1489+
* @param {String} name - Name of the interest group to modify
1490+
* @param {Array} hashes - An array of strings, each of which is a
1491+
* base64 ecoded hash to consider k-anonymous.
1492+
*
1493+
* @returns {Promise} Fulfilled after the k-anonymity status for the
1494+
* specified Protected Audience interest group has
1495+
* been updated.
1496+
*
1497+
*/
1498+
set_protected_audience_k_anonymity: function(owner, name, hashes, context = null) {
1499+
return window.test_driver_internal.set_protected_audience_k_anonymity(owner, name, hashes, context);
14751500
}
14761501
};
14771502

@@ -1723,12 +1748,16 @@
17231748
throw new Error("create_virtual_pressure_source() is not implemented by testdriver-vendor.js");
17241749
},
17251750

1726-
async update_virtual_pressure_source(source_type, sample, context=null) {
1751+
async update_virtual_pressure_source(source_type, sample, estimate, context=null) {
17271752
throw new Error("update_virtual_pressure_source() is not implemented by testdriver-vendor.js");
17281753
},
17291754

17301755
async remove_virtual_pressure_source(source_type, context=null) {
17311756
throw new Error("remove_virtual_pressure_source() is not implemented by testdriver-vendor.js");
1757+
},
1758+
1759+
async set_protected_audience_k_anonymity(owner, name, hashes, context=null) {
1760+
throw new Error("set_protected_audience_k_anonymity() is not implemented by testdriver-vendor.js");
17321761
}
17331762
};
17341763
})();

test/fixtures/wpt/resources/testharness.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,15 @@
13301330
"0xffff": "uffff",
13311331
};
13321332

1333+
const formatEscapeMap = {
1334+
"\\": "\\\\",
1335+
'"': '\\"'
1336+
};
1337+
for (const p in replacements) {
1338+
formatEscapeMap[String.fromCharCode(p)] = "\\" + replacements[p];
1339+
}
1340+
const formatEscapePattern = new RegExp(`[${Object.keys(formatEscapeMap).map(k => k === "\\" ? "\\\\" : k).join("")}]`, "g");
1341+
13331342
/**
13341343
* Convert a value to a nice, human-readable string
13351344
*
@@ -1380,12 +1389,7 @@
13801389

13811390
switch (typeof val) {
13821391
case "string":
1383-
val = val.replace(/\\/g, "\\\\");
1384-
for (var p in replacements) {
1385-
var replace = "\\" + replacements[p];
1386-
val = val.replace(RegExp(String.fromCharCode(p), "g"), replace);
1387-
}
1388-
return '"' + val.replace(/"/g, '\\"') + '"';
1392+
return '"' + val.replace(formatEscapePattern, match => formatEscapeMap[match]) + '"';
13891393
case "boolean":
13901394
case "undefined":
13911395
return String(val);

test/fixtures/wpt/xhr/resources/redirect.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import time
2+
from urllib.parse import parse_qs
23

34
from wptserve.utils import isomorphic_encode
45

56
def main(request, response):
67
code = int(request.GET.first(b"code", 302))
78
location = request.GET.first(b"location", isomorphic_encode(request.url_parts.path + u"?followed"))
9+
if location:
10+
location = parse_qs(u"location=" + location.decode(u"UTF-8"))[u"location"][0]
11+
if location.startswith(u"redirect.py"):
12+
location += u"&code=" + str(code)
813

914
if b"delay" in request.GET:
1015
delay = float(request.GET.first(b"delay"))

test/fixtures/wpt/xhr/send-redirect.htm

+61-24
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,73 @@
1010
<div id="log"></div>
1111
<script>
1212
// https://fetch.spec.whatwg.org/#statuses
13-
var redirect_codes = new Set([301, 302, 303, 307, 308]);
14-
function redirect(code) {
15-
var test = async_test(`${document.title} (${code} does ${redirect_codes.has(code)? "redirect": "not redirect"})`);
16-
test.step(function() {
17-
var client = new XMLHttpRequest();
18-
client.onreadystatechange = function() {
19-
test.step(function() {
20-
if(client.readyState == 4) {
21-
if (redirect_codes.has(code)) {
22-
assert_equals(client.getResponseHeader("x-request-method"), "GET");
23-
assert_equals(client.getResponseHeader("x-request-content-type"), "application/x-pony");
24-
assert_equals(client.status, 200);
25-
} else {
26-
assert_equals(client.getResponseHeader("x-request-method"), null);
27-
assert_equals(client.getResponseHeader("x-request-content-type"), null);
28-
assert_equals(client.status, code);
13+
const redirect_codes = new Set([301, 302, 303, 307, 308]);
14+
function maybeRedirect(code, method="GET", redirectLocation="content.py") {
15+
async_test(t => {
16+
const client = new XMLHttpRequest();
17+
client.onreadystatechange = t.step_func(() => {
18+
if(client.readyState == 4) {
19+
if (redirect_codes.has(code)) {
20+
let expected_method = method;
21+
let expected_content_type = "application/x-pony";
22+
if ((method == "POST" && (code == "301" || code == "302")) ||
23+
(code == "303" && method != "GET" && method != "HEAD")) {
24+
expected_method = "GET";
25+
expected_content_type = "NO";
2926
}
30-
test.done();
27+
assert_equals(client.getResponseHeader("x-request-method"), expected_method);
28+
assert_equals(client.getResponseHeader("x-request-content-type"), expected_content_type);
29+
assert_equals(client.status, 200);
30+
} else {
31+
assert_equals(client.getResponseHeader("x-request-method"), null);
32+
assert_equals(client.getResponseHeader("x-request-content-type"), null);
33+
assert_equals(client.status, code);
3134
}
32-
})
33-
}
34-
client.open("GET", "resources/redirect.py?location=content.py&code=" + code);
35+
t.done();
36+
}
37+
});
38+
client.open(method, `resources/redirect.py?location=${redirectLocation}&code=${code}`);
3539
client.setRequestHeader("Content-Type", "application/x-pony");
3640
client.send(null);
37-
})
41+
}, `${document.title} (${code}, ${method}, ${redirectLocation})`);
3842
}
3943

40-
for (var number of [300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 350, 399]) {
41-
redirect(number);
42-
}
44+
maybeRedirect(300);
45+
maybeRedirect(301);
46+
maybeRedirect(302);
47+
maybeRedirect(303);
48+
maybeRedirect(304);
49+
maybeRedirect(305);
50+
maybeRedirect(306);
51+
maybeRedirect(307);
52+
maybeRedirect(308);
53+
maybeRedirect(309);
54+
maybeRedirect(310);
55+
maybeRedirect(350);
56+
maybeRedirect(399);
57+
maybeRedirect(301, "POST");
58+
maybeRedirect(302, "POST");
59+
maybeRedirect(303, "POST");
60+
maybeRedirect(307, "POST");
61+
maybeRedirect(301, "HEAD");
62+
maybeRedirect(302, "HEAD");
63+
maybeRedirect(303, "HEAD");
64+
maybeRedirect(307, "HEAD");
65+
66+
const redirectedLocation = encodeURIComponent("redirect.py?location=content.py");
67+
maybeRedirect(301, "GET", redirectedLocation);
68+
maybeRedirect(302, "GET", redirectedLocation);
69+
maybeRedirect(303, "GET", redirectedLocation);
70+
maybeRedirect(307, "GET", redirectedLocation);
71+
maybeRedirect(301, "POST", redirectedLocation);
72+
maybeRedirect(302, "POST", redirectedLocation);
73+
maybeRedirect(303, "POST", redirectedLocation);
74+
maybeRedirect(307, "POST", redirectedLocation);
75+
maybeRedirect(303, "CHICKEN", redirectedLocation);
76+
maybeRedirect(301, "HEAD", redirectedLocation);
77+
maybeRedirect(302, "HEAD", redirectedLocation);
78+
maybeRedirect(303, "HEAD", redirectedLocation);
79+
maybeRedirect(307, "HEAD", redirectedLocation);
4380
</script>
4481
</body>
4582
</html>

test/fixtures/wpt/xhr/setrequestheader-case-insensitive.htm

+20-18
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,28 @@
99
<body>
1010
<div id="log"></div>
1111
<script>
12-
test(function() {
13-
var client = new XMLHttpRequest()
14-
client.open("POST", "resources/inspect-headers.py?filter_value=t1, t2, t3", false)
15-
client.setRequestHeader("x-test", "t1")
16-
client.setRequestHeader("X-TEST", "t2")
17-
client.setRequestHeader("X-teST", "t3")
18-
client.send(null)
19-
assert_equals(client.responseText, "x-test,")
20-
})
12+
test(() => {
13+
const client = new XMLHttpRequest();
14+
client.open("POST", "resources/inspect-headers.py?filter_value=t1, t2, t3", false);
15+
client.setRequestHeader("x-test", "t1");
16+
client.setRequestHeader("X-TEST", "t2");
17+
client.setRequestHeader("X-teST", "t3");
18+
client.send(null);
19+
assert_equals(client.responseText, "x-test,");
20+
});
2121

2222
test(() => {
23-
const client = new XMLHttpRequest
24-
client.open("GET", "resources/echo-headers.py", false)
25-
client.setRequestHeader("THIS-IS-A-TEST", "1")
26-
client.setRequestHeader("THIS-is-A-test", "2")
27-
client.setRequestHeader("content-TYPE", "x/x")
28-
client.send()
29-
assert_regexp_match(client.responseText, /content-TYPE/)
30-
assert_regexp_match(client.responseText, /THIS-IS-A-TEST: 1, 2/)
31-
})
23+
const client = new XMLHttpRequest();
24+
client.open("GET", "resources/echo-headers.py", false);
25+
client.setRequestHeader("THIS-IS-A-TEST", "1");
26+
client.setRequestHeader("THIS-is-A-test", "2");
27+
client.setRequestHeader("content-TYPE", "x/x");
28+
client.send();
29+
const contentTypeHeader = client.responseText.match(/content-TYPE/gi);
30+
const thisIsATestHeader = client.responseText.match(/THIS-IS-A-TEST: 1, 2/gi);
31+
assert_array_equals(contentTypeHeader, ["content-TYPE"]);
32+
assert_array_equals(thisIsATestHeader, ["THIS-IS-A-TEST: 1, 2"]);
33+
});
3234
</script>
3335
</body>
3436
</html>

0 commit comments

Comments
 (0)