Skip to content

Commit

Permalink
chore: update WPT
Browse files Browse the repository at this point in the history
  • Loading branch information
jazelly authored and github-actions[bot] committed Dec 3, 2024
1 parent 8e025d1 commit 55864c6
Show file tree
Hide file tree
Showing 44 changed files with 755 additions and 589 deletions.
1 change: 1 addition & 0 deletions test/fixtures/wpt/eventsource/META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ suggested_reviewers:
- odinho
- Yaffle
- annevk
- rexxars
52 changes: 29 additions & 23 deletions test/fixtures/wpt/fetch/fetch-later/quota.tentative.https.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

'use strict';

const kQuotaPerOrigin = 64 * 1024; // 64 kilobytes per spec.
const QUOTA_PER_ORIGIN = 64 * 1024; // 64 kilobytes per spec.
const {ORIGIN, HTTPS_NOTSAMESITE_ORIGIN} = get_host_info();
const TEST_ENDPOINT = '/fetch-later';

// Runs a test case that cover a single fetchLater() call with `body` in its
// request payload. The call is not expected to throw any errors.
function fetchLaterPostTest(body, description) {
test(() => {
const controller = new AbortController();
const result = fetchLater(
'/fetch-later',
{method: 'POST', signal: controller.signal, body: body});
TEST_ENDPOINT, {method: 'POST', signal: controller.signal, body: body});
assert_false(result.activated);
// Release quota taken by the pending request for subsequent tests.
controller.abort();
Expand All @@ -30,19 +30,25 @@ for (const [dataType, skipCharset] of Object.entries(
}

// Test various size of payloads for the same origin.
for (const dataType in BeaconDataType) {
if (dataType !== BeaconDataType.FormData &&
dataType !== BeaconDataType.URLSearchParams) {
// Skips FormData & URLSearchParams, as browser adds extra bytes to them
// in addition to the user-provided content. It is difficult to test a
// request right at the quota limit.
fetchLaterPostTest(
// Generates data that is exactly 64 kilobytes.
makeBeaconData(generatePayload(kQuotaPerOrigin), dataType),
`A single fetchLater() call takes up the per-origin quota for its ` +
`body of ${dataType}.`);
}
}

// Test max possible size of payload.
// Length of absolute URL to the endpoint.
const POST_TEST_REQUEST_URL_SIZE = (ORIGIN + TEST_ENDPOINT).length;
// Total size of the request header.
const POST_TEST_REQUEST_HEADER_SIZE = 36;
// Runs this test only for String type beacon, as browser adds extra bytes to
// body for some other types (FormData & URLSearchParams), and the request
// header sizes varies for every other types. It is difficult to test a request
// right at the quota limit.
fetchLaterPostTest(
// Generates data that is exactly 64 kilobytes.
makeBeaconData(
generatePayload(
QUOTA_PER_ORIGIN - POST_TEST_REQUEST_URL_SIZE -
POST_TEST_REQUEST_HEADER_SIZE),
BeaconDataType.String),
`A single fetchLater() call takes up the per-origin quota for its ` +
`body of String.`);

// Test empty payload.
for (const dataType in BeaconDataType) {
Expand All @@ -64,8 +70,8 @@ for (const dataType in BeaconDataType) {
() => fetchLater('/fetch-later', {
method: 'POST',
// Generates data that exceeds 64 kilobytes.
body:
makeBeaconData(generatePayload(kQuotaPerOrigin + 1), dataType)
body: makeBeaconData(
generatePayload(QUOTA_PER_ORIGIN + 1), dataType)
}));
},
`A single fetchLater() call is not allowed to exceed per-origin quota ` +
Expand All @@ -81,7 +87,7 @@ for (const dataType in BeaconDataType) {
fetchLater('/fetch-later', {
method: 'POST',
signal: controller.signal,
body: makeBeaconData(generatePayload(kQuotaPerOrigin / 2), dataType)
body: makeBeaconData(generatePayload(QUOTA_PER_ORIGIN / 2), dataType)
});

// Makes the 2nd call that sends half+1 of allowed quota.
Expand All @@ -90,7 +96,7 @@ for (const dataType in BeaconDataType) {
method: 'POST',
signal: controller.signal,
body: makeBeaconData(
generatePayload(kQuotaPerOrigin / 2 + 1), dataType)
generatePayload(QUOTA_PER_ORIGIN / 2 + 1), dataType)
});
});
// Release quota taken by the pending requests for subsequent tests.
Expand All @@ -109,16 +115,16 @@ for (const dataType in BeaconDataType) {
fetchLater('/fetch-later', {
method: 'POST',
signal: controller.signal,
body: makeBeaconData(generatePayload(kQuotaPerOrigin / 2), dataType)
body: makeBeaconData(generatePayload(QUOTA_PER_ORIGIN / 2), dataType)
});

// Makes the 2nd call that sends half+1 of allowed quota, but to a
// different origin.
fetchLater(`${HTTPS_NOTSAMESITE_ORIGIN}/fetch-later`, {
method: 'POST',
signal: controller.signal,
body:
makeBeaconData(generatePayload(kQuotaPerOrigin / 2 + 1), dataType)
body: makeBeaconData(
generatePayload(QUOTA_PER_ORIGIN / 2 + 1), dataType)
});
// Release quota taken by the pending requests for subsequent tests.
controller.abort();
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/wpt/interfaces/attribution-reporting-api.idl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface mixin HTMLAttributionSrcElementUtils {
};

HTMLAnchorElement includes HTMLAttributionSrcElementUtils;
HTMLAreaElement includes HTMLAttributionSrcElementUtils;
HTMLImageElement includes HTMLAttributionSrcElementUtils;
HTMLScriptElement includes HTMLAttributionSrcElementUtils;

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/compute-pressure.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// (https://github.com/w3c/webref)
// Source: Compute Pressure Level 1 (https://w3c.github.io/compute-pressure/)

enum PressureSource { "thermals", "cpu" };
enum PressureSource { "cpu" };

enum PressureState { "nominal", "fair", "serious", "critical" };

Expand Down
21 changes: 18 additions & 3 deletions test/fixtures/wpt/interfaces/fedcm.idl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ enum IdentityCredentialRequestOptionsContext {
"continue"
};

enum IdentityCredentialRequestOptionsMode {
"active",
"passive"
};

dictionary IdentityCredentialRequestOptions {
required sequence<IdentityProviderRequestOptions> providers;
IdentityCredentialRequestOptionsContext context = "signin";
IdentityCredentialRequestOptionsMode mode = "passive";
};

dictionary IdentityProviderConfig {
Expand All @@ -43,10 +49,13 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
USVString nonce;
DOMString loginHint;
DOMString domainHint;
any params;
};

dictionary IdentityProviderWellKnown {
required sequence<USVString> provider_urls;
sequence<USVString> provider_urls;
USVString accounts_endpoint;
USVString login_url;
};

dictionary IdentityProviderIcon {
Expand Down Expand Up @@ -84,8 +93,9 @@ dictionary IdentityProviderAccountList {
sequence<IdentityProviderAccount> accounts;
};

dictionary IdentityProviderToken {
required USVString token;
dictionary IdentityAssertionResponse {
USVString token;
USVString continue_on;
};

dictionary IdentityProviderClientMetadata {
Expand All @@ -100,7 +110,12 @@ dictionary IdentityUserInfo {
USVString picture;
};

dictionary IdentityResolveOptions {
USVString accountId;
};

[Exposed=Window, SecureContext] interface IdentityProvider {
static undefined close();
static undefined resolve(DOMString token, optional IdentityResolveOptions options = {});
static Promise<sequence<IdentityUserInfo>> getUserInfo(IdentityProviderConfig config);
};
6 changes: 6 additions & 0 deletions test/fixtures/wpt/interfaces/fenced-frame.idl
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ interface Fence {
undefined reportEvent(optional ReportEventType event = {});
undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event = {});
sequence<FencedFrameConfig> getNestedConfigs();
Promise<undefined> disableUntrustedNetwork();
undefined notifyEvent(Event event);
};

partial interface Window {
// Collection of fenced frame APIs
readonly attribute Fence? fence;
};

partial interface mixin GlobalEventHandlers {
attribute EventHandler onfencedtreeclick;
};
31 changes: 22 additions & 9 deletions test/fixtures/wpt/interfaces/html.idl
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,20 @@ interface HTMLElement : Element {
ElementInternals attachInternals();

// The popover API
undefined showPopover();
undefined showPopover(optional ShowPopoverOptions options = {});
undefined hidePopover();
boolean togglePopover(optional boolean force);
boolean togglePopover(optional (TogglePopoverOptions or boolean) options = {});
[CEReactions] attribute DOMString? popover;
};

dictionary ShowPopoverOptions {
HTMLElement source;
};

dictionary TogglePopoverOptions : ShowPopoverOptions {
boolean force;
};

HTMLElement includes GlobalEventHandlers;
HTMLElement includes ElementContentEditable;
HTMLElement includes HTMLOrSVGElement;
Expand Down Expand Up @@ -881,10 +889,12 @@ interface HTMLInputElement : HTMLElement {
[HTMLConstructor] constructor();

[CEReactions] attribute DOMString accept;
[CEReactions] attribute boolean alpha;
[CEReactions] attribute DOMString alt;
[CEReactions] attribute DOMString autocomplete;
[CEReactions] attribute boolean defaultChecked;
attribute boolean checked;
[CEReactions] attribute DOMString colorSpace;
[CEReactions] attribute DOMString dirName;
[CEReactions] attribute boolean disabled;
readonly attribute HTMLFormElement? form;
Expand Down Expand Up @@ -2510,6 +2520,11 @@ interface MessageChannel {
readonly attribute MessagePort port2;
};

interface mixin MessageEventTarget {
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
};

[Exposed=(Window,Worker,AudioWorklet), Transferable]
interface MessagePort : EventTarget {
undefined postMessage(any message, sequence<object> transfer);
Expand All @@ -2518,11 +2533,11 @@ interface MessagePort : EventTarget {
undefined close();

// event handlers
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
attribute EventHandler onclose;
};

MessagePort includes MessageEventTarget;

dictionary StructuredSerializeOptions {
sequence<object> transfer = [];
};
Expand Down Expand Up @@ -2561,11 +2576,10 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
undefined postMessage(any message, optional StructuredSerializeOptions options = {});

undefined close();

attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
};

DedicatedWorkerGlobalScope includes MessageEventTarget;

[Global=(Worker,SharedWorker),Exposed=SharedWorker]
interface SharedWorkerGlobalScope : WorkerGlobalScope {
[Replaceable] readonly attribute DOMString name;
Expand All @@ -2587,8 +2601,6 @@ interface Worker : EventTarget {

undefined postMessage(any message, sequence<object> transfer);
undefined postMessage(any message, optional StructuredSerializeOptions options = {});
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
};

dictionary WorkerOptions {
Expand All @@ -2600,6 +2612,7 @@ dictionary WorkerOptions {
enum WorkerType { "classic", "module" };

Worker includes AbstractWorker;
Worker includes MessageEventTarget;

[Exposed=Window]
interface SharedWorker : EventTarget {
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/wpt/interfaces/invokers.tentative.idl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
interface mixin InvokerElement {
[CEReactions,Reflect=invoketarget] attribute Element? commandForElement;
[CEReactions,Reflect=invokeaction] attribute DOMString command;
interface mixin CommandElement {
[CEReactions,Reflect=commandfor] attribute Element? commandForElement;
[CEReactions,Reflect=command] attribute DOMString command;
};

interface CommandEvent : Event {
constructor(DOMString type, optional CommandEventInit eventInitDict = {});
readonly attribute Element? invoker;
readonly attribute Element? source;
readonly attribute DOMString command;
};

dictionary CommandEventInit : EventInit {
Element? invoker = null;
Element? source = null;
DOMString command = "";
};
2 changes: 2 additions & 0 deletions test/fixtures/wpt/interfaces/long-animation-frames.idl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ interface PerformanceLongAnimationFrameTiming : PerformanceEntry {
[Default] object toJSON();
};

PerformanceLongAnimationFrameTiming includes PaintTimingMixin;

enum ScriptInvokerType {
"classic-script",
"module-script",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/mediasession.idl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface MediaMetadata {
attribute DOMString title;
attribute DOMString artist;
attribute DOMString album;
attribute FrozenArray<MediaImage> artwork;
attribute FrozenArray<object> artwork;
[SameObject] readonly attribute FrozenArray<ChapterInformation> chapterInfo;
};

Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/wpt/interfaces/paint-timing.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
// (https://github.com/w3c/webref)
// Source: Paint Timing (https://w3c.github.io/paint-timing/)

[Exposed=Window]
interface mixin PaintTimingMixin {
readonly attribute DOMHighResTimeStamp paintTime;
readonly attribute DOMHighResTimeStamp? presentationTime;
};

[Exposed=Window]
interface PerformancePaintTiming : PerformanceEntry {};
PerformancePaintTiming includes PaintTimingMixin;
Loading

0 comments on commit 55864c6

Please sign in to comment.