tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gen-service-is-removed.https.window.js (971B)


      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    () => getUserDescriptionDescriptor()
     17              .then(_ => ({descriptor, fake_peripheral, fake_service} = _))
     18              .then(() => fake_service.remove())
     19              .then(
     20                  () => assert_promise_rejects_with_message(
     21                      descriptor.writeValue(new ArrayBuffer(1 /* length */)),
     22                      expected, 'Service got removed.')),
     23    test_desc);