read-succeeds.https.window.js (732B)
1 // META: script=/resources/testdriver.js?feature=bidi 2 // META: script=/resources/testdriver-vendor.js 3 // META: script=/bluetooth/resources/bluetooth-test.js 4 // META: script=/bluetooth/resources/bluetooth-fake-devices.js 5 // META: timeout=long 6 'use strict'; 7 const test_desc = 'A read request succeeds and returns the characteristic\'s ' + 8 'value.'; 9 const EXPECTED_VALUE = [0, 1, 2]; 10 11 bluetooth_bidi_test(async () => { 12 const {characteristic, fake_characteristic} = 13 await getMeasurementIntervalCharacteristic(); 14 await fake_characteristic.setNextReadResponse(GATT_SUCCESS, EXPECTED_VALUE); 15 const value = await characteristic.readValue(); 16 assert_array_equals(new Uint8Array(value.buffer), EXPECTED_VALUE) 17 }, test_desc);