| <!DOCTYPE html> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| <script src="../../../resources/bluetooth/web-bluetooth-test.js"></script> |
| <script src="../../../resources/mojo-helpers.js"></script> |
| <script> |
| 'use strict'; |
| promise_test(() => { |
| const EXPECTED_VALUE = [0, 1, 2]; |
| return getMeasurementIntervalCharacteristic() |
| .then(({characteristic, fake_characteristic}) => { |
| return fake_characteristic.setNextReadResponse( |
| GATT_SUCCESS, EXPECTED_VALUE) |
| .then(() => characteristic.readValue()) |
| .then(value => { |
| assert_array_equals(new Uint8Array(value.buffer), |
| EXPECTED_VALUE); |
| }); |
| }); |
| }, 'A read request succeeds and returns the characteristic\'s value.'); |
| </script> |