From 87d7ccf6b51c61a4f4a056f7c2cac78347618486 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 01:08:26 -0400 Subject: [PATCH] chore: update WPT (#3669) Co-authored-by: Uzlopak <5059100+Uzlopak@users.noreply.github.com> --- .../fixtures/wpt/interfaces/audio-session.idl | 24 ++-- .../wpt/interfaces/mediacapture-viewport.idl | 7 +- test/fixtures/wpt/interfaces/mediasession.idl | 11 +- test/fixtures/wpt/interfaces/observable.idl | 2 +- .../fixtures/wpt/interfaces/selection-api.idl | 6 +- .../wpt/interfaces/service-workers.idl | 1 + .../wpt/interfaces/shared-storage.idl | 1 + test/fixtures/wpt/interfaces/turtledove.idl | 12 +- test/fixtures/wpt/interfaces/webgpu.idl | 3 +- test/fixtures/wpt/interfaces/webnn.idl | 2 +- test/fixtures/wpt/interfaces/webrtc.idl | 2 +- .../chromium/mock-pressure-service.js | 131 ------------------ .../chromium/mock-pressure-service.js.headers | 1 - .../static-router-resource-timing.https.html | 10 +- 14 files changed, 40 insertions(+), 173 deletions(-) delete mode 100644 test/fixtures/wpt/resources/chromium/mock-pressure-service.js delete mode 100644 test/fixtures/wpt/resources/chromium/mock-pressure-service.js.headers diff --git a/test/fixtures/wpt/interfaces/audio-session.idl b/test/fixtures/wpt/interfaces/audio-session.idl index f542347c710..7fd75024ee8 100644 --- a/test/fixtures/wpt/interfaces/audio-session.idl +++ b/test/fixtures/wpt/interfaces/audio-session.idl @@ -3,10 +3,12 @@ // (https://github.com/w3c/webref) // Source: Audio Session (https://w3c.github.io/audio-session/) -enum AudioSessionState { - "inactive", - "active", - "interrupted" +[Exposed=Window] +interface AudioSession : EventTarget { + attribute AudioSessionType type; + + readonly attribute AudioSessionState state; + attribute EventHandler onstatechange; }; enum AudioSessionType { @@ -18,16 +20,14 @@ enum AudioSessionType { "play-and-record" }; +enum AudioSessionState { + "inactive", + "active", + "interrupted" +}; + [Exposed=Window] partial interface Navigator { // The default audio session that the user agent will use when media elements start/stop playing. readonly attribute AudioSession audioSession; }; - -[Exposed=Window] -interface AudioSession : EventTarget { - attribute AudioSessionType type; - - readonly attribute AudioSessionState state; - attribute EventHandler onstatechange; -}; diff --git a/test/fixtures/wpt/interfaces/mediacapture-viewport.idl b/test/fixtures/wpt/interfaces/mediacapture-viewport.idl index a9dcf74e17c..c4d1892b0b9 100644 --- a/test/fixtures/wpt/interfaces/mediacapture-viewport.idl +++ b/test/fixtures/wpt/interfaces/mediacapture-viewport.idl @@ -5,10 +5,5 @@ partial interface MediaDevices { Promise getViewportMedia( - optional ViewportMediaStreamConstraints constraints = {}); -}; - -dictionary ViewportMediaStreamConstraints { - (boolean or MediaTrackConstraints) video = true; - (boolean or MediaTrackConstraints) audio = false; + optional DisplayMediaStreamOptions options = {}); }; diff --git a/test/fixtures/wpt/interfaces/mediasession.idl b/test/fixtures/wpt/interfaces/mediasession.idl index 00bfe6ad216..5c6942be5a0 100644 --- a/test/fixtures/wpt/interfaces/mediasession.idl +++ b/test/fixtures/wpt/interfaces/mediasession.idl @@ -98,17 +98,8 @@ dictionary MediaPositionState { dictionary MediaSessionActionDetails { required MediaSessionAction action; -}; - -dictionary MediaSessionSeekActionDetails : MediaSessionActionDetails { double seekOffset; -}; - -dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails { - required double seekTime; + double seekTime; boolean fastSeek; -}; - -dictionary MediaSessionCaptureActionDetails : MediaSessionActionDetails { boolean isActivating; }; diff --git a/test/fixtures/wpt/interfaces/observable.idl b/test/fixtures/wpt/interfaces/observable.idl index b0f0949a23a..55bdbb21e41 100644 --- a/test/fixtures/wpt/interfaces/observable.idl +++ b/test/fixtures/wpt/interfaces/observable.idl @@ -81,7 +81,7 @@ interface Observable { Observable drop(unsigned long long amount); Observable flatMap(Mapper mapper); Observable switchMap(Mapper mapper); - Observable inspect(optional ObservableInspectorUnion inspect_observer = {}); + Observable inspect(optional ObservableInspectorUnion inspectorUnion = {}); Observable catch(CatchCallback callback); Observable finally(VoidFunction callback); diff --git a/test/fixtures/wpt/interfaces/selection-api.idl b/test/fixtures/wpt/interfaces/selection-api.idl index a84536ab0f5..49d718d0777 100644 --- a/test/fixtures/wpt/interfaces/selection-api.idl +++ b/test/fixtures/wpt/interfaces/selection-api.idl @@ -18,7 +18,7 @@ interface Selection { undefined removeRange(Range range); undefined removeAllRanges(); undefined empty(); - sequence getComposedRanges(ShadowRoot... shadowRoots); + sequence getComposedRanges(optional GetComposedRangesOptions options = {}); undefined collapse(Node? node, optional unsigned long offset = 0); undefined setPosition(Node? node, optional unsigned long offset = 0); undefined collapseToStart(); @@ -32,6 +32,10 @@ interface Selection { stringifier; }; +dictionary GetComposedRangesOptions { + sequence shadowRoots = []; +}; + partial interface Document { Selection? getSelection(); }; diff --git a/test/fixtures/wpt/interfaces/service-workers.idl b/test/fixtures/wpt/interfaces/service-workers.idl index 87d48398f72..d9ff2f651f8 100644 --- a/test/fixtures/wpt/interfaces/service-workers.idl +++ b/test/fixtures/wpt/interfaces/service-workers.idl @@ -167,6 +167,7 @@ dictionary ExtendableEventInit : EventInit { [Exposed=ServiceWorker] interface InstallEvent : ExtendableEvent { + constructor(DOMString type, optional ExtendableEventInit eventInitDict = {}); Promise addRoutes((RouterRule or sequence) rules); }; diff --git a/test/fixtures/wpt/interfaces/shared-storage.idl b/test/fixtures/wpt/interfaces/shared-storage.idl index 6f8e9270888..85906bedbcf 100644 --- a/test/fixtures/wpt/interfaces/shared-storage.idl +++ b/test/fixtures/wpt/interfaces/shared-storage.idl @@ -89,6 +89,7 @@ dictionary SharedStorageRunOperationMethodOptions { boolean resolveToConfig = false; boolean keepAlive = false; SharedStoragePrivateAggregationConfig privateAggregationConfig; + DOMString savedQuery; }; dictionary SharedStorageWorkletOptions : WorkletOptions { diff --git a/test/fixtures/wpt/interfaces/turtledove.idl b/test/fixtures/wpt/interfaces/turtledove.idl index 77360d0dd10..ff48d311914 100644 --- a/test/fixtures/wpt/interfaces/turtledove.idl +++ b/test/fixtures/wpt/interfaces/turtledove.idl @@ -128,14 +128,20 @@ partial interface Navigator { Promise getInterestGroupAdAuctionData(AdAuctionDataConfig config); }; +dictionary AdAuctionData { + required Uint8Array request; + required USVString requestId; +}; + dictionary AdAuctionDataConfig { required USVString seller; required USVString coordinatorOrigin; + unsigned long requestSize; + record perBuyerConfig; }; -dictionary AdAuctionData { - required Uint8Array request; - required USVString requestId; +dictionary AdAuctionDataBuyerConfig { + unsigned long targetSize; }; [SecureContext] diff --git a/test/fixtures/wpt/interfaces/webgpu.idl b/test/fixtures/wpt/interfaces/webgpu.idl index 74021895a8f..421685c7a8f 100644 --- a/test/fixtures/wpt/interfaces/webgpu.idl +++ b/test/fixtures/wpt/interfaces/webgpu.idl @@ -78,7 +78,7 @@ interface GPU { }; dictionary GPURequestAdapterOptions { - any featureLevel; + DOMString featureLevel; GPUPowerPreference powerPreference; boolean forceFallbackAdapter = false; }; @@ -1183,6 +1183,7 @@ interface GPUCanvasContext { undefined configure(GPUCanvasConfiguration configuration); undefined unconfigure(); + GPUCanvasConfiguration? getConfiguration(); GPUTexture getCurrentTexture(); }; diff --git a/test/fixtures/wpt/interfaces/webnn.idl b/test/fixtures/wpt/interfaces/webnn.idl index 9a71f73954c..8329e7d2b33 100644 --- a/test/fixtures/wpt/interfaces/webnn.idl +++ b/test/fixtures/wpt/interfaces/webnn.idl @@ -90,7 +90,7 @@ enum MLOperandDataType { dictionary MLOperandDescriptor { required MLOperandDataType dataType; - sequence<[EnforceRange] unsigned long> shape = []; + required sequence<[EnforceRange] unsigned long> shape; }; [SecureContext, Exposed=(Window, DedicatedWorker)] diff --git a/test/fixtures/wpt/interfaces/webrtc.idl b/test/fixtures/wpt/interfaces/webrtc.idl index 32500f9a560..174ead6261c 100644 --- a/test/fixtures/wpt/interfaces/webrtc.idl +++ b/test/fixtures/wpt/interfaces/webrtc.idl @@ -503,7 +503,7 @@ enum RTCSctpTransportState { "closed" }; -[Exposed=Window] +[Exposed=(Window,DedicatedWorker), Transferable] interface RTCDataChannel : EventTarget { readonly attribute USVString label; readonly attribute boolean ordered; diff --git a/test/fixtures/wpt/resources/chromium/mock-pressure-service.js b/test/fixtures/wpt/resources/chromium/mock-pressure-service.js deleted file mode 100644 index 610d02a9164..00000000000 --- a/test/fixtures/wpt/resources/chromium/mock-pressure-service.js +++ /dev/null @@ -1,131 +0,0 @@ -import {PressureClientRemote, PressureManagerAddClientError} from "/gen/services/device/public/mojom/pressure_manager.mojom.m.js"; -import {PressureSource, PressureState} from '/gen/services/device/public/mojom/pressure_update.mojom.m.js' -import {WebPressureManager, WebPressureManagerReceiver} from '/gen/third_party/blink/public/mojom/compute_pressure/web_pressure_manager.mojom.m.js' - -class MockWebPressureService { - constructor() { - this.receiver_ = new WebPressureManagerReceiver(this); - this.interceptor_ = - new MojoInterfaceInterceptor(WebPressureManager.$interfaceName); - this.interceptor_.oninterfacerequest = e => { - this.receiver_.$.bindHandle(e.handle); - }; - this.reset(); - this.mojomSourceType_ = new Map([['cpu', PressureSource.kCpu]]); - this.mojomStateType_ = new Map([ - ['nominal', PressureState.kNominal], ['fair', PressureState.kFair], - ['serious', PressureState.kSerious], ['critical', PressureState.kCritical] - ]); - this.pressureServiceReadingTimerId_ = null; - } - - start() { - this.interceptor_.start(); - } - - stop() { - this.stopPlatformCollector(); - this.receiver_.$.close(); - this.interceptor_.stop(); - - // Wait for an event loop iteration to let any pending mojo commands in - // the pressure service finish. - return new Promise(resolve => setTimeout(resolve, 0)); - } - - reset() { - this.observers_ = []; - this.pressureUpdate_ = null; - this.pressureServiceReadingTimerId_ = null; - this.addClientError_ = null; - this.updatesDelivered_ = 0; - } - - async addClient(source) { - // TODO(crbug.com/1342184): Consider other sources. - // For now, "cpu" is the only source. - if (source !== PressureSource.kCpu) - throw new Error('Call addClient() with a wrong PressureSource'); - - if (this.addClientError_ !== null) { - return {result: {error: this.addClientError_}}; - } - - const pressureClientRemote = new PressureClientRemote(); - pressureClientRemote.onConnectionError.addListener(() => { - // Remove this observer from observer array. - this.observers_.splice(this.observers_.indexOf(pressureClientRemote), 1); - }); - const pendingReceiver = pressureClientRemote.$.bindNewPipeAndPassReceiver(); - this.observers_.push(pressureClientRemote); - - return {result: {pressureClient: pendingReceiver}}; - } - - startPlatformCollector(sampleInterval) { - if (sampleInterval === 0) - return; - - if (this.pressureServiceReadingTimerId_ != null) - this.stopPlatformCollector(); - - this.pressureServiceReadingTimerId_ = self.setInterval(() => { - if (this.pressureUpdate_ === null || this.observers_.length === 0) - return; - - // Because we cannot retrieve directly the timeOrigin internal in - // TimeTicks from Chromium, we need to create a timestamp that - // would help to test basic functionality. - // by multiplying performance.timeOrigin by 10 we make sure that the - // origin is higher than the internal time origin in TimeTicks. - // performance.now() allows us to have an increase matching the TimeTicks - // that would be read from the platform collector. - this.pressureUpdate_.timestamp = { - internalValue: - Math.round((performance.timeOrigin * 10) + performance.now()) * 1000 - }; - for (let observer of this.observers_) - observer.onPressureUpdated(this.pressureUpdate_); - this.updatesDelivered_++; - }, sampleInterval); - } - - stopPlatformCollector() { - if (this.pressureServiceReadingTimerId_ != null) { - self.clearInterval(this.pressureServiceReadingTimerId_); - this.pressureServiceReadingTimerId_ = null; - } - this.updatesDelivered_ = 0; - } - - updatesDelivered() { - return this.updatesDelivered_; - } - - setPressureUpdate(source, state) { - if (!this.mojomSourceType_.has(source)) - throw new Error(`PressureSource '${source}' is invalid`); - - if (!this.mojomStateType_.has(state)) - throw new Error(`PressureState '${state}' is invalid`); - - this.pressureUpdate_ = { - source: this.mojomSourceType_.get(source), - state: this.mojomStateType_.get(state), - }; - } - - setExpectedFailure(expectedException) { - assert_true( - expectedException instanceof DOMException, - 'setExpectedFailure() expects a DOMException instance'); - if (expectedException.name === 'NotSupportedError') { - this.addClientError_ = PressureManagerAddClientError.kNotSupported; - } else { - throw new TypeError( - `Unexpected DOMException '${expectedException.name}'`); - } - } -} - -export const mockPressureService = new MockWebPressureService(); diff --git a/test/fixtures/wpt/resources/chromium/mock-pressure-service.js.headers b/test/fixtures/wpt/resources/chromium/mock-pressure-service.js.headers deleted file mode 100644 index 6805c323df5..00000000000 --- a/test/fixtures/wpt/resources/chromium/mock-pressure-service.js.headers +++ /dev/null @@ -1 +0,0 @@ -Content-Type: text/javascript; charset=utf-8 diff --git a/test/fixtures/wpt/service-workers/service-worker/tentative/static-router/static-router-resource-timing.https.html b/test/fixtures/wpt/service-workers/service-worker/tentative/static-router/static-router-resource-timing.https.html index c85c5ea3b9a..74d84eb3c9f 100644 --- a/test/fixtures/wpt/service-workers/service-worker/tentative/static-router/static-router-resource-timing.https.html +++ b/test/fixtures/wpt/service-workers/service-worker/tentative/static-router/static-router-resource-timing.https.html @@ -47,8 +47,8 @@ assert_equals(entryList.length, 1, description); const entry = entryList[0]; - assert_equals(entry.matchedSourceType, options.matched_source_type, description); - assert_equals(entry.finalSourceType, options.final_source_type, description); + assert_equals(entry.workerMatchedSourceType, options.matched_source_type, description); + assert_equals(entry.workerFinalSourceType, options.final_source_type, description); assert_greater_than(entry.workerRouterEvaluationStart, 0, description); switch (entry.matchedSouceType) { @@ -60,8 +60,8 @@ case 'cache': assert_equals(entry.workerStart, 0, description); assert_greater_than_equal(entry.workerCacheLookupStart, entry.workerRouterEvaluationStart, description); - if (entry.finalSourceType === 'cache') { - assert_equals(entry.fetchStart, 0, description); + if (entry.workerFinalSourceType === 'cache') { + assert_equals(entry.fetchStart, entry.responseStart, description); assert_less_than_equal(entry.workerCacheLookupStart, entry.responseStart, description); } else { assert_less_than_equal(entry.workerCacheLookupStart, entry.fetchStart, description); @@ -69,7 +69,7 @@ break; case 'race-network-and-fetch': assert_equals(entry.workerCacheLookupStart, 0, description); - if (entry.finalSourceType === 'network') { + if (entry.workerFinalSourceType === 'network') { assert_equals(entry.workerStart, 0, description); assert_less_than_equal(entry.workerRouterEvaluationStart, entry.fetchStart, description); } else {