diff --git a/testing/web-platform/tests/interfaces/web-bluetooth.idl b/testing/web-platform/tests/interfaces/web-bluetooth.idl index d372f0260eb4..00b93a551335 100644 --- a/testing/web-platform/tests/interfaces/web-bluetooth.idl +++ b/testing/web-platform/tests/interfaces/web-bluetooth.idl @@ -23,7 +23,7 @@ dictionary RequestDeviceOptions { boolean acceptAllDevices = false; }; -[SecureContext] +[Exposed=Window, SecureContext] interface Bluetooth : EventTarget { Promise getAvailability(); attribute EventHandler onavailabilitychanged; @@ -31,9 +31,9 @@ interface Bluetooth : EventTarget { readonly attribute BluetoothDevice? referringDevice; Promise requestDevice(optional RequestDeviceOptions options); }; -Bluetooth implements BluetoothDeviceEventHandlers; -Bluetooth implements CharacteristicEventHandlers; -Bluetooth implements ServiceEventHandlers; +Bluetooth includes BluetoothDeviceEventHandlers; +Bluetooth includes CharacteristicEventHandlers; +Bluetooth includes ServiceEventHandlers; dictionary BluetoothPermissionDescriptor : PermissionDescriptor { DOMString deviceId; @@ -53,11 +53,13 @@ dictionary BluetoothPermissionData { required sequence allowedDevices; }; +[Exposed=Window] interface BluetoothPermissionResult : PermissionStatus { attribute FrozenArray devices; }; [ + Exposed=Window, Constructor(DOMString type, optional ValueEventInit initDict), SecureContext ] @@ -69,8 +71,8 @@ dictionary ValueEventInit : EventInit { any value = null; }; -[SecureContext] -interface BluetoothDevice { +[Exposed=Window, SecureContext] +interface BluetoothDevice : EventTarget { readonly attribute DOMString id; readonly attribute DOMString? name; readonly attribute BluetoothRemoteGATTServer? gatt; @@ -79,20 +81,20 @@ interface BluetoothDevice { void unwatchAdvertisements(); readonly attribute boolean watchingAdvertisements; }; -BluetoothDevice implements EventTarget; -BluetoothDevice implements BluetoothDeviceEventHandlers; -BluetoothDevice implements CharacteristicEventHandlers; -BluetoothDevice implements ServiceEventHandlers; +BluetoothDevice includes BluetoothDeviceEventHandlers; +BluetoothDevice includes CharacteristicEventHandlers; +BluetoothDevice includes ServiceEventHandlers; -[SecureContext] +[Exposed=Window, SecureContext] interface BluetoothManufacturerDataMap { readonly maplike; }; -[SecureContext] +[Exposed=Window, SecureContext] interface BluetoothServiceDataMap { readonly maplike; }; [ + Exposed=Window, Constructor(DOMString type, BluetoothAdvertisingEventInit init), SecureContext ] @@ -116,11 +118,11 @@ dictionary BluetoothAdvertisingEventInit : EventInit { unsigned short appearance; byte txPower; byte rssi; - Map manufacturerData; - Map serviceData; + BluetoothManufacturerDataMap manufacturerData; + BluetoothServiceDataMap serviceData; }; -[SecureContext] +[Exposed=Window, SecureContext] interface BluetoothRemoteGATTServer { [SameObject] readonly attribute BluetoothDevice device; @@ -132,8 +134,8 @@ interface BluetoothRemoteGATTServer { getPrimaryServices(optional BluetoothServiceUUID service); }; -[SecureContext] -interface BluetoothRemoteGATTService { +[Exposed=Window, SecureContext] +interface BluetoothRemoteGATTService : EventTarget { [SameObject] readonly attribute BluetoothDevice device; readonly attribute UUID uuid; @@ -147,12 +149,11 @@ interface BluetoothRemoteGATTService { Promise> getIncludedServices(optional BluetoothServiceUUID service); }; -BluetoothRemoteGATTService implements EventTarget; -BluetoothRemoteGATTService implements CharacteristicEventHandlers; -BluetoothRemoteGATTService implements ServiceEventHandlers; +BluetoothRemoteGATTService includes CharacteristicEventHandlers; +BluetoothRemoteGATTService includes ServiceEventHandlers; -[SecureContext] -interface BluetoothRemoteGATTCharacteristic { +[Exposed=Window, SecureContext] +interface BluetoothRemoteGATTCharacteristic : EventTarget { [SameObject] readonly attribute BluetoothRemoteGATTService service; readonly attribute UUID uuid; @@ -166,10 +167,9 @@ interface BluetoothRemoteGATTCharacteristic { Promise startNotifications(); Promise stopNotifications(); }; -BluetoothRemoteGATTCharacteristic implements EventTarget; -BluetoothRemoteGATTCharacteristic implements CharacteristicEventHandlers; +BluetoothRemoteGATTCharacteristic includes CharacteristicEventHandlers; -[SecureContext] +[Exposed=Window, SecureContext] interface BluetoothCharacteristicProperties { readonly attribute boolean broadcast; readonly attribute boolean read; @@ -182,7 +182,7 @@ interface BluetoothCharacteristicProperties { readonly attribute boolean writableAuxiliaries; }; -[SecureContext] +[Exposed=Window, SecureContext] interface BluetoothRemoteGATTDescriptor { [SameObject] readonly attribute BluetoothRemoteGATTCharacteristic characteristic; @@ -192,24 +192,25 @@ interface BluetoothRemoteGATTDescriptor { Promise writeValue(BufferSource value); }; -[NoInterfaceObject, SecureContext] -interface CharacteristicEventHandlers { +[SecureContext] +interface mixin CharacteristicEventHandlers { attribute EventHandler oncharacteristicvaluechanged; }; -[NoInterfaceObject, SecureContext] -interface BluetoothDeviceEventHandlers { +[SecureContext] +interface mixin BluetoothDeviceEventHandlers { attribute EventHandler ongattserverdisconnected; }; -[NoInterfaceObject, SecureContext] -interface ServiceEventHandlers { +[SecureContext] +interface mixin ServiceEventHandlers { attribute EventHandler onserviceadded; attribute EventHandler onservicechanged; attribute EventHandler onserviceremoved; }; typedef DOMString UUID; +[Exposed=Window] interface BluetoothUUID { static UUID getService((DOMString or unsigned long) name); static UUID getCharacteristic((DOMString or unsigned long) name);