gen-service-is-removed.https.window.js (915B)
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 = 'Service gets removed. Reject with InvalidStateError.'; 11 const expected = 12 new DOMException('GATT Service no longer exists.', 'InvalidStateError'); 13 let descriptor, fake_peripheral, fake_service; 14 15 bluetooth_bidi_test( 16 () => 17 getUserDescriptionDescriptor() 18 .then(_ => ({descriptor, fake_peripheral, fake_service} = _)) 19 .then(() => fake_service.remove()) 20 .then( 21 () => assert_promise_rejects_with_message( 22 descriptor.readValue(), expected, 'Service got removed.')), 23 test_desc);