tor-browser

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

garbage-collection-ran-during-success.js (952B)


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