Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 71 additions & 46 deletions test/fixtures/wpt/interfaces/WebCryptoAPI.idl
Original file line number Diff line number Diff line change
Expand Up @@ -42,52 +42,77 @@ enum KeyFormat { "raw", "spki", "pkcs8", "jwk" };

[SecureContext,Exposed=(Window,Worker)]
interface SubtleCrypto {
Promise<any> encrypt(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
Promise<any> decrypt(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
Promise<any> sign(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
Promise<any> verify(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource signature,
BufferSource data);
Promise<any> digest(AlgorithmIdentifier algorithm,
BufferSource data);

Promise<any> generateKey(AlgorithmIdentifier algorithm,
boolean extractable,
sequence<KeyUsage> keyUsages );
Promise<any> deriveKey(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
AlgorithmIdentifier derivedKeyType,
boolean extractable,
sequence<KeyUsage> keyUsages );
Promise<ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
optional unsigned long? length = null);

Promise<CryptoKey> importKey(KeyFormat format,
(BufferSource or JsonWebKey) keyData,
AlgorithmIdentifier algorithm,
boolean extractable,
sequence<KeyUsage> keyUsages );
Promise<any> exportKey(KeyFormat format, CryptoKey key);

Promise<any> wrapKey(KeyFormat format,
CryptoKey key,
CryptoKey wrappingKey,
AlgorithmIdentifier wrapAlgorithm);
Promise<CryptoKey> unwrapKey(KeyFormat format,
BufferSource wrappedKey,
CryptoKey unwrappingKey,
AlgorithmIdentifier unwrapAlgorithm,
AlgorithmIdentifier unwrappedKeyAlgorithm,
boolean extractable,
sequence<KeyUsage> keyUsages );
Promise<ArrayBuffer> encrypt(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data
);
Promise<ArrayBuffer> decrypt(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data
);
Promise<ArrayBuffer> sign(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data
);
Promise<boolean> verify(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource signature,
BufferSource data
);
Promise<ArrayBuffer> digest(
AlgorithmIdentifier algorithm,
BufferSource data
);

Promise<(CryptoKey or CryptoKeyPair)> generateKey(
AlgorithmIdentifier algorithm,
boolean extractable,
sequence<KeyUsage> keyUsages
);
Promise<CryptoKey> deriveKey(
AlgorithmIdentifier algorithm,
CryptoKey baseKey,
AlgorithmIdentifier derivedKeyType,
boolean extractable,
sequence<KeyUsage> keyUsages
);
Promise<ArrayBuffer> deriveBits(
AlgorithmIdentifier algorithm,
CryptoKey baseKey,
optional unsigned long? length = null
);

Promise<CryptoKey> importKey(
KeyFormat format,
(BufferSource or JsonWebKey) keyData,
AlgorithmIdentifier algorithm,
boolean extractable,
sequence<KeyUsage> keyUsages
);
Promise<(ArrayBuffer or JsonWebKey)> exportKey(
KeyFormat format,
CryptoKey key
);

Promise<ArrayBuffer> wrapKey(
KeyFormat format,
CryptoKey key,
CryptoKey wrappingKey,
AlgorithmIdentifier wrapAlgorithm
);
Promise<CryptoKey> unwrapKey(
KeyFormat format,
BufferSource wrappedKey,
CryptoKey unwrappingKey,
AlgorithmIdentifier unwrapAlgorithm,
AlgorithmIdentifier unwrappedKeyAlgorithm,
boolean extractable,
sequence<KeyUsage> keyUsages
);
};

dictionary RsaOtherPrimesInfo {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/interfaces/digital-credentials.idl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ partial dictionary CredentialRequestOptions {
};

dictionary DigitalCredentialRequestOptions {
sequence<DigitalCredentialsRequest> requests;
sequence<DigitalCredentialRequest> requests;
};

dictionary DigitalCredentialsRequest {
dictionary DigitalCredentialRequest {
required DOMString protocol;
required object data;
};
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/element-timing.idl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: Element Timing API (https://wicg.github.io/element-timing/)
// Source: Element Timing API (https://w3c.github.io/element-timing/)

[Exposed=Window]
interface PerformanceElementTiming : PerformanceEntry {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/speech-api.idl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: Web Speech API (https://wicg.github.io/speech-api/)
// Source: Web Speech API (https://webaudio.github.io/web-speech-api/)

[Exposed=Window]
interface SpeechRecognition : EventTarget {
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/wpt/interfaces/turtledove.idl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dictionary GenerateBidInterestGroup {
sequence<USVString> trustedBiddingSignalsKeys;
DOMString trustedBiddingSignalsSlotSizeMode = "none";
long maxTrustedBiddingSignalsURLLength;
USVString trustedBiddingSignalsCoordinator;
any userBiddingSignals;
sequence<AuctionAd> ads;
sequence<AuctionAd> adComponents;
Expand Down Expand Up @@ -104,6 +105,7 @@ dictionary AuctionAdConfig {

USVString trustedScoringSignalsURL;
long maxTrustedScoringSignalsURLLength;
USVString trustedScoringSignalsCoordinator;
sequence<USVString> interestGroupBuyers;
Promise<any> auctionSignals;
Promise<any> sellerSignals;
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/wai-aria.idl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface mixin ARIAMixin {
[CEReactions] attribute DOMString? ariaPosInSet;
[CEReactions] attribute DOMString? ariaPressed;
[CEReactions] attribute DOMString? ariaReadOnly;

[CEReactions] attribute DOMString? ariaRelevant;
[CEReactions] attribute DOMString? ariaRequired;
[CEReactions] attribute DOMString? ariaRoleDescription;
[CEReactions] attribute DOMString? ariaRowCount;
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/wpt/interfaces/webauthn.idl
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ enum PublicKeyCredentialHint {
};

partial dictionary AuthenticationExtensionsClientInputs {
USVString appid;
DOMString appid;
};

partial dictionary AuthenticationExtensionsClientOutputs {
boolean appid;
};

partial dictionary AuthenticationExtensionsClientInputs {
USVString appidExclude;
DOMString appidExclude;
};

partial dictionary AuthenticationExtensionsClientOutputs {
Expand All @@ -343,7 +343,7 @@ dictionary AuthenticationExtensionsPRFValues {

dictionary AuthenticationExtensionsPRFInputs {
AuthenticationExtensionsPRFValues eval;
record<USVString, AuthenticationExtensionsPRFValues> evalByCredential;
record<DOMString, AuthenticationExtensionsPRFValues> evalByCredential;
};

partial dictionary AuthenticationExtensionsClientInputs {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-helpers.sub.js"></script>
<body>
<script>
const SCRIPT = 'resources/fetch-with-body-worker.js';
const SCOPE = 'resources/blank.html';

let frame, registration;

promise_test(async t => {
t.add_cleanup(async() => {
if (frame)
frame.remove();
if (registration)
await registration.unregister();
});

await service_worker_unregister(t, SCOPE);
registration = await navigator.serviceWorker.register(SCRIPT, {scope: SCOPE});
await wait_for_state(t, registration.installing, 'activating');
frame = await with_iframe(SCOPE);

const request1 = new Request("resources/fetch-with-body-worker.py", {
method: "GET",
});

const response1 = await frame.contentWindow.fetch(request1);
assert_false(response1.ok);

const request2 = new Request("resources/fetch-with-body-worker.py", {
method: "POST",
body: "BODY",
headers: { "Content-Type": "text/ascii" },
});

const response2 = await frame.contentWindow.fetch(request2);
assert_true(response2.ok);
}, 'Validate body is preserved');

</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
self.addEventListener("fetch", (event) => {
event.request.body;
event.respondWith(fetch(event.request));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def main(request, response):
if len(request.body):
return 200, [], u"BODY"
return 400, [], u"NO BODY"
Loading