Update web-platform-tests to revision 71e901cf4534417abfabe4d77a317817f5cc09db

This commit is contained in:
WPT Sync Bot 2019-01-03 20:37:31 -05:00
parent 7c34a70ca8
commit 0bc27d4696
48 changed files with 1125 additions and 147 deletions

View file

@ -261,6 +261,12 @@ function requestDeviceWithTrustedClick() {
() => navigator.bluetooth.requestDevice.apply(navigator.bluetooth, args));
}
// Calls requestLEScan() in a context that's 'allowed to show a popup'.
function requestLEScanWithTrustedClick() {
return callWithTrustedClick(
() => navigator.bluetooth.requestLEScan.apply(navigator.bluetooth));
}
// errorUUID(alias) returns a UUID with the top 32 bits of
// '00000000-97e5-4cd7-b9f1-f5a427670c59' replaced with the bits of |alias|.
// For example, errorUUID(0xDEADBEEF) returns

View file

@ -0,0 +1,42 @@
'use strict';
const company_id = '224';
const data = new TextEncoder().encode('foo');
const manufacturerDataMap = {[company_id]: data};
const health_uuid = health_thermometer.uuid;
const serviceDataMap = {[health_uuid]: data};
const scanRecord = {
name: 'Health Thermometer',
uuids: ['generic_access', health_uuid],
txPower: 20,
appearance: 100,
manufacturerData: manufacturerDataMap,
serviceData: serviceDataMap,
};
const scanResult = {
deviceAddress: '09:09:09:09:09:09',
rssi: 100,
scanRecord: scanRecord,
};
function verifyBluetoothAdvertisingEvent(e) {
assert_equals(e.constructor.name, 'BluetoothAdvertisingEvent')
assert_equals(e.device.name, scanRecord.name)
assert_equals(e.name, scanRecord.name)
assert_array_equals(e.uuids,
["00001800-0000-1000-8000-00805f9b34fb",
"00001809-0000-1000-8000-00805f9b34fb"])
assert_equals(e.txPower, 20)
assert_equals(e.rssi, 100)
assert_equals(e.manufacturerData.constructor.name,
'BluetoothManufacturerDataMap')
assert_equals(data[0], e.manufacturerData.get(224).getUint8(0))
assert_equals(data[1], e.manufacturerData.get(224).getUint8(1))
assert_equals(data[2], e.manufacturerData.get(224).getUint8(2))
assert_equals(e.serviceData.constructor.name, 'BluetoothServiceDataMap')
assert_equals(data[0], e.serviceData.get(health_uuid).getUint8(0))
assert_equals(data[1], e.serviceData.get(health_uuid).getUint8(1))
assert_equals(data[2], e.serviceData.get(health_uuid).getUint8(2))
}