Skip to content

Commit c5a318e

Browse files
Uzlopakgithub-actions[bot]
authored andcommitted
chore: update WPT
1 parent a427e4b commit c5a318e

13 files changed

+390
-77
lines changed

test/fixtures/wpt/eventsource/META.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ suggested_reviewers:
33
- odinho
44
- Yaffle
55
- annevk
6+
- rexxars

test/fixtures/wpt/fetch/fetch-later/quota.tentative.https.window.js

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
'use strict';
66

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

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

3232
// Test various size of payloads for the same origin.
33-
for (const dataType in BeaconDataType) {
34-
if (dataType !== BeaconDataType.FormData &&
35-
dataType !== BeaconDataType.URLSearchParams) {
36-
// Skips FormData & URLSearchParams, as browser adds extra bytes to them
37-
// in addition to the user-provided content. It is difficult to test a
38-
// request right at the quota limit.
39-
fetchLaterPostTest(
40-
// Generates data that is exactly 64 kilobytes.
41-
makeBeaconData(generatePayload(kQuotaPerOrigin), dataType),
42-
`A single fetchLater() call takes up the per-origin quota for its ` +
43-
`body of ${dataType}.`);
44-
}
45-
}
33+
34+
// Test max possible size of payload.
35+
// Length of absolute URL to the endpoint.
36+
const POST_TEST_REQUEST_URL_SIZE = (ORIGIN + TEST_ENDPOINT).length;
37+
// Total size of the request header.
38+
const POST_TEST_REQUEST_HEADER_SIZE = 36;
39+
// Runs this test only for String type beacon, as browser adds extra bytes to
40+
// body for some other types (FormData & URLSearchParams), and the request
41+
// header sizes varies for every other types. It is difficult to test a request
42+
// right at the quota limit.
43+
fetchLaterPostTest(
44+
// Generates data that is exactly 64 kilobytes.
45+
makeBeaconData(
46+
generatePayload(
47+
QUOTA_PER_ORIGIN - POST_TEST_REQUEST_URL_SIZE -
48+
POST_TEST_REQUEST_HEADER_SIZE),
49+
BeaconDataType.String),
50+
`A single fetchLater() call takes up the per-origin quota for its ` +
51+
`body of String.`);
4652

4753
// Test empty payload.
4854
for (const dataType in BeaconDataType) {
@@ -64,8 +70,8 @@ for (const dataType in BeaconDataType) {
6470
() => fetchLater('/fetch-later', {
6571
method: 'POST',
6672
// Generates data that exceeds 64 kilobytes.
67-
body:
68-
makeBeaconData(generatePayload(kQuotaPerOrigin + 1), dataType)
73+
body: makeBeaconData(
74+
generatePayload(QUOTA_PER_ORIGIN + 1), dataType)
6975
}));
7076
},
7177
`A single fetchLater() call is not allowed to exceed per-origin quota ` +
@@ -81,7 +87,7 @@ for (const dataType in BeaconDataType) {
8187
fetchLater('/fetch-later', {
8288
method: 'POST',
8389
signal: controller.signal,
84-
body: makeBeaconData(generatePayload(kQuotaPerOrigin / 2), dataType)
90+
body: makeBeaconData(generatePayload(QUOTA_PER_ORIGIN / 2), dataType)
8591
});
8692

8793
// Makes the 2nd call that sends half+1 of allowed quota.
@@ -90,7 +96,7 @@ for (const dataType in BeaconDataType) {
9096
method: 'POST',
9197
signal: controller.signal,
9298
body: makeBeaconData(
93-
generatePayload(kQuotaPerOrigin / 2 + 1), dataType)
99+
generatePayload(QUOTA_PER_ORIGIN / 2 + 1), dataType)
94100
});
95101
});
96102
// Release quota taken by the pending requests for subsequent tests.
@@ -109,16 +115,16 @@ for (const dataType in BeaconDataType) {
109115
fetchLater('/fetch-later', {
110116
method: 'POST',
111117
signal: controller.signal,
112-
body: makeBeaconData(generatePayload(kQuotaPerOrigin / 2), dataType)
118+
body: makeBeaconData(generatePayload(QUOTA_PER_ORIGIN / 2), dataType)
113119
});
114120

115121
// Makes the 2nd call that sends half+1 of allowed quota, but to a
116122
// different origin.
117123
fetchLater(`${HTTPS_NOTSAMESITE_ORIGIN}/fetch-later`, {
118124
method: 'POST',
119125
signal: controller.signal,
120-
body:
121-
makeBeaconData(generatePayload(kQuotaPerOrigin / 2 + 1), dataType)
126+
body: makeBeaconData(
127+
generatePayload(QUOTA_PER_ORIGIN / 2 + 1), dataType)
122128
});
123129
// Release quota taken by the pending requests for subsequent tests.
124130
controller.abort();

test/fixtures/wpt/interfaces/fenced-frame.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ interface Fence {
7474
undefined reportEvent(optional ReportEventType event = {});
7575
undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event = {});
7676
sequence<FencedFrameConfig> getNestedConfigs();
77+
Promise<undefined> disableUntrustedNetwork();
7778
undefined notifyEvent(Event event);
7879
};
7980

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,12 @@
33
// (https://github.com/w3c/webref)
44
// Source: Paint Timing (https://w3c.github.io/paint-timing/)
55

6+
[Exposed=Window]
7+
interface mixin PaintTimingMixin {
8+
readonly attribute DOMHighResTimeStamp paintTime;
9+
readonly attribute DOMHighResTimeStamp? presentationTime;
10+
};
11+
612
[Exposed=Window]
713
interface PerformancePaintTiming : PerformanceEntry {};
14+
PerformancePaintTiming includes PaintTimingMixin;

test/fixtures/wpt/interfaces/shared-storage.idl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
typedef (USVString or FencedFrameConfig) SharedStorageResponse;
77

8-
enum SharedStorageDataOrigin { "context-origin", "script-origin" };
9-
108
[Exposed=(Window)]
119
interface SharedStorageWorklet : Worklet {
1210
Promise<SharedStorageResponse> selectURL(DOMString name,
@@ -25,6 +23,8 @@ interface SharedStorageWorkletGlobalScope : WorkletGlobalScope {
2523

2624
readonly attribute SharedStorage sharedStorage;
2725
readonly attribute PrivateAggregation privateAggregation;
26+
27+
Promise<sequence<StorageInterestGroup>> interestGroups();
2828
};
2929

3030
dictionary SharedStorageUrlWithMetadata {
@@ -93,7 +93,7 @@ dictionary SharedStorageRunOperationMethodOptions {
9393
};
9494

9595
dictionary SharedStorageWorkletOptions : WorkletOptions {
96-
SharedStorageDataOrigin dataOrigin = "context-origin";
96+
USVString dataOrigin = "context-origin";
9797
};
9898

9999
interface mixin HTMLSharedStorageWritableElementUtils {

test/fixtures/wpt/interfaces/webauthn.idl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ partial dictionary AuthenticationExtensionsClientInputs {
330330

331331
dictionary CredentialPropertiesOutput {
332332
boolean rk;
333-
DOMString authenticatorDisplayName;
334333
};
335334

336335
partial dictionary AuthenticationExtensionsClientOutputs {

test/fixtures/wpt/interfaces/webgpu.idl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ interface GPU {
7878
};
7979

8080
dictionary GPURequestAdapterOptions {
81-
DOMString featureLevel;
81+
DOMString featureLevel = "core";
8282
GPUPowerPreference powerPreference;
8383
boolean forceFallbackAdapter = false;
8484
};
@@ -128,6 +128,7 @@ enum GPUFeatureName {
128128
interface GPUDevice : EventTarget {
129129
[SameObject] readonly attribute GPUSupportedFeatures features;
130130
[SameObject] readonly attribute GPUSupportedLimits limits;
131+
[SameObject] readonly attribute GPUAdapterInfo adapterInfo;
131132

132133
[SameObject] readonly attribute GPUQueue queue;
133134

test/fixtures/wpt/interfaces/webrtc-stats.idl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ dictionary RTCInboundRtpStreamStats : RTCReceivedRtpStreamStats {
9696
unsigned long long retransmittedBytesReceived;
9797
unsigned long rtxSsrc;
9898
unsigned long fecSsrc;
99+
double totalCorruptionProbability;
100+
double totalSquaredCorruptionProbability;
101+
unsigned long long corruptionMeasurements;
99102
};
100103

101104
dictionary RTCRemoteInboundRtpStreamStats : RTCReceivedRtpStreamStats {

test/fixtures/wpt/resources/idlharness-shadowrealm.js

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* global shadowRealmEvalAsync */
2+
3+
// requires /resources/idlharness-shadowrealm-outer.js
4+
15
// TODO: it would be nice to support `idl_array.add_objects`
26
function fetch_text(url) {
37
return fetch(url).then(function (r) {
@@ -23,38 +27,25 @@ function fetch_text(url) {
2327
function idl_test_shadowrealm(srcs, deps) {
2428
promise_setup(async t => {
2529
const realm = new ShadowRealm();
26-
// https://github.com/web-platform-tests/wpt/issues/31996
27-
realm.evaluate("globalThis.self = globalThis; undefined;");
28-
29-
realm.evaluate(`
30-
globalThis.self.GLOBAL = {
31-
isWindow: function() { return false; },
32-
isWorker: function() { return false; },
33-
isShadowRealm: function() { return true; },
34-
}; undefined;
35-
`);
3630
const specs = await Promise.all(srcs.concat(deps).map(spec => {
3731
return fetch_text("/interfaces/" + spec + ".idl");
3832
}));
3933
const idls = JSON.stringify(specs);
40-
await new Promise(
41-
realm.evaluate(`(resolve,reject) => {
42-
(async () => {
43-
await import("/resources/testharness.js");
44-
await import("/resources/WebIDLParser.js");
45-
await import("/resources/idlharness.js");
46-
const idls = ${idls};
47-
const idl_array = new IdlArray();
48-
for (let i = 0; i < ${srcs.length}; i++) {
49-
idl_array.add_idls(idls[i]);
50-
}
51-
for (let i = ${srcs.length}; i < ${srcs.length + deps.length}; i++) {
52-
idl_array.add_dependency_idls(idls[i]);
53-
}
54-
idl_array.test();
55-
})().then(resolve, (e) => reject(e.toString()));
56-
}`)
57-
);
34+
await shadowRealmEvalAsync(realm, `
35+
await import("/resources/testharness-shadowrealm-inner.js");
36+
await import("/resources/testharness.js");
37+
await import("/resources/WebIDLParser.js");
38+
await import("/resources/idlharness.js");
39+
const idls = ${idls};
40+
const idl_array = new IdlArray();
41+
for (let i = 0; i < ${srcs.length}; i++) {
42+
idl_array.add_idls(idls[i]);
43+
}
44+
for (let i = ${srcs.length}; i < ${srcs.length + deps.length}; i++) {
45+
idl_array.add_dependency_idls(idls[i]);
46+
}
47+
idl_array.test();
48+
`);
5849
await fetch_tests_from_shadow_realm(realm);
5950
});
6051
}

0 commit comments

Comments
 (0)