read-succeeds.https.window.js (705B)
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 descriptor's value.`; 8 9 bluetooth_bidi_test(async () => { 10 const {descriptor, fake_descriptor} = await getUserDescriptionDescriptor(); 11 12 const EXPECTED_VALUE = [0, 1, 2]; 13 await fake_descriptor.setNextReadResponse(GATT_SUCCESS, EXPECTED_VALUE); 14 15 const value = await descriptor.readValue(); 16 assert_array_equals(Array.from(new Uint8Array(value.buffer)), EXPECTED_VALUE); 17 }, test_desc);