blob: c9a50c17c9cd752e26bfb28f68fa00ceed8d9957 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/bluetooth/bluetooth-helpers.js"></script>
<script>
'use strict';
bluetooth_test(() => {
return getHIDDevice({
filters: [{services: ['device_information']}],
optionalServices: [
'generic_access',
'human_interface_device'
]})
.then(({device}) => device.gatt.getPrimaryServices())
.then(services => {
assert_equals(services.length, 2);
let uuid_set = new Set(services.map(s => s.uuid));
assert_equals(uuid_set.size, 2);
assert_true(uuid_set.has(BluetoothUUID.getService('generic_access')));
assert_true(uuid_set.has(BluetoothUUID.getService('device_information')));
assert_false(
uuid_set.has(BluetoothUUID.getService('human_interface_device')));
});
}, 'Request for services. Does not return blocklisted service.');
</script>