Update web-platform-tests to revision 74bae78af4b95a2f0ca3a81df9c7fe3143f24bbc

This commit is contained in:
WPT Sync Bot 2019-01-17 20:37:38 -05:00
parent fb95f9df9c
commit 02c1eed999
150 changed files with 2395 additions and 829 deletions

View file

@ -9,8 +9,10 @@
const test_desc = 'Device with empty name and no UUIDs nearby. Should be ' +
'found if acceptAllDevices is true.';
bluetooth_test(() => setUpPreconnectedDevice({name: ''})
.then(() => requestDeviceWithTrustedClick({acceptAllDevices: true}))
.then(device => assert_equals(device.name, '')),
bluetooth_test(
() =>
setUpPreconnectedDevice({name: ''})
.then(() => requestDeviceWithTrustedClick({acceptAllDevices: true}))
.then(device => assert_equals(device.name, '')),
test_desc);
</script>

View file

@ -5,12 +5,15 @@
<script src="/resources/testdriver-vendor.js"></script>
<script src="/bluetooth/resources/bluetooth-helpers.js"></script>
<script>
const test_desc = 'A device with name and no UUIDs nearby. Should be found if ' +
'acceptAllDevices is true.';
const test_desc =
'A device with name and no UUIDs nearby. Should be found if ' +
'acceptAllDevices is true.';
const name = 'LE Device';
bluetooth_test(() => setUpPreconnectedDevice({name: name})
.then(() => requestDeviceWithTrustedClick({acceptAllDevices: true}))
.then(device => assert_equals(device.name, name)),
bluetooth_test(
() =>
setUpPreconnectedDevice({name: name})
.then(() => requestDeviceWithTrustedClick({acceptAllDevices: true}))
.then(device => assert_equals(device.name, name)),
test_desc);
</script>

View file

@ -10,13 +10,14 @@ const test_desc = 'requestDevice called with acceptAllDevices: true and ' +
'with no optionalServices. Should not get access to any services.';
const expected = new DOMException(
'Origin is not allowed to access any service. ' +
'Tip: Add the service UUID to \'optionalServices\' in ' +
'requestDevice() options. https://goo.gl/HxfxSQ',
'Tip: Add the service UUID to \'optionalServices\' in ' +
'requestDevice() options. https://goo.gl/HxfxSQ',
'SecurityError');
bluetooth_test(() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
.then(({device}) => assert_promise_rejects_with_message(
device.gatt.getPrimaryServices(),
expected)),
bluetooth_test(
() => getConnectedHealthThermometerDevice({acceptAllDevices: true})
.then(
({device}) => assert_promise_rejects_with_message(
device.gatt.getPrimaryServices(), expected)),
test_desc);
</script>

View file

@ -7,20 +7,23 @@
<script>
'use strict';
const test_desc = 'requestDevice called with acceptAllDevices: true and with ' +
'optionalServices. Should get access to services.';
'optionalServices. Should get access to services.';
bluetooth_test(() => getTwoHealthThermometerServicesDevice()
.then(() => requestDeviceWithTrustedClick({
acceptAllDevices: true,
optionalServices: ['health_thermometer']
}))
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryServices())
.then(services => {
assert_equals(services.length, 2);
services.forEach(service => {
assert_equals(service.uuid,
BluetoothUUID.getService('health_thermometer'));
});
}), test_desc);
bluetooth_test(
() => getTwoHealthThermometerServicesDevice()
.then(() => requestDeviceWithTrustedClick({
acceptAllDevices: true,
optionalServices: ['health_thermometer']
}))
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryServices())
.then(services => {
assert_equals(services.length, 2);
services.forEach(service => {
assert_equals(
service.uuid,
BluetoothUUID.getService('health_thermometer'));
});
}),
test_desc);
</script>