Skip to content

Commit

Permalink
chore: update WPT
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored and github-actions[bot] committed Feb 21, 2025
1 parent 608d5f6 commit 1cbc0e5
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 36 deletions.
15 changes: 0 additions & 15 deletions test/fixtures/wpt/interfaces/command-and-commandfor.tentative.idl

This file was deleted.

2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/fedcm.idl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dictionary IdentityCredentialDisconnectOptions : IdentityProviderConfig {

[Exposed=Window, SecureContext]
interface IdentityCredential : Credential {
static Promise<undefined> disconnect(optional IdentityCredentialDisconnectOptions options = {});
static Promise<undefined> disconnect(IdentityCredentialDisconnectOptions options);
readonly attribute USVString? token;
readonly attribute boolean isAutoSelected;
};
Expand Down
9 changes: 0 additions & 9 deletions test/fixtures/wpt/interfaces/gamepad-extensions.idl
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,10 @@ interface GamepadPose {
readonly attribute Float32Array? angularAcceleration;
};

[Exposed=Window, SecureContext]
interface GamepadTouch {
readonly attribute unsigned long touchId;
readonly attribute octet surfaceId;
readonly attribute Float32Array position;
readonly attribute Uint32Array? surfaceDimensions;
};

partial interface Gamepad {
readonly attribute GamepadHand hand;
readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators;
readonly attribute GamepadPose? pose;
readonly attribute FrozenArray<GamepadTouch>? touchEvents;
};

[Exposed=Window]
Expand Down
8 changes: 8 additions & 0 deletions test/fixtures/wpt/interfaces/gamepad.idl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface Gamepad {
readonly attribute GamepadMappingType mapping;
readonly attribute FrozenArray<double> axes;
readonly attribute FrozenArray<GamepadButton> buttons;
readonly attribute FrozenArray<GamepadTouch> touches;
[SameObject] readonly attribute GamepadHapticActuator vibrationActuator;
};

Expand All @@ -22,6 +23,13 @@ interface GamepadButton {
readonly attribute double value;
};

dictionary GamepadTouch {
unsigned long touchId;
octet surfaceId;
DOMPointReadOnly position;
DOMRectReadOnly? surfaceDimensions;
};

enum GamepadMappingType {
"",
"standard",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/media-capabilities.idl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dictionary MediaCapabilitiesInfo {
};

dictionary MediaCapabilitiesDecodingInfo : MediaCapabilitiesInfo {
required MediaKeySystemAccess keySystemAccess;
required MediaKeySystemAccess? keySystemAccess;
MediaDecodingConfiguration configuration;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

partial interface CaptureController {
sequence<long> getSupportedZoomLevels();
long getZoomLevel();
readonly attribute long? zoomLevel;
Promise<undefined> increaseZoomLevel();
Promise<undefined> decreaseZoomLevel();
Promise<undefined> resetZoomLevel();
Expand Down
66 changes: 66 additions & 0 deletions test/fixtures/wpt/interfaces/ppa.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: Privacy-Preserving Attribution: Level 1 (https://w3c.github.io/ppa/)

partial interface Navigator {
[SecureContext, SameObject] readonly attribute PrivateAttribution privateAttribution;
};

enum PrivateAttributionProtocol { "dap-12-histogram", "tee-00" };

dictionary PrivateAttributionAggregationService {
required DOMString url;
required DOMString protocol;
};

[SecureContext, Exposed=Window]
interface PrivateAttributionAggregationServices {
readonly setlike<PrivateAttributionAggregationService>;
};

[SecureContext, Exposed=Window]
interface PrivateAttribution {
readonly attribute PrivateAttributionAggregationServices aggregationServices;
};

dictionary PrivateAttributionImpressionOptions {
required unsigned long histogramIndex;
required unsigned long filterData;
required DOMString conversionSite;
unsigned long lifetimeDays = 30;
};

[SecureContext, Exposed=Window]
partial interface PrivateAttribution {
undefined saveImpression(PrivateAttributionImpressionOptions options);
};

dictionary PrivateAttributionConversionOptions {
required DOMString aggregationService;
double epsilon = 1.0;

required unsigned long histogramSize;

PrivateAttributionLogic logic = "last-touch";
unsigned long value = 1;
unsigned long maxValue = 1;

unsigned long lookbackDays;
unsigned long filterData;
sequence<DOMString> impressionSites = [];
sequence<DOMString> intermediarySites = [];
};

dictionary PrivateAttributionConversionResult {
required Uint8Array report;
};

[SecureContext, Exposed=Window]
partial interface PrivateAttribution {
Promise<PrivateAttributionConversionResult> measureConversion(PrivateAttributionConversionOptions options);
};

enum PrivateAttributionLogic {
"last-touch",
};
4 changes: 2 additions & 2 deletions test/fixtures/wpt/interfaces/speech-api.idl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ interface SpeechRecognition : EventTarget {
undefined start(MediaStreamTrack audioTrack);
undefined stop();
undefined abort();
boolean onDeviceWebSpeechAvailable(DOMString lang);
boolean installOnDeviceSpeechRecognition(DOMString lang);
static Promise<boolean> availableOnDevice(DOMString lang);
static Promise<boolean> installOnDevice(DOMString lang);

// event methods
attribute EventHandler onaudiostart;
Expand Down
7 changes: 0 additions & 7 deletions test/fixtures/wpt/interfaces/webnn.idl
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ interface mixin NavigatorML {
Navigator includes NavigatorML;
WorkerNavigator includes NavigatorML;

enum MLDeviceType {
"cpu",
"gpu",
"npu"
};

enum MLPowerPreference {
"default",
"high-performance",
"low-power"
};

dictionary MLContextOptions {
MLDeviceType deviceType = "cpu";
MLPowerPreference powerPreference = "default";
};

Expand Down
164 changes: 164 additions & 0 deletions test/fixtures/wpt/resources/testdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,42 @@
* `bluetooth <https://webbluetoothcg.github.io/web-bluetooth>`_ module.
*/
bluetooth: {
/**
* Handle a bluetooth device prompt with the given params. Matches the
* `bluetooth.handleRequestDevicePrompt
* <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
* WebDriver BiDi command.
*
* @example
* await test_driver.bidi.bluetooth.handleRequestDevicePrompt({
* prompt: "pmt-e0a234b",
* accept: true,
* device: "dvc-9b3b872"
* });
*
* @param {object} params - Parameters for the command.
* @param {string} params.prompt - The id of a bluetooth device prompt.
* Matches the
* `bluetooth.HandleRequestDevicePromptParameters:prompt <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
* value.
* @param {bool} params.accept - Whether to accept a bluetooth device prompt.
* Matches the
* `bluetooth.HandleRequestDevicePromptAcceptParameters:accept <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
* value.
* @param {string} params.device - The device id from a bluetooth device
* prompt to be accepted. Matches the
* `bluetooth.HandleRequestDevicePromptAcceptParameters:device <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
* value.
* @param {Context} [params.context] The optional context parameter specifies in
* which browsing context the bluetooth device prompt should be handled. If not
* provided, the current browsing context is used.
* @returns {Promise} fulfilled after the bluetooth device prompt
* is handled, or rejected if the operation fails.
*/
handle_request_device_prompt: function(params) {
return window.test_driver_internal.bidi.bluetooth
.handle_request_device_prompt(params);
},
/**
* Creates a simulated bluetooth adapter with the given params. Matches the
* `bluetooth.simulateAdapter <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command>`_
Expand All @@ -105,6 +141,116 @@
*/
simulate_adapter: function (params) {
return window.test_driver_internal.bidi.bluetooth.simulate_adapter(params);
},
/**
* Creates a simulated bluetooth peripheral with the given params.
* Matches the
* `bluetooth.simulatePreconnectedPeripheral <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
* WebDriver BiDi command.
*
* @example
* await test_driver.bidi.bluetooth.simulatePreconnectedPeripheral({
* "address": "09:09:09:09:09:09",
* "name": "Some Device",
* "manufacturerData": [{key: 17, data: "AP8BAX8="}],
* "knownServiceUuids": [
* "12345678-1234-5678-9abc-def123456789",
* ],
* });
*
* @param {object} params - Parameters for the command.
* @param {string} params.address - The address of the simulated
* bluetooth peripheral. Matches the
* `bluetooth.SimulatePreconnectedPeripheralParameters:address <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
* value.
* @param {string} params.name - The name of the simulated bluetooth
* peripheral. Matches the
* `bluetooth.SimulatePreconnectedPeripheralParameters:name <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
* value.
* @param {Array.ManufacturerData} params.manufacturerData - The manufacturerData of the
* simulated bluetooth peripheral. Matches the
* `bluetooth.SimulatePreconnectedPeripheralParameters:manufacturerData <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
* value.
* @param {string} params.knownServiceUuids - The knownServiceUuids of
* the simulated bluetooth peripheral. Matches the
* `bluetooth.SimulatePreconnectedPeripheralParameters:knownServiceUuids <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
* value.
* @param {Context} [params.context] The optional context parameter
* specifies in which browsing context the simulated bluetooth peripheral should be
* set. If not provided, the current browsing context is used.
* @returns {Promise} fulfilled after the simulated bluetooth peripheral is created
* and set, or rejected if the operation fails.
*/
simulate_preconnected_peripheral: function(params) {
return window.test_driver_internal.bidi.bluetooth
.simulate_preconnected_peripheral(params);
},
/**
* `bluetooth.RequestDevicePromptUpdatedParameters <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-requestdevicepromptupdated-event>`_
* event.
*/
request_device_prompt_updated: {
/**
* @typedef {object} RequestDevicePromptUpdated
* `bluetooth.RequestDevicePromptUpdatedParameters <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-requestdevicepromptupdated-event>`_
* event.
*/

/**
* Subscribes to the event. Events will be emitted only if
* there is a subscription for the event. This method does
* not add actual listeners. To listen to the event, use the
* `on` or `once` methods. The buffered events will be
* emitted before the command promise is resolved.
*
* @param {object} [params] Parameters for the subscription.
* @param {null|Array.<(Context)>} [params.contexts] The
* optional contexts parameter specifies which browsing
* contexts to subscribe to the event on. It should be
* either an array of Context objects, or null. If null, the
* event will be subscribed to globally. If omitted, the
* event will be subscribed to on the current browsing
* context.
* @returns {Promise<void>} Resolves when the subscription
* is successfully done.
*/
subscribe: async function(params = {}) {
assertBidiIsEnabled();
return window.test_driver_internal.bidi.bluetooth
.request_device_prompt_updated.subscribe(params);
},
/**
* Adds an event listener for the event.
*
* @param {function(RequestDevicePromptUpdated): void} callback The
* callback to be called when the event is emitted. The
* callback is called with the event object as a parameter.
* @returns {function(): void} A function that removes the
* added event listener when called.
*/
on: function(callback) {
assertBidiIsEnabled();
return window.test_driver_internal.bidi.bluetooth
.request_device_prompt_updated.on(callback);
},
/**
* Adds an event listener for the event that is only called
* once and removed afterward.
*
* @return {Promise<RequestDevicePromptUpdated>} The promise which
* is resolved with the event object when the event is emitted.
*/
once: function() {
assertBidiIsEnabled();
return new Promise(resolve => {
const remove_handler =
window.test_driver_internal.bidi.bluetooth
.request_device_prompt_updated.on(event => {
resolve(event);
remove_handler();
});
});
},
}
},
/**
Expand Down Expand Up @@ -1340,9 +1486,27 @@

bidi: {
bluetooth: {
handle_request_device_prompt: function() {
throw new Error(
'bidi.bluetooth.handle_request_device_prompt is not implemented by testdriver-vendor.js');
},
simulate_adapter: function () {
throw new Error(
"bidi.bluetooth.simulate_adapter is not implemented by testdriver-vendor.js");
},
simulate_preconnected_peripheral: function() {
throw new Error(
'bidi.bluetooth.simulate_preconnected_peripheral is not implemented by testdriver-vendor.js');
},
request_device_prompt_updated: {
async subscribe() {
throw new Error(
'bidi.bluetooth.request_device_prompt_updated.subscribe is not implemented by testdriver-vendor.js');
},
on() {
throw new Error(
'bidi.bluetooth.request_device_prompt_updated.on is not implemented by testdriver-vendor.js');
}
}
},
log: {
Expand Down

0 comments on commit 1cbc0e5

Please sign in to comment.