tor-browser

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

disconnect-called-during-success.js (843B)


      1 'use strict';
      2 const test_desc = 'disconnect() called during a FUNCTION_NAME call that ' +
      3    'succeeds. Reject with NetworkError.';
      4 const expected = new DOMException(
      5    'GATT Server is disconnected. Cannot retrieve services. (Re)connect ' +
      6        'first with `device.gatt.connect`.',
      7    'NetworkError');
      8 
      9 bluetooth_bidi_test(
     10    () => getHealthThermometerDevice({
     11            filters: [{services: ['health_thermometer']}],
     12            optionalServices: ['generic_access']
     13          }).then(({device}) => {
     14      let promise = assert_promise_rejects_with_message(
     15          device.gatt.CALLS(
     16              [getPrimaryService('health_thermometer') | getPrimaryServices() |
     17               getPrimaryServices('health_thermometer')[UUID]]),
     18          expected);
     19      device.gatt.disconnect();
     20      return promise;
     21    }),
     22    test_desc);