Skip to content

Commit 45eaed2

Browse files
chore: update WPT (#3991)
Co-authored-by: Uzlopak <[email protected]>
1 parent 251da10 commit 45eaed2

11 files changed

+133
-54
lines changed

test/fixtures/wpt/interfaces/WebCryptoAPI.idl

+71-46
Original file line numberDiff line numberDiff line change
@@ -42,52 +42,77 @@ enum KeyFormat { "raw", "spki", "pkcs8", "jwk" };
4242

4343
[SecureContext,Exposed=(Window,Worker)]
4444
interface SubtleCrypto {
45-
Promise<any> encrypt(AlgorithmIdentifier algorithm,
46-
CryptoKey key,
47-
BufferSource data);
48-
Promise<any> decrypt(AlgorithmIdentifier algorithm,
49-
CryptoKey key,
50-
BufferSource data);
51-
Promise<any> sign(AlgorithmIdentifier algorithm,
52-
CryptoKey key,
53-
BufferSource data);
54-
Promise<any> verify(AlgorithmIdentifier algorithm,
55-
CryptoKey key,
56-
BufferSource signature,
57-
BufferSource data);
58-
Promise<any> digest(AlgorithmIdentifier algorithm,
59-
BufferSource data);
60-
61-
Promise<any> generateKey(AlgorithmIdentifier algorithm,
62-
boolean extractable,
63-
sequence<KeyUsage> keyUsages );
64-
Promise<any> deriveKey(AlgorithmIdentifier algorithm,
65-
CryptoKey baseKey,
66-
AlgorithmIdentifier derivedKeyType,
67-
boolean extractable,
68-
sequence<KeyUsage> keyUsages );
69-
Promise<ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm,
70-
CryptoKey baseKey,
71-
optional unsigned long? length = null);
72-
73-
Promise<CryptoKey> importKey(KeyFormat format,
74-
(BufferSource or JsonWebKey) keyData,
75-
AlgorithmIdentifier algorithm,
76-
boolean extractable,
77-
sequence<KeyUsage> keyUsages );
78-
Promise<any> exportKey(KeyFormat format, CryptoKey key);
79-
80-
Promise<any> wrapKey(KeyFormat format,
81-
CryptoKey key,
82-
CryptoKey wrappingKey,
83-
AlgorithmIdentifier wrapAlgorithm);
84-
Promise<CryptoKey> unwrapKey(KeyFormat format,
85-
BufferSource wrappedKey,
86-
CryptoKey unwrappingKey,
87-
AlgorithmIdentifier unwrapAlgorithm,
88-
AlgorithmIdentifier unwrappedKeyAlgorithm,
89-
boolean extractable,
90-
sequence<KeyUsage> keyUsages );
45+
Promise<ArrayBuffer> encrypt(
46+
AlgorithmIdentifier algorithm,
47+
CryptoKey key,
48+
BufferSource data
49+
);
50+
Promise<ArrayBuffer> decrypt(
51+
AlgorithmIdentifier algorithm,
52+
CryptoKey key,
53+
BufferSource data
54+
);
55+
Promise<ArrayBuffer> sign(
56+
AlgorithmIdentifier algorithm,
57+
CryptoKey key,
58+
BufferSource data
59+
);
60+
Promise<boolean> verify(
61+
AlgorithmIdentifier algorithm,
62+
CryptoKey key,
63+
BufferSource signature,
64+
BufferSource data
65+
);
66+
Promise<ArrayBuffer> digest(
67+
AlgorithmIdentifier algorithm,
68+
BufferSource data
69+
);
70+
71+
Promise<(CryptoKey or CryptoKeyPair)> generateKey(
72+
AlgorithmIdentifier algorithm,
73+
boolean extractable,
74+
sequence<KeyUsage> keyUsages
75+
);
76+
Promise<CryptoKey> deriveKey(
77+
AlgorithmIdentifier algorithm,
78+
CryptoKey baseKey,
79+
AlgorithmIdentifier derivedKeyType,
80+
boolean extractable,
81+
sequence<KeyUsage> keyUsages
82+
);
83+
Promise<ArrayBuffer> deriveBits(
84+
AlgorithmIdentifier algorithm,
85+
CryptoKey baseKey,
86+
optional unsigned long? length = null
87+
);
88+
89+
Promise<CryptoKey> importKey(
90+
KeyFormat format,
91+
(BufferSource or JsonWebKey) keyData,
92+
AlgorithmIdentifier algorithm,
93+
boolean extractable,
94+
sequence<KeyUsage> keyUsages
95+
);
96+
Promise<(ArrayBuffer or JsonWebKey)> exportKey(
97+
KeyFormat format,
98+
CryptoKey key
99+
);
100+
101+
Promise<ArrayBuffer> wrapKey(
102+
KeyFormat format,
103+
CryptoKey key,
104+
CryptoKey wrappingKey,
105+
AlgorithmIdentifier wrapAlgorithm
106+
);
107+
Promise<CryptoKey> unwrapKey(
108+
KeyFormat format,
109+
BufferSource wrappedKey,
110+
CryptoKey unwrappingKey,
111+
AlgorithmIdentifier unwrapAlgorithm,
112+
AlgorithmIdentifier unwrappedKeyAlgorithm,
113+
boolean extractable,
114+
sequence<KeyUsage> keyUsages
115+
);
91116
};
92117

93118
dictionary RsaOtherPrimesInfo {

test/fixtures/wpt/interfaces/digital-credentials.idl

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ partial dictionary CredentialRequestOptions {
88
};
99

1010
dictionary DigitalCredentialRequestOptions {
11-
sequence<DigitalCredentialsRequest> requests;
11+
sequence<DigitalCredentialRequest> requests;
1212
};
1313

14-
dictionary DigitalCredentialsRequest {
14+
dictionary DigitalCredentialRequest {
1515
required DOMString protocol;
1616
required object data;
1717
};

test/fixtures/wpt/interfaces/element-timing.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// GENERATED CONTENT - DO NOT EDIT
22
// Content was automatically extracted by Reffy into webref
33
// (https://github.com/w3c/webref)
4-
// Source: Element Timing API (https://wicg.github.io/element-timing/)
4+
// Source: Element Timing API (https://w3c.github.io/element-timing/)
55

66
[Exposed=Window]
77
interface PerformanceElementTiming : PerformanceEntry {

test/fixtures/wpt/interfaces/speech-api.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// GENERATED CONTENT - DO NOT EDIT
22
// Content was automatically extracted by Reffy into webref
33
// (https://github.com/w3c/webref)
4-
// Source: Web Speech API (https://wicg.github.io/speech-api/)
4+
// Source: Web Speech API (https://webaudio.github.io/web-speech-api/)
55

66
[Exposed=Window]
77
interface SpeechRecognition : EventTarget {

test/fixtures/wpt/interfaces/turtledove.idl

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dictionary GenerateBidInterestGroup {
4141
sequence<USVString> trustedBiddingSignalsKeys;
4242
DOMString trustedBiddingSignalsSlotSizeMode = "none";
4343
long maxTrustedBiddingSignalsURLLength;
44+
USVString trustedBiddingSignalsCoordinator;
4445
any userBiddingSignals;
4546
sequence<AuctionAd> ads;
4647
sequence<AuctionAd> adComponents;
@@ -104,6 +105,7 @@ dictionary AuctionAdConfig {
104105

105106
USVString trustedScoringSignalsURL;
106107
long maxTrustedScoringSignalsURLLength;
108+
USVString trustedScoringSignalsCoordinator;
107109
sequence<USVString> interestGroupBuyers;
108110
Promise<any> auctionSignals;
109111
Promise<any> sellerSignals;

test/fixtures/wpt/interfaces/wai-aria.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface mixin ARIAMixin {
4242
[CEReactions] attribute DOMString? ariaPosInSet;
4343
[CEReactions] attribute DOMString? ariaPressed;
4444
[CEReactions] attribute DOMString? ariaReadOnly;
45-
45+
[CEReactions] attribute DOMString? ariaRelevant;
4646
[CEReactions] attribute DOMString? ariaRequired;
4747
[CEReactions] attribute DOMString? ariaRoleDescription;
4848
[CEReactions] attribute DOMString? ariaRowCount;

test/fixtures/wpt/interfaces/webauthn.idl

+3-3
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,15 @@ enum PublicKeyCredentialHint {
309309
};
310310

311311
partial dictionary AuthenticationExtensionsClientInputs {
312-
USVString appid;
312+
DOMString appid;
313313
};
314314

315315
partial dictionary AuthenticationExtensionsClientOutputs {
316316
boolean appid;
317317
};
318318

319319
partial dictionary AuthenticationExtensionsClientInputs {
320-
USVString appidExclude;
320+
DOMString appidExclude;
321321
};
322322

323323
partial dictionary AuthenticationExtensionsClientOutputs {
@@ -343,7 +343,7 @@ dictionary AuthenticationExtensionsPRFValues {
343343

344344
dictionary AuthenticationExtensionsPRFInputs {
345345
AuthenticationExtensionsPRFValues eval;
346-
record<USVString, AuthenticationExtensionsPRFValues> evalByCredential;
346+
record<DOMString, AuthenticationExtensionsPRFValues> evalByCredential;
347347
};
348348

349349
partial dictionary AuthenticationExtensionsClientInputs {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<script src="/resources/testharness.js"></script>
3+
<script src="/resources/testharnessreport.js"></script>
4+
<script src="resources/test-helpers.sub.js"></script>
5+
<body>
6+
<script>
7+
const SCRIPT = 'resources/fetch-with-body-worker.js';
8+
const SCOPE = 'resources/blank.html';
9+
10+
let frame, registration;
11+
12+
promise_test(async t => {
13+
t.add_cleanup(async() => {
14+
if (frame)
15+
frame.remove();
16+
if (registration)
17+
await registration.unregister();
18+
});
19+
20+
await service_worker_unregister(t, SCOPE);
21+
registration = await navigator.serviceWorker.register(SCRIPT, {scope: SCOPE});
22+
await wait_for_state(t, registration.installing, 'activating');
23+
frame = await with_iframe(SCOPE);
24+
25+
const request1 = new Request("resources/fetch-with-body-worker.py", {
26+
method: "GET",
27+
});
28+
29+
const response1 = await frame.contentWindow.fetch(request1);
30+
assert_false(response1.ok);
31+
32+
const request2 = new Request("resources/fetch-with-body-worker.py", {
33+
method: "POST",
34+
body: "BODY",
35+
headers: { "Content-Type": "text/ascii" },
36+
});
37+
38+
const response2 = await frame.contentWindow.fetch(request2);
39+
assert_true(response2.ok);
40+
}, 'Validate body is preserved');
41+
42+
</script>
43+
</body>
44+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
self.addEventListener("fetch", (event) => {
2+
event.request.body;
3+
event.respondWith(fetch(event.request));
4+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def main(request, response):
2+
if len(request.body):
3+
return 200, [], u"BODY"
4+
return 400, [], u"NO BODY"

0 commit comments

Comments
 (0)