tor-browser

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

adapter-absent-getAvailability.https.window.js (665B)


      1 // META: script=/resources/testdriver.js?feature=bidi
      2 // META: script=/resources/testdriver-vendor.js
      3 // META: script=/bluetooth/resources/bluetooth-test.js
      4 // META: script=/bluetooth/resources/bluetooth-fake-devices.js
      5 // META: timeout=long
      6 'use strict';
      7 const test_desc = 'getAvailability() resolves with false if the system does ' +
      8    'not have an adapter.';
      9 
     10 bluetooth_bidi_test(async () => {
     11  await navigator.bluetooth.test.simulateCentral({state: 'absent'});
     12  let availability = await navigator.bluetooth.getAvailability();
     13  assert_false(
     14      availability,
     15      'getAvailability() resolves promise with false when adapter is absent.');
     16 }, test_desc);