Add bluetooth idlharness test

This commit is contained in:
Attila Dusnoki 2017-01-17 15:12:23 +01:00
parent ef6656a727
commit c5dd88f015
3 changed files with 713 additions and 0 deletions

View file

@ -7508,6 +7508,12 @@
"url": "/_mozilla/mozilla/bluetooth/idl-BluetoothUUID.html"
}
],
"mozilla/bluetooth/interfaces.html": [
{
"path": "mozilla/bluetooth/interfaces.html",
"url": "/_mozilla/mozilla/bluetooth/interfaces.html"
}
],
"mozilla/bluetooth/readValue/characteristic/blocklisted-characteristic.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/blocklisted-characteristic.html",

View file

@ -0,0 +1,434 @@
[interfaces.html]
type: testharness
[Bluetooth interface: existence and properties of interface object]
expected: FAIL
[Bluetooth interface: existence and properties of interface prototype object]
expected: FAIL
[Bluetooth interface: operation getAvailability()]
expected: FAIL
[Bluetooth interface: attribute referringDevice]
expected: FAIL
[Bluetooth interface: operation requestDevice(RequestDeviceOptions)]
expected: FAIL
[Bluetooth interface: attribute ongattserverdisconnected]
expected: FAIL
[Bluetooth interface: attribute oncharacteristicvaluechanged]
expected: FAIL
[Bluetooth interface: attribute onserviceadded]
expected: FAIL
[Bluetooth interface: attribute onservicechanged]
expected: FAIL
[Bluetooth interface: attribute onserviceremoved]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "getAvailability" with the proper type (0)]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "referringDevice" with the proper type (2)]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "ongattserverdisconnected" with the proper type (4)]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "oncharacteristicvaluechanged" with the proper type (5)]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "onserviceadded" with the proper type (6)]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "onservicechanged" with the proper type (7)]
expected: FAIL
[Bluetooth interface: window.navigator.bluetooth must inherit property "onserviceremoved" with the proper type (8)]
expected: FAIL
[BluetoothPermissionResult interface: existence and properties of interface object]
expected: FAIL
[BluetoothPermissionResult interface object length]
expected: FAIL
[BluetoothPermissionResult interface object name]
expected: FAIL
[BluetoothPermissionResult interface: existence and properties of interface prototype object]
expected: FAIL
[BluetoothPermissionResult interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[BluetoothPermissionResult interface: attribute devices]
expected: FAIL
[ValueEvent interface: existence and properties of interface object]
expected: FAIL
[ValueEvent interface object length]
expected: FAIL
[ValueEvent interface object name]
expected: FAIL
[ValueEvent interface: existence and properties of interface prototype object]
expected: FAIL
[ValueEvent interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[ValueEvent interface: attribute value]
expected: FAIL
[BluetoothDevice interface: existence and properties of interface object]
expected: FAIL
[BluetoothDevice interface: existence and properties of interface prototype object]
expected: FAIL
[BluetoothDevice interface: operation watchAdvertisements()]
expected: FAIL
[BluetoothDevice interface: attribute oncharacteristicvaluechanged]
expected: FAIL
[BluetoothDevice interface: attribute onserviceadded]
expected: FAIL
[BluetoothDevice interface: attribute onservicechanged]
expected: FAIL
[BluetoothDevice interface: attribute onserviceremoved]
expected: FAIL
[BluetoothManufacturerDataMap interface: existence and properties of interface object]
expected: FAIL
[BluetoothManufacturerDataMap interface object length]
expected: FAIL
[BluetoothManufacturerDataMap interface object name]
expected: FAIL
[BluetoothManufacturerDataMap interface: existence and properties of interface prototype object]
expected: FAIL
[BluetoothManufacturerDataMap interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[BluetoothServiceDataMap interface: existence and properties of interface object]
expected: FAIL
[BluetoothServiceDataMap interface object length]
expected: FAIL
[BluetoothServiceDataMap interface object name]
expected: FAIL
[BluetoothServiceDataMap interface: existence and properties of interface prototype object]
expected: FAIL
[BluetoothServiceDataMap interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[BluetoothAdvertisingEvent interface: attribute uuids]
expected: FAIL
[BluetoothAdvertisingEvent interface: attribute manufacturerData]
expected: FAIL
[BluetoothAdvertisingEvent interface: attribute serviceData]
expected: FAIL
[BluetoothRemoteGATTServer interface: operation connect()]
expected: FAIL
[BluetoothRemoteGATTServer interface: operation getPrimaryService(BluetoothServiceUUID)]
expected: FAIL
[BluetoothRemoteGATTServer interface: operation getPrimaryServices(BluetoothServiceUUID)]
expected: FAIL
[BluetoothRemoteGATTService interface: existence and properties of interface object]
expected: FAIL
[BluetoothRemoteGATTService interface: existence and properties of interface prototype object]
expected: FAIL
[BluetoothRemoteGATTService interface: operation getCharacteristic(BluetoothCharacteristicUUID)]
expected: FAIL
[BluetoothRemoteGATTService interface: operation getCharacteristics(BluetoothCharacteristicUUID)]
expected: FAIL
[BluetoothRemoteGATTService interface: operation getIncludedService(BluetoothServiceUUID)]
expected: FAIL
[BluetoothRemoteGATTService interface: operation getIncludedServices(BluetoothServiceUUID)]
expected: FAIL
[BluetoothRemoteGATTService interface: attribute oncharacteristicvaluechanged]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: existence and properties of interface object]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: existence and properties of interface prototype object]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: operation getDescriptor(BluetoothDescriptorUUID)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: operation getDescriptors(BluetoothDescriptorUUID)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: operation readValue()]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: operation writeValue(BufferSource)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: operation startNotifications()]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: operation stopNotifications()]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: operation readValue()]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: operation writeValue(BufferSource)]
expected: FAIL
[BluetoothDevice must be primary interface of bluetooth_device]
expected: FAIL
[Stringification of bluetooth_device]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "id" with the proper type (0)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "name" with the proper type (1)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "gatt" with the proper type (2)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "watchAdvertisements" with the proper type (3)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "unwatchAdvertisements" with the proper type (4)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "watchingAdvertisements" with the proper type (5)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "ongattserverdisconnected" with the proper type (6)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "oncharacteristicvaluechanged" with the proper type (7)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "onserviceadded" with the proper type (8)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "onservicechanged" with the proper type (9)]
expected: FAIL
[BluetoothDevice interface: bluetooth_device must inherit property "onserviceremoved" with the proper type (10)]
expected: FAIL
[BluetoothRemoteGATTServer must be primary interface of bluetooth_server]
expected: FAIL
[Stringification of bluetooth_server]
expected: FAIL
[BluetoothRemoteGATTServer interface: bluetooth_server must inherit property "device" with the proper type (0)]
expected: FAIL
[BluetoothRemoteGATTServer interface: bluetooth_server must inherit property "connected" with the proper type (1)]
expected: FAIL
[BluetoothRemoteGATTServer interface: bluetooth_server must inherit property "connect" with the proper type (2)]
expected: FAIL
[BluetoothRemoteGATTServer interface: bluetooth_server must inherit property "disconnect" with the proper type (3)]
expected: FAIL
[BluetoothRemoteGATTServer interface: bluetooth_server must inherit property "getPrimaryService" with the proper type (4)]
expected: FAIL
[BluetoothRemoteGATTServer interface: calling getPrimaryService(BluetoothServiceUUID) on bluetooth_server with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTServer interface: bluetooth_server must inherit property "getPrimaryServices" with the proper type (5)]
expected: FAIL
[BluetoothRemoteGATTServer interface: calling getPrimaryServices(BluetoothServiceUUID) on bluetooth_server with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTService must be primary interface of bluetooth_service]
expected: FAIL
[Stringification of bluetooth_service]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "device" with the proper type (0)]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "uuid" with the proper type (1)]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "isPrimary" with the proper type (2)]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "getCharacteristic" with the proper type (3)]
expected: FAIL
[BluetoothRemoteGATTService interface: calling getCharacteristic(BluetoothCharacteristicUUID) on bluetooth_service with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "getCharacteristics" with the proper type (4)]
expected: FAIL
[BluetoothRemoteGATTService interface: calling getCharacteristics(BluetoothCharacteristicUUID) on bluetooth_service with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "getIncludedService" with the proper type (5)]
expected: FAIL
[BluetoothRemoteGATTService interface: calling getIncludedService(BluetoothServiceUUID) on bluetooth_service with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "getIncludedServices" with the proper type (6)]
expected: FAIL
[BluetoothRemoteGATTService interface: calling getIncludedServices(BluetoothServiceUUID) on bluetooth_service with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "oncharacteristicvaluechanged" with the proper type (7)]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "onserviceadded" with the proper type (8)]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "onservicechanged" with the proper type (9)]
expected: FAIL
[BluetoothRemoteGATTService interface: bluetooth_service must inherit property "onserviceremoved" with the proper type (10)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic must be primary interface of bluetooth_characteristic]
expected: FAIL
[Stringification of bluetooth_characteristic]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "service" with the proper type (0)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "uuid" with the proper type (1)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "properties" with the proper type (2)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "value" with the proper type (3)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "getDescriptor" with the proper type (4)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: calling getDescriptor(BluetoothDescriptorUUID) on bluetooth_characteristic with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "getDescriptors" with the proper type (5)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: calling getDescriptors(BluetoothDescriptorUUID) on bluetooth_characteristic with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "readValue" with the proper type (6)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "writeValue" with the proper type (7)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: calling writeValue(BufferSource) on bluetooth_characteristic with too few arguments must throw TypeError]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "startNotifications" with the proper type (8)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "stopNotifications" with the proper type (9)]
expected: FAIL
[BluetoothRemoteGATTCharacteristic interface: bluetooth_characteristic must inherit property "oncharacteristicvaluechanged" with the proper type (10)]
expected: FAIL
[BluetoothCharacteristicProperties must be primary interface of bluetooth_properties]
expected: FAIL
[Stringification of bluetooth_properties]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "broadcast" with the proper type (0)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "read" with the proper type (1)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "writeWithoutResponse" with the proper type (2)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "write" with the proper type (3)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "notify" with the proper type (4)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "indicate" with the proper type (5)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "authenticatedSignedWrites" with the proper type (6)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "reliableWrite" with the proper type (7)]
expected: FAIL
[BluetoothCharacteristicProperties interface: bluetooth_properties must inherit property "writableAuxiliaries" with the proper type (8)]
expected: FAIL
[BluetoothRemoteGATTDescriptor must be primary interface of bluetooth_descriptor]
expected: FAIL
[Stringification of bluetooth_descriptor]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: bluetooth_descriptor must inherit property "characteristic" with the proper type (0)]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: bluetooth_descriptor must inherit property "uuid" with the proper type (1)]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: bluetooth_descriptor must inherit property "value" with the proper type (2)]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: bluetooth_descriptor must inherit property "readValue" with the proper type (3)]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: bluetooth_descriptor must inherit property "writeValue" with the proper type (4)]
expected: FAIL
[BluetoothRemoteGATTDescriptor interface: calling writeValue(BufferSource) on bluetooth_descriptor with too few arguments must throw TypeError]
expected: FAIL

View file

@ -0,0 +1,273 @@
<!doctype html>
<meta charset="utf-8">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>
<script src="/_mozilla/mozilla/bluetooth/bluetooth-helpers.js"></script>
<h1>WebBluetooth IDL tests</h1>
<div id="log"></div>
<script id='untested_idl' type="text/plain">
interface EventHandler {
};
interface Navigator {
};
interface EventTarget {
};
interface Event {
};
interface BufferSource {
};
interface ArrayBufferView {
};
</script>
<script id='webbluetooth_idl' type="text/plain">
dictionary BluetoothDataFilterInit {
BufferSource dataPrefix;
BufferSource mask;
};
dictionary BluetoothLEScanFilterInit {
sequence<BluetoothServiceUUID> services;
DOMString name;
DOMString namePrefix;
// Maps unsigned shorts to BluetoothDataFilters.
object manufacturerData;
// Maps BluetoothServiceUUIDs to BluetoothDataFilters.
object serviceData;
};
dictionary RequestDeviceOptions {
sequence<BluetoothLEScanFilterInit> filters;
sequence<BluetoothServiceUUID> optionalServices = [];
boolean acceptAllDevices = false;
};
interface Bluetooth {
[SecureContext]
Promise<boolean> getAvailability();
[SecureContext]
attribute EventHandler onavailabilitychanged;
[SecureContext]
readonly attribute BluetoothDevice? referringDevice;
[SecureContext]
Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options);
};
Bluetooth implements EventTarget;
Bluetooth implements BluetoothDeviceEventHandlers;
Bluetooth implements CharacteristicEventHandlers;
Bluetooth implements ServiceEventHandlers;
dictionary BluetoothPermissionDescriptor : PermissionDescriptor {
DOMString deviceId;
// These match RequestDeviceOptions.
sequence<BluetoothLEScanFilterInit> filters;
sequence<BluetoothServiceUUID> optionalServices = [];
boolean acceptAllDevices = false;
};
dictionary AllowedBluetoothDevice {
required DOMString deviceId;
required boolean mayUseGATT;
// An allowedServices of "all" means all services are allowed.
required (DOMString or sequence<UUID>) allowedServices;
};
dictionary BluetoothPermissionData {
required sequence<AllowedBluetoothDevice> allowedDevices/* = []*/;
};
interface BluetoothPermissionResult : PermissionStatus {
attribute FrozenArray<BluetoothDevice> devices;
};
[Constructor(DOMString type, optional ValueEventInit initDict)]
interface ValueEvent : Event {
readonly attribute any value;
};
dictionary ValueEventInit : EventInit {
any value = null;
};
interface BluetoothDevice {
readonly attribute DOMString id;
readonly attribute DOMString? name;
readonly attribute BluetoothRemoteGATTServer? gatt;
Promise<void> watchAdvertisements();
void unwatchAdvertisements();
readonly attribute boolean watchingAdvertisements;
};
BluetoothDevice implements EventTarget;
BluetoothDevice implements BluetoothDeviceEventHandlers;
BluetoothDevice implements CharacteristicEventHandlers;
BluetoothDevice implements ServiceEventHandlers;
interface BluetoothManufacturerDataMap {
readonly maplike<unsigned short, DataView>;
};
interface BluetoothServiceDataMap {
readonly maplike<UUID, DataView>;
};
[Constructor(DOMString type, BluetoothAdvertisingEventInit init)]
interface BluetoothAdvertisingEvent : Event {
readonly attribute BluetoothDevice device;
readonly attribute FrozenArray<UUID> uuids;
readonly attribute DOMString? name;
readonly attribute unsigned short? appearance;
readonly attribute byte? txPower;
readonly attribute byte? rssi;
readonly attribute BluetoothManufacturerDataMap manufacturerData;
readonly attribute BluetoothServiceDataMap serviceData;
};
dictionary BluetoothAdvertisingEventInit : EventInit {
required BluetoothDevice device;
sequence<(DOMString or unsigned long)> uuids;
DOMString name;
unsigned short appearance;
byte txPower;
byte rssi;
Map manufacturerData;
Map serviceData;
};
interface BluetoothRemoteGATTServer {
readonly attribute BluetoothDevice device;
readonly attribute boolean connected;
Promise<BluetoothRemoteGATTServer> connect();
void disconnect();
Promise<BluetoothRemoteGATTService> getPrimaryService(BluetoothServiceUUID service);
Promise<sequence<BluetoothRemoteGATTService>>
getPrimaryServices(optional BluetoothServiceUUID service);
};
interface BluetoothRemoteGATTService {
readonly attribute BluetoothDevice device;
readonly attribute UUID uuid;
readonly attribute boolean isPrimary;
Promise<BluetoothRemoteGATTCharacteristic>
getCharacteristic(BluetoothCharacteristicUUID characteristic);
Promise<sequence<BluetoothRemoteGATTCharacteristic>>
getCharacteristics(optional BluetoothCharacteristicUUID characteristic);
Promise<BluetoothRemoteGATTService>
getIncludedService(BluetoothServiceUUID service);
Promise<sequence<BluetoothRemoteGATTService>>
getIncludedServices(optional BluetoothServiceUUID service);
};
BluetoothRemoteGATTService implements EventTarget;
BluetoothRemoteGATTService implements CharacteristicEventHandlers;
BluetoothRemoteGATTService implements ServiceEventHandlers;
interface BluetoothRemoteGATTCharacteristic {
readonly attribute BluetoothRemoteGATTService service;
readonly attribute UUID uuid;
readonly attribute BluetoothCharacteristicProperties properties;
readonly attribute DataView? value;
Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor);
Promise<sequence<BluetoothRemoteGATTDescriptor>>
getDescriptors(optional BluetoothDescriptorUUID descriptor);
Promise<DataView> readValue();
Promise<void> writeValue(BufferSource value);
Promise<BluetoothRemoteGATTCharacteristic> startNotifications();
Promise<BluetoothRemoteGATTCharacteristic> stopNotifications();
};
BluetoothRemoteGATTCharacteristic implements EventTarget;
BluetoothRemoteGATTCharacteristic implements CharacteristicEventHandlers;
interface BluetoothCharacteristicProperties {
readonly attribute boolean broadcast;
readonly attribute boolean read;
readonly attribute boolean writeWithoutResponse;
readonly attribute boolean write;
readonly attribute boolean notify;
readonly attribute boolean indicate;
readonly attribute boolean authenticatedSignedWrites;
readonly attribute boolean reliableWrite;
readonly attribute boolean writableAuxiliaries;
};
interface BluetoothRemoteGATTDescriptor {
readonly attribute BluetoothRemoteGATTCharacteristic characteristic;
readonly attribute UUID uuid;
readonly attribute DataView? value;
Promise<DataView> readValue();
Promise<void> writeValue(BufferSource value);
};
[NoInterfaceObject]
interface CharacteristicEventHandlers {
attribute EventHandler oncharacteristicvaluechanged;
};
[NoInterfaceObject]
interface BluetoothDeviceEventHandlers {
attribute EventHandler ongattserverdisconnected;
};
[NoInterfaceObject]
interface ServiceEventHandlers {
attribute EventHandler onserviceadded;
attribute EventHandler onservicechanged;
attribute EventHandler onserviceremoved;
};
typedef DOMString UUID;
interface BluetoothUUID {
static UUID getService((DOMString or unsigned long) name);
static UUID getCharacteristic((DOMString or unsigned long) name);
static UUID getDescriptor((DOMString or unsigned long) name);
static UUID canonicalUUID([EnforceRange] unsigned long alias);
};
typedef (DOMString or unsigned long) BluetoothServiceUUID;
typedef (DOMString or unsigned long) BluetoothCharacteristicUUID;
typedef (DOMString or unsigned long) BluetoothDescriptorUUID;
partial interface Navigator {
readonly attribute Bluetooth bluetooth;
};
</script>
<script>
'use strict';
var bluetooth_device, bluetooth_server, bluetooth_service, bluetooth_characteristic, bluetooth_properties, bluetooth_descriptor;
var idl_array;
setup(function() {
window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate);
window.navigator.bluetooth.requestDevice({
filters: [{services: [heart_rate.name]}],
optionalServices: [generic_access.name]
})
.then(device => bluetooth_device = device)
.then(() => bluetooth_device.gatt.connect())
.then(server => bluetooth_server = server)
.then(() => bluetooth_server.getPrimaryService(generic_access.name))
.then(service => bluetooth_service = service)
.then(() => bluetooth_service.getCharacteristic(device_name.name))
.then(characteristic => bluetooth_characteristic = characteristic)
.then(() => bluetooth_properties = bluetooth_characteristic.properties)
.then(() => bluetooth_characteristic.characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => bluetooth_descriptor = descriptor);
idl_array = new IdlArray();
idl_array.add_untested_idls(document.getElementById('untested_idl').textContent);
idl_array.add_idls(document.getElementById('webbluetooth_idl').textContent);
idl_array.add_objects({
Bluetooth: ['window.navigator.bluetooth'],
BluetoothDevice: ['bluetooth_device'],
BluetoothRemoteGATTServer: ['bluetooth_server'],
BluetoothRemoteGATTService: ['bluetooth_service'],
BluetoothRemoteGATTCharacteristic: ['bluetooth_characteristic'],
BluetoothCharacteristicProperties: ['bluetooth_properties'],
BluetoothRemoteGATTDescriptor: ['bluetooth_descriptor'],
});
});
idl_array.test();
</script>