<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/_mozilla/bluetooth/bluetooth-helpers.js"></script>
<script>
'use strict';
promise_test(() => {
    window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate);
    return window.navigator.bluetooth.requestDevice({
        filters: [{services: [generic_access.name]}]
    })
    .then(device => device.gatt.connect())
    .then(gattServer => gattServer.getPrimaryService(generic_access.name))
    .then(service => service.getCharacteristic(device_name.name))
    .then(characteristic => characteristic.getDescriptors(number_of_digitals.name))
    .then(descriptors => Promise.all([
        descriptors[0].readValue(),
        descriptors[1].readValue()]))
    .then(value_arrays => assert_array_equals(value_arrays, ['1', '2']));
}, 'Find descriptors with UUID in service.');
</script>
