tor-browser

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

gen-garbage-collection-ran-during-success.https.window.js (1086B)


      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 =
     11    'Garbage Collection ran during a getPrimaryServices call that ' +
     12    'succeeds. Should not crash.';
     13 const expected = new DOMException(
     14    'GATT Server is disconnected. Cannot retrieve services. ' +
     15        '(Re)connect first with `device.gatt.connect`.',
     16    'NetworkError');
     17 let promise;
     18 
     19 bluetooth_bidi_test(
     20    () => getHealthThermometerDevice(
     21              {filters: [{services: ['health_thermometer']}]})
     22              .then(({device}) => {
     23                promise = assert_promise_rejects_with_message(
     24                    device.gatt.getPrimaryServices(), expected);
     25                device.gatt.disconnect();
     26                return garbageCollect();
     27              })
     28              .then(() => promise),
     29    test_desc);