Visitar URL original
chore: update WPT · nodejs/undici@1e0429d · GitHub
Skip to content

Commit 1e0429d

Browse files
Uzlopakgithub-actions[bot]
authored andcommitted
chore: update WPT
1 parent 608d5f6 commit 1e0429d

10 files changed

Lines changed: 243 additions & 21 deletions

File tree

test/fixtures/wpt/interfaces/command-and-commandfor.tentative.idl renamed to test/fixtures/wpt/interfaces/command-and-commandfor.idl

File renamed without changes.

‎test/fixtures/wpt/interfaces/fedcm.idl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dictionary IdentityCredentialDisconnectOptions : IdentityProviderConfig {
99

1010
[Exposed=Window, SecureContext]
1111
interface IdentityCredential : Credential {
12-
static Promise<undefined> disconnect(optional IdentityCredentialDisconnectOptions options = {});
12+
static Promise<undefined> disconnect(IdentityCredentialDisconnectOptions options);
1313
readonly attribute USVString? token;
1414
readonly attribute boolean isAutoSelected;
1515
};

‎test/fixtures/wpt/interfaces/gamepad-extensions.idl‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,10 @@ interface GamepadPose {
2222
readonly attribute Float32Array? angularAcceleration;
2323
};
2424

25-
[Exposed=Window, SecureContext]
26-
interface GamepadTouch {
27-
readonly attribute unsigned long touchId;
28-
readonly attribute octet surfaceId;
29-
readonly attribute Float32Array position;
30-
readonly attribute Uint32Array? surfaceDimensions;
31-
};
32-
3325
partial interface Gamepad {
3426
readonly attribute GamepadHand hand;
3527
readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators;
3628
readonly attribute GamepadPose? pose;
37-
readonly attribute FrozenArray<GamepadTouch>? touchEvents;
3829
};
3930

4031
[Exposed=Window]

‎test/fixtures/wpt/interfaces/gamepad.idl‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface Gamepad {
1212
readonly attribute GamepadMappingType mapping;
1313
readonly attribute FrozenArray<double> axes;
1414
readonly attribute FrozenArray<GamepadButton> buttons;
15+
readonly attribute FrozenArray<GamepadTouch> touches;
1516
[SameObject] readonly attribute GamepadHapticActuator vibrationActuator;
1617
};
1718

@@ -22,6 +23,13 @@ interface GamepadButton {
2223
readonly attribute double value;
2324
};
2425

26+
dictionary GamepadTouch {
27+
unsigned long touchId;
28+
octet surfaceId;
29+
DOMPointReadOnly position;
30+
DOMRectReadOnly? surfaceDimensions;
31+
};
32+
2533
enum GamepadMappingType {
2634
"",
2735
"standard",

‎test/fixtures/wpt/interfaces/media-capabilities.idl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dictionary MediaCapabilitiesInfo {
9090
};
9191

9292
dictionary MediaCapabilitiesDecodingInfo : MediaCapabilitiesInfo {
93-
required MediaKeySystemAccess keySystemAccess;
93+
required MediaKeySystemAccess? keySystemAccess;
9494
MediaDecodingConfiguration configuration;
9595
};
9696

‎test/fixtures/wpt/interfaces/mediacapture-surface-control.idl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
partial interface CaptureController {
77
sequence<long> getSupportedZoomLevels();
8-
long getZoomLevel();
8+
readonly attribute long? zoomLevel;
99
Promise<undefined> increaseZoomLevel();
1010
Promise<undefined> decreaseZoomLevel();
1111
Promise<undefined> resetZoomLevel();
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// GENERATED CONTENT - DO NOT EDIT
2+
// Content was automatically extracted by Reffy into webref
3+
// (https://github.com/w3c/webref)
4+
// Source: Privacy-Preserving Attribution: Level 1 (https://w3c.github.io/ppa/)
5+
6+
partial interface Navigator {
7+
[SecureContext, SameObject] readonly attribute PrivateAttribution privateAttribution;
8+
};
9+
10+
enum PrivateAttributionProtocol { "dap-12-histogram", "tee-00" };
11+
12+
dictionary PrivateAttributionAggregationService {
13+
required DOMString url;
14+
required DOMString protocol;
15+
};
16+
17+
[SecureContext, Exposed=Window]
18+
interface PrivateAttributionAggregationServices {
19+
readonly setlike<PrivateAttributionAggregationService>;
20+
};
21+
22+
[SecureContext, Exposed=Window]
23+
interface PrivateAttribution {
24+
readonly attribute PrivateAttributionAggregationServices aggregationServices;
25+
};
26+
27+
dictionary PrivateAttributionImpressionOptions {
28+
required unsigned long histogramIndex;
29+
required unsigned long filterData;
30+
required DOMString conversionSite;
31+
unsigned long lifetimeDays = 30;
32+
};
33+
34+
[SecureContext, Exposed=Window]
35+
partial interface PrivateAttribution {
36+
undefined saveImpression(PrivateAttributionImpressionOptions options);
37+
};
38+
39+
dictionary PrivateAttributionConversionOptions {
40+
required DOMString aggregationService;
41+
double epsilon = 1.0;
42+
43+
required unsigned long histogramSize;
44+
45+
PrivateAttributionLogic logic = "last-touch";
46+
unsigned long value = 1;
47+
unsigned long maxValue = 1;
48+
49+
unsigned long lookbackDays;
50+
unsigned long filterData;
51+
sequence<DOMString> impressionSites = [];
52+
sequence<DOMString> intermediarySites = [];
53+
};
54+
55+
dictionary PrivateAttributionConversionResult {
56+
required Uint8Array report;
57+
};
58+
59+
[SecureContext, Exposed=Window]
60+
partial interface PrivateAttribution {
61+
Promise<PrivateAttributionConversionResult> measureConversion(PrivateAttributionConversionOptions options);
62+
};
63+
64+
enum PrivateAttributionLogic {
65+
"last-touch",
66+
};

‎test/fixtures/wpt/interfaces/speech-api.idl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ interface SpeechRecognition : EventTarget {
1919
undefined start(MediaStreamTrack audioTrack);
2020
undefined stop();
2121
undefined abort();
22-
boolean onDeviceWebSpeechAvailable(DOMString lang);
23-
boolean installOnDeviceSpeechRecognition(DOMString lang);
22+
static Promise<boolean> availableOnDevice(DOMString lang);
23+
static Promise<boolean> installOnDevice(DOMString lang);
2424

2525
// event methods
2626
attribute EventHandler onaudiostart;

‎test/fixtures/wpt/interfaces/webnn.idl‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,13 @@ interface mixin NavigatorML {
99
Navigator includes NavigatorML;
1010
WorkerNavigator includes NavigatorML;
1111

12-
enum MLDeviceType {
13-
"cpu",
14-
"gpu",
15-
"npu"
16-
};
17-
1812
enum MLPowerPreference {
1913
"default",
2014
"high-performance",
2115
"low-power"
2216
};
2317

2418
dictionary MLContextOptions {
25-
MLDeviceType deviceType = "cpu";
2619
MLPowerPreference powerPreference = "default";
2720
};
2821

‎test/fixtures/wpt/resources/testdriver.js‎

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,42 @@
8282
* `bluetooth <https://webbluetoothcg.github.io/web-bluetooth>`_ module.
8383
*/
8484
bluetooth: {
85+
/**
86+
* Handle a bluetooth device prompt with the given params. Matches the
87+
* `bluetooth.handleRequestDevicePrompt
88+
* <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
89+
* WebDriver BiDi command.
90+
*
91+
* @example
92+
* await test_driver.bidi.bluetooth.handleRequestDevicePrompt({
93+
* prompt: "pmt-e0a234b",
94+
* accept: true,
95+
* device: "dvc-9b3b872"
96+
* });
97+
*
98+
* @param {object} params - Parameters for the command.
99+
* @param {string} params.prompt - The id of a bluetooth device prompt.
100+
* Matches the
101+
* `bluetooth.HandleRequestDevicePromptParameters:prompt <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
102+
* value.
103+
* @param {bool} params.accept - Whether to accept a bluetooth device prompt.
104+
* Matches the
105+
* `bluetooth.HandleRequestDevicePromptAcceptParameters:accept <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
106+
* value.
107+
* @param {string} params.device - The device id from a bluetooth device
108+
* prompt to be accepted. Matches the
109+
* `bluetooth.HandleRequestDevicePromptAcceptParameters:device <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_
110+
* value.
111+
* @param {Context} [params.context] The optional context parameter specifies in
112+
* which browsing context the bluetooth device prompt should be handled. If not
113+
* provided, the current browsing context is used.
114+
* @returns {Promise} fulfilled after the bluetooth device prompt
115+
* is handled, or rejected if the operation fails.
116+
*/
117+
handle_request_device_prompt: function(params) {
118+
return window.test_driver_internal.bidi.bluetooth
119+
.handle_request_device_prompt(params);
120+
},
85121
/**
86122
* Creates a simulated bluetooth adapter with the given params. Matches the
87123
* `bluetooth.simulateAdapter <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command>`_
@@ -105,6 +141,116 @@
105141
*/
106142
simulate_adapter: function (params) {
107143
return window.test_driver_internal.bidi.bluetooth.simulate_adapter(params);
144+
},
145+
/**
146+
* Creates a simulated bluetooth peripheral with the given params.
147+
* Matches the
148+
* `bluetooth.simulatePreconnectedPeripheral <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
149+
* WebDriver BiDi command.
150+
*
151+
* @example
152+
* await test_driver.bidi.bluetooth.simulatePreconnectedPeripheral({
153+
* "address": "09:09:09:09:09:09",
154+
* "name": "Some Device",
155+
* "manufacturerData": [{key: 17, data: "AP8BAX8="}],
156+
* "knownServiceUuids": [
157+
* "12345678-1234-5678-9abc-def123456789",
158+
* ],
159+
* });
160+
*
161+
* @param {object} params - Parameters for the command.
162+
* @param {string} params.address - The address of the simulated
163+
* bluetooth peripheral. Matches the
164+
* `bluetooth.SimulatePreconnectedPeripheralParameters:address <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
165+
* value.
166+
* @param {string} params.name - The name of the simulated bluetooth
167+
* peripheral. Matches the
168+
* `bluetooth.SimulatePreconnectedPeripheralParameters:name <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
169+
* value.
170+
* @param {Array.ManufacturerData} params.manufacturerData - The manufacturerData of the
171+
* simulated bluetooth peripheral. Matches the
172+
* `bluetooth.SimulatePreconnectedPeripheralParameters:manufacturerData <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
173+
* value.
174+
* @param {string} params.knownServiceUuids - The knownServiceUuids of
175+
* the simulated bluetooth peripheral. Matches the
176+
* `bluetooth.SimulatePreconnectedPeripheralParameters:knownServiceUuids <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_
177+
* value.
178+
* @param {Context} [params.context] The optional context parameter
179+
* specifies in which browsing context the simulated bluetooth peripheral should be
180+
* set. If not provided, the current browsing context is used.
181+
* @returns {Promise} fulfilled after the simulated bluetooth peripheral is created
182+
* and set, or rejected if the operation fails.
183+
*/
184+
simulate_preconnected_peripheral: function(params) {
185+
return window.test_driver_internal.bidi.bluetooth
186+
.simulate_preconnected_peripheral(params);
187+
},
188+
/**
189+
* `bluetooth.RequestDevicePromptUpdatedParameters <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-requestdevicepromptupdated-event>`_
190+
* event.
191+
*/
192+
request_device_prompt_updated: {
193+
/**
194+
* @typedef {object} RequestDevicePromptUpdated
195+
* `bluetooth.RequestDevicePromptUpdatedParameters <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-requestdevicepromptupdated-event>`_
196+
* event.
197+
*/
198+
199+
/**
200+
* Subscribes to the event. Events will be emitted only if
201+
* there is a subscription for the event. This method does
202+
* not add actual listeners. To listen to the event, use the
203+
* `on` or `once` methods. The buffered events will be
204+
* emitted before the command promise is resolved.
205+
*
206+
* @param {object} [params] Parameters for the subscription.
207+
* @param {null|Array.<(Context)>} [params.contexts] The
208+
* optional contexts parameter specifies which browsing
209+
* contexts to subscribe to the event on. It should be
210+
* either an array of Context objects, or null. If null, the
211+
* event will be subscribed to globally. If omitted, the
212+
* event will be subscribed to on the current browsing
213+
* context.
214+
* @returns {Promise<void>} Resolves when the subscription
215+
* is successfully done.
216+
*/
217+
subscribe: async function(params = {}) {
218+
assertBidiIsEnabled();
219+
return window.test_driver_internal.bidi.bluetooth
220+
.request_device_prompt_updated.subscribe(params);
221+
},
222+
/**
223+
* Adds an event listener for the event.
224+
*
225+
* @param {function(RequestDevicePromptUpdated): void} callback The
226+
* callback to be called when the event is emitted. The
227+
* callback is called with the event object as a parameter.
228+
* @returns {function(): void} A function that removes the
229+
* added event listener when called.
230+
*/
231+
on: function(callback) {
232+
assertBidiIsEnabled();
233+
return window.test_driver_internal.bidi.bluetooth
234+
.request_device_prompt_updated.on(callback);
235+
},
236+
/**
237+
* Adds an event listener for the event that is only called
238+
* once and removed afterward.
239+
*
240+
* @return {Promise<RequestDevicePromptUpdated>} The promise which
241+
* is resolved with the event object when the event is emitted.
242+
*/
243+
once: function() {
244+
assertBidiIsEnabled();
245+
return new Promise(resolve => {
246+
const remove_handler =
247+
window.test_driver_internal.bidi.bluetooth
248+
.request_device_prompt_updated.on(event => {
249+
resolve(event);
250+
remove_handler();
251+
});
252+
});
253+
},
108254
}
109255
},
110256
/**
@@ -1340,9 +1486,27 @@
13401486

13411487
bidi: {
13421488
bluetooth: {
1489+
handle_request_device_prompt: function() {
1490+
throw new Error(
1491+
'bidi.bluetooth.handle_request_device_prompt is not implemented by testdriver-vendor.js');
1492+
},
13431493
simulate_adapter: function () {
13441494
throw new Error(
13451495
"bidi.bluetooth.simulate_adapter is not implemented by testdriver-vendor.js");
1496+
},
1497+
simulate_preconnected_peripheral: function() {
1498+
throw new Error(
1499+
'bidi.bluetooth.simulate_preconnected_peripheral is not implemented by testdriver-vendor.js');
1500+
},
1501+
request_device_prompt_updated: {
1502+
async subscribe() {
1503+
throw new Error(
1504+
'bidi.bluetooth.request_device_prompt_updated.subscribe is not implemented by testdriver-vendor.js');
1505+
},
1506+
on() {
1507+
throw new Error(
1508+
'bidi.bluetooth.request_device_prompt_updated.on is not implemented by testdriver-vendor.js');
1509+
}
13461510
}
13471511
},
13481512
log: {

0 commit comments

Comments
 (0)