gen-disconnected-device-with-uuid.https.window.js (1020B)
1 // META: script=/resources/testdriver.js?feature=bidi 2 // META: script=/resources/testdriver-vendor.js 3 // META: script=/common/gc.js 4 // META: script=/bluetooth/resources/bluetooth-test.js 5 // META: script=/bluetooth/resources/bluetooth-fake-devices.js 6 // META: timeout=long 7 // Generated by 8 // //bluetooth/bidi/generate.py 9 'use strict'; 10 const test_desc = 'getPrimaryServices called before connecting. Reject with ' + 11 'NetworkError.'; 12 const expected = new DOMException( 13 'GATT Server is disconnected. Cannot retrieve services. (Re)connect ' + 14 'first with `device.gatt.connect`.', 15 'NetworkError'); 16 17 bluetooth_bidi_test( 18 () => getDiscoveredHealthThermometerDevice({ 19 filters: [{services: ['health_thermometer']}], 20 optionalServices: ['generic_access'] 21 }) 22 .then( 23 ({device}) => assert_promise_rejects_with_message( 24 device.gatt.getPrimaryServices('health_thermometer'), 25 expected)), 26 test_desc);