mirror of
https://github.com/servo/servo.git
synced 2025-08-27 08:08:19 +01:00
Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee
This commit is contained in:
parent
c5f7c9ccf3
commit
e891345f26
1328 changed files with 36632 additions and 20588 deletions
|
@ -9,7 +9,7 @@
|
|||
const test_desc = 'A device disconnecting while connected should fire the ' +
|
||||
'gattserverdisconnected event.';
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(({device, fake_peripheral}) => {
|
||||
fake_peripheral.simulateGATTDisconnection();
|
||||
return eventPromise(device, 'gattserverdisconnected');
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
const test_desc = 'A device disconnecting after the BluetoothDevice object ' +
|
||||
'has been GC\'ed should not access freed memory.';
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(({fake_peripheral}) => {
|
||||
// 1. Disconnect.
|
||||
fake_peripheral.simulateGATTDisconnection();
|
||||
|
|
|
@ -12,7 +12,7 @@ const test_desc = 'If a site disconnects from a device while the platform is ' +
|
|||
let device, fake_peripheral;
|
||||
let num_events = 0;
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(_ => ({device, fake_peripheral} = _))
|
||||
// 1. Listen for disconnections.
|
||||
.then(() =>
|
||||
|
|
|
@ -10,7 +10,7 @@ let test_desc = 'A device that reconnects during the gattserverdisconnected ' +
|
|||
'event should still receive gattserverdisconnected events after ' +
|
||||
're-connection.';
|
||||
let device, fake_peripheral;
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(_ => ({device, fake_peripheral} = _))
|
||||
// 1. Disconnect.
|
||||
.then(() => new Promise(resolve => {
|
||||
|
|
|
@ -17,7 +17,7 @@ test(() => {
|
|||
|
||||
const test_desc_attr = 'BluetoothDevice attributes.';
|
||||
let device;
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(({device}) => {
|
||||
assert_equals(device.constructor.name, 'BluetoothDevice');
|
||||
var old_device_id = device.id;
|
||||
|
|
|
@ -14,7 +14,7 @@ const expected = new DOMException(
|
|||
'requestDevice() options. https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({acceptAllDevices: true})
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryServices(),
|
||||
expected)),
|
||||
|
|
|
@ -22,8 +22,6 @@ bluetooth_test(() => getDiscoveredHealthThermometerDevice({
|
|||
.then(() =>
|
||||
fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS}))
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() =>
|
||||
fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS}))
|
||||
.then(() => Promise.all([
|
||||
assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryService('human_interface_device'),
|
||||
|
|
|
@ -13,7 +13,7 @@ const cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
|
|||
'/bluetooth/resources/health-thermometer-iframe.html'
|
||||
let iframe = document.createElement('iframe');
|
||||
|
||||
bluetooth_test(() => setUpConnectableHealthThermometerDevice()
|
||||
bluetooth_test(() => setUpHealthThermometerDevice()
|
||||
// 1. Load the iframe.
|
||||
.then(() => new Promise(resolve => {
|
||||
iframe.src = cross_origin_src;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
'use strict';
|
||||
const test_desc = 'Discover a device using alias, name, or UUID.';
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
// Chrome will always close the previous chooser in the process of handling
|
||||
// a user gesture for the next request, so these need to be done
|
||||
// sequentially.
|
||||
|
|
|
@ -6,10 +6,7 @@
|
|||
<script src="/bluetooth/resources/bluetooth-helpers.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
const test_desc = 'Consumes a user gesture.';
|
||||
const expected = new DOMException(
|
||||
'Must be handling a user gesture to show a permission request.',
|
||||
'SecurityError');
|
||||
const test_desc = 'requestDevice calls do not consume user gestures.';
|
||||
|
||||
bluetooth_test(() => setUpHealthThermometerAndHeartRateDevices()
|
||||
.then(() => callWithTrustedClick(() => {
|
||||
|
@ -20,8 +17,8 @@ bluetooth_test(() => setUpHealthThermometerAndHeartRateDevices()
|
|||
return Promise.all([
|
||||
first.then(device => assert_equals(
|
||||
device.constructor.name, 'BluetoothDevice')),
|
||||
assert_promise_rejects_with_message(second,
|
||||
expected, 'A request should consume a user gesture')
|
||||
second.then(device => assert_equals(
|
||||
device.constructor.name, 'BluetoothDevice')),
|
||||
]);
|
||||
})), test_desc);
|
||||
</script>
|
|
@ -14,7 +14,7 @@ const expected = 'SecurityError: requestDevice() called from cross-origin ' +
|
|||
|
||||
let iframe = document.createElement('iframe');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
// 1. Load the iframe.
|
||||
.then(() => new Promise(resolve => {
|
||||
iframe.sandbox.add('allow-scripts');
|
||||
|
|
|
@ -66,7 +66,9 @@ function bluetooth_test(func, name, properties) {
|
|||
.then(() => promise_test(t => Promise.resolve()
|
||||
// Trigger Chromium-specific setup.
|
||||
.then(performChromiumSetup)
|
||||
.then(() => func(t)), name, properties));
|
||||
.then(() => func(t))
|
||||
.then(() => navigator.bluetooth.test.allResponsesConsumed())
|
||||
.then(consumed => assert_true(consumed)), name, properties));
|
||||
}
|
||||
|
||||
// HCI Error Codes. Used for simulateGATT[Dis]ConnectionResponse.
|
||||
|
@ -91,6 +93,8 @@ var request_disconnection_characteristic_uuid =
|
|||
"01d7d88a-7451-419f-aeb8-d65e7b9277af";
|
||||
// Descriptors:
|
||||
var blocklist_test_descriptor_uuid = "bad2ddcf-60db-45cd-bef9-fd72b153cf7c";
|
||||
var blocklist_exclude_reads_descriptor_uuid =
|
||||
"bad3ec61-3cc3-4954-9702-7977df514114";
|
||||
|
||||
// Sometimes we need to test that using either the name, alias, or UUID
|
||||
// produces the same result. The following objects help us do that.
|
||||
|
@ -465,6 +469,15 @@ function generateRequestDeviceArgsWithServices(services = ['heart_rate']) {
|
|||
}];
|
||||
}
|
||||
|
||||
// Causes |fake_peripheral| to disconnect and returns a promise that resolves
|
||||
// once `gattserverdisconnected` has been fired on |device|.
|
||||
function simulateGATTDisconnectionAndWait(device, fake_peripheral) {
|
||||
return Promise.all([
|
||||
eventPromise(device, 'gattserverdisconnected'),
|
||||
fake_peripheral.simulateGATTDisconnection(),
|
||||
]);
|
||||
}
|
||||
|
||||
// Simulates a pre-connected device with |address|, |name| and
|
||||
// |knownServiceUUIDs|.
|
||||
function setUpPreconnectedDevice({
|
||||
|
@ -674,6 +687,162 @@ function getConnectedHealthThermometerDevice(options) {
|
|||
.then(() => Object.assign({device}, fakes));
|
||||
}
|
||||
|
||||
// Returns an object containing a BluetoothDevice discovered using |options|,
|
||||
// its corresponding FakePeripheral and FakeRemoteGATTServices.
|
||||
// The simulated device is called 'Blocklist Device' and it has one known
|
||||
// service UUIDs |blocklist_test_service_uuid| which
|
||||
// correspond to a service with the same UUID. The
|
||||
// |blocklist_test_service_uuid| service contains two characteristics:
|
||||
// - |blocklist_exclude_reads_characteristic_uuid| (read, write)
|
||||
// - 'gap.peripheral_privacy_flag' (read, write)
|
||||
// The 'gap.peripheral_privacy_flag' characteristic contains three descriptors:
|
||||
// - |blocklist_test_descriptor_uuid|
|
||||
// - |blocklist_exclude_reads_descriptor_uuid|
|
||||
// - 'gatt.client_characteristic_configuration'
|
||||
// These are special UUIDs that have been added to the blocklist found at
|
||||
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
|
||||
// There are also test UUIDs that have been added to the test environment which
|
||||
// other implementations should add as test UUIDs as well.
|
||||
// The device has been connected to and its attributes are ready to be
|
||||
// discovered.
|
||||
function getBlocklistDevice(
|
||||
options = {filters: [{services: [blocklist_test_service_uuid]}]}) {
|
||||
let device, fake_peripheral, fake_blocklist_test_service,
|
||||
fake_blocklist_exclude_reads_characteristic,
|
||||
fake_blocklist_exclude_writes_characteristic,
|
||||
fake_blocklist_descriptor,
|
||||
fake_blocklist_exclude_reads_descriptor,
|
||||
fake_blocklist_exclude_writes_descriptor;
|
||||
return setUpPreconnectedDevice({
|
||||
address: '11:11:11:11:11:11',
|
||||
name: 'Blocklist Device',
|
||||
knownServiceUUIDs: ['generic_access', blocklist_test_service_uuid],
|
||||
})
|
||||
.then(_ => fake_peripheral = _)
|
||||
.then(() => requestDeviceWithTrustedClick(options))
|
||||
.then(_ => device = _)
|
||||
.then(() => fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: blocklist_test_service_uuid,
|
||||
}))
|
||||
.then(_ => fake_blocklist_test_service = _)
|
||||
.then(() => fake_blocklist_test_service.addFakeCharacteristic({
|
||||
uuid: blocklist_exclude_reads_characteristic_uuid,
|
||||
properties: ['read', 'write'],
|
||||
}))
|
||||
.then(_ => fake_blocklist_exclude_reads_characteristic = _)
|
||||
.then(() => fake_blocklist_test_service.addFakeCharacteristic({
|
||||
uuid: 'gap.peripheral_privacy_flag',
|
||||
properties: ['read', 'write'],
|
||||
}))
|
||||
.then(_ => fake_blocklist_exclude_writes_characteristic = _)
|
||||
.then(() => fake_blocklist_exclude_writes_characteristic
|
||||
.addFakeDescriptor({uuid: blocklist_test_descriptor_uuid}))
|
||||
.then(_ => fake_blocklist_descriptor = _)
|
||||
.then(() => fake_blocklist_exclude_writes_characteristic
|
||||
.addFakeDescriptor({uuid: blocklist_exclude_reads_descriptor_uuid}))
|
||||
.then(_ => fake_blocklist_exclude_reads_descriptor = _)
|
||||
.then(() => fake_blocklist_exclude_writes_characteristic
|
||||
.addFakeDescriptor({
|
||||
uuid: 'gatt.client_characteristic_configuration'
|
||||
}))
|
||||
.then(_ => fake_blocklist_exclude_writes_descriptor = _)
|
||||
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => ({
|
||||
device,
|
||||
fake_peripheral,
|
||||
fake_blocklist_test_service,
|
||||
fake_blocklist_exclude_reads_characteristic,
|
||||
fake_blocklist_exclude_writes_characteristic,
|
||||
fake_blocklist_descriptor,
|
||||
fake_blocklist_exclude_reads_descriptor,
|
||||
fake_blocklist_exclude_writes_descriptor,
|
||||
}));
|
||||
}
|
||||
|
||||
// Returns an object containing a Blocklist Test BluetoothRemoveGattService and
|
||||
// its corresponding FakeRemoteGATTService.
|
||||
function getBlocklistTestService() {
|
||||
let result;
|
||||
return getBlocklistDevice()
|
||||
.then(_ => result = _)
|
||||
.then(() =>
|
||||
result.device.gatt.getPrimaryService(blocklist_test_service_uuid))
|
||||
.then(service => Object.assign(result, {
|
||||
service,
|
||||
fake_service: result.fake_blocklist_test_service,
|
||||
}));
|
||||
}
|
||||
|
||||
// Returns an object containing a blocklisted BluetoothRemoteGATTCharacteristic
|
||||
// that excludes reads and its corresponding FakeRemoteGATTCharacteristic.
|
||||
function getBlocklistExcludeReadsCharacteristic() {
|
||||
let result, fake_characteristic;
|
||||
return getBlocklistTestService()
|
||||
.then(_ => result = _)
|
||||
.then(() => result.service.getCharacteristic(
|
||||
blocklist_exclude_reads_characteristic_uuid))
|
||||
.then(characteristic =>
|
||||
Object.assign(
|
||||
result, {
|
||||
characteristic,
|
||||
fake_characteristic:
|
||||
result.fake_blocklist_exclude_reads_characteristic
|
||||
}));
|
||||
}
|
||||
|
||||
// Returns an object containing a blocklisted BluetoothRemoteGATTCharacteristic
|
||||
// that excludes writes and its corresponding FakeRemoteGATTCharacteristic.
|
||||
function getBlocklistExcludeWritesCharacteristic() {
|
||||
let result, fake_characteristic;
|
||||
return getBlocklistTestService()
|
||||
.then(_ => result = _)
|
||||
.then(() => result.service.getCharacteristic(
|
||||
'gap.peripheral_privacy_flag'))
|
||||
.then(characteristic =>
|
||||
Object.assign(
|
||||
result, {
|
||||
characteristic,
|
||||
fake_characteristic:
|
||||
result.fake_blocklist_exclude_writes_characteristic
|
||||
}));
|
||||
}
|
||||
|
||||
// Returns an object containing a blocklisted BluetoothRemoteGATTDescriptor that
|
||||
// excludes reads and its corresponding FakeRemoteGATTDescriptor.
|
||||
function getBlocklistExcludeReadsDescriptor() {
|
||||
let result;
|
||||
return getBlocklistExcludeWritesCharacteristic()
|
||||
.then(_ => result = _)
|
||||
.then(() => result.characteristic.getDescriptor(
|
||||
blocklist_exclude_reads_descriptor_uuid))
|
||||
.then(descriptor => Object.assign(
|
||||
result, {
|
||||
descriptor,
|
||||
fake_descriptor: result.fake_blocklist_exclude_reads_descriptor
|
||||
}));
|
||||
}
|
||||
|
||||
// Returns an object containing a blocklisted BluetoothRemoteGATTDescriptor that
|
||||
// excludes writes and its corresponding FakeRemoteGATTDescriptor.
|
||||
function getBlocklistExcludeWritesDescriptor() {
|
||||
let result;
|
||||
return getBlocklistExcludeWritesCharacteristic()
|
||||
.then(_ => result = _)
|
||||
.then(() => result.characteristic.getDescriptor(
|
||||
'gatt.client_characteristic_configuration'))
|
||||
.then(descriptor => Object.assign(
|
||||
result, {
|
||||
descriptor: descriptor,
|
||||
fake_descriptor: result.fake_blocklist_exclude_writes_descriptor,
|
||||
}));
|
||||
}
|
||||
|
||||
// Returns the same device and fake peripheral as getHealthThermometerDevice()
|
||||
// after another frame (an iframe we insert) discovered the device,
|
||||
// connected to it and discovered its services.
|
||||
|
@ -768,42 +937,53 @@ function getEmptyHealthThermometerService(options) {
|
|||
// The primary service with 'device_information' UUID has a characteristics
|
||||
// with UUID 'serial_number_string'. The device has been connected to and its
|
||||
// attributes are ready to be discovered.
|
||||
// TODO(crbug.com/719816): Add descriptors.
|
||||
function getHIDDevice(options) {
|
||||
let device, fake_peripheral;
|
||||
return getConnectedHIDDevice(options)
|
||||
.then(_ => ({device, fake_peripheral} = _))
|
||||
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => ({device, fake_peripheral}));
|
||||
}
|
||||
|
||||
// Similar to getHealthThermometerDevice except the GATT discovery
|
||||
// response has not been set yet so more attributes can still be added.
|
||||
// TODO(crbug.com/719816): Add descriptors.
|
||||
function getConnectedHIDDevice(options) {
|
||||
let device, fake_peripheral;
|
||||
return setUpPreconnectedDevice({
|
||||
address: '10:10:10:10:10:10',
|
||||
name: 'HID Device',
|
||||
knownServiceUUIDs: [
|
||||
'generic_access',
|
||||
'device_information',
|
||||
'human_interface_device'
|
||||
'human_interface_device',
|
||||
],
|
||||
})
|
||||
.then(fake_peripheral => {
|
||||
return requestDeviceWithTrustedClick(options)
|
||||
.then(device => {
|
||||
return fake_peripheral
|
||||
.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS})
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'generic_access'}))
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'device_information'}))
|
||||
// Blocklisted Characteristic:
|
||||
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
|
||||
.then(dev_info => dev_info.addFakeCharacteristic({
|
||||
uuid: 'serial_number_string', properties: ['read']}))
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'human_interface_device'}))
|
||||
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS}))
|
||||
.then(() => ({
|
||||
device: device,
|
||||
fake_peripheral: fake_peripheral
|
||||
}));
|
||||
});
|
||||
});
|
||||
.then(_ => (fake_peripheral = _))
|
||||
.then(() => requestDeviceWithTrustedClick(options))
|
||||
.then(_ => (device = _))
|
||||
.then(() => fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'generic_access',
|
||||
}))
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'device_information',
|
||||
}))
|
||||
// Blocklisted Characteristic:
|
||||
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
|
||||
.then(dev_info => dev_info.addFakeCharacteristic({
|
||||
uuid: 'serial_number_string',
|
||||
properties: ['read'],
|
||||
}))
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'human_interface_device',
|
||||
}))
|
||||
.then(() => ({device, fake_peripheral}));
|
||||
}
|
||||
|
||||
// Similar to getHealthThermometerDevice() except the device
|
||||
|
|
|
@ -7,7 +7,7 @@ const expected = new DOMException(
|
|||
'NetworkError');
|
||||
let device;
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}],
|
||||
optionalServices: ['generic_access']
|
||||
})
|
||||
|
|
|
@ -11,7 +11,7 @@ const expected = new DOMException(
|
|||
" e.g. 'alert_notification'.",
|
||||
'TypeError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.CALLS([
|
||||
getPrimaryService('wrong_name')|
|
||||
|
|
|
@ -7,7 +7,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
})
|
||||
.then(({device}) => Promise.all([
|
||||
|
|
|
@ -7,7 +7,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({acceptAllDevices: true})
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.CALLS([
|
||||
getPrimaryService('heart_rate')|
|
||||
|
|
|
@ -6,7 +6,7 @@ const expected = new DOMException(
|
|||
'to \'optionalServices\' in requestDevice() options. https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
})
|
||||
.then(({device}) => Promise.all([
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'NetworkError');
|
||||
let device;
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}],
|
||||
optionalServices: ['generic_access']
|
||||
})
|
||||
|
|
|
@ -19,7 +19,7 @@ const expected = new DOMException(
|
|||
" e.g. 'alert_notification'.",
|
||||
'TypeError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryService('wrong_name'),
|
||||
expected,
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
})
|
||||
.then(({device}) => Promise.all([
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({acceptAllDevices: true})
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryService('heart_rate'),
|
||||
expected)),
|
||||
|
|
|
@ -14,7 +14,7 @@ const expected = new DOMException(
|
|||
'to \'optionalServices\' in requestDevice() options. https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
})
|
||||
.then(({device}) => Promise.all([
|
||||
|
|
|
@ -12,7 +12,7 @@ const expected = new DOMException(
|
|||
'UUID to \'optionalServices\' in requestDevice() options. ' +
|
||||
'https://goo.gl/HxfxSQ', 'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHIDDevice({
|
||||
bluetooth_test(() => getConnectedHIDDevice({
|
||||
filters: [{services: ['device_information']}],
|
||||
optionalServices: ['human_interface_device']
|
||||
})
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'NetworkError');
|
||||
let device;
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}],
|
||||
optionalServices: ['generic_access']
|
||||
})
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'NetworkError');
|
||||
let device;
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}],
|
||||
optionalServices: ['generic_access']
|
||||
})
|
||||
|
|
|
@ -19,7 +19,7 @@ const expected = new DOMException(
|
|||
" e.g. 'alert_notification'.",
|
||||
'TypeError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice()
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice()
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryServices('wrong_name'),
|
||||
expected,
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
})
|
||||
.then(({device}) => Promise.all([
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({acceptAllDevices: true})
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryServices('heart_rate'),
|
||||
expected)),
|
||||
|
|
|
@ -15,7 +15,7 @@ const expected = new DOMException(
|
|||
'https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({acceptAllDevices: true})
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
|
||||
.then(({device}) => assert_promise_rejects_with_message(
|
||||
device.gatt.getPrimaryServices(),
|
||||
expected)),
|
||||
|
|
|
@ -14,7 +14,7 @@ const expected = new DOMException(
|
|||
'to \'optionalServices\' in requestDevice() options. https://goo.gl/HxfxSQ',
|
||||
'SecurityError');
|
||||
|
||||
bluetooth_test(() => getHealthThermometerDevice({
|
||||
bluetooth_test(() => getConnectedHealthThermometerDevice({
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
})
|
||||
.then(({device}) => Promise.all([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue