blob: 935c0a107f8e1ed7832e0c6f9dab486928cc1f5f [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(() => {
const EXPECTED_VALUE = [0, 1, 2];
return getUserDescriptionDescriptor()
.then(({descriptor, fake_descriptor}) => {
return fake_descriptor.setNextReadResponse(GATT_SUCCESS, EXPECTED_VALUE)
.then(() => descriptor.readValue())
.then(value => {
assert_array_equals(Array.from(new Uint8Array(
value.buffer)), EXPECTED_VALUE);
});
});
}, 'A read request succeeds and returns the descriptor\'s value.');
</script>