tor-browser

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

radio-not-present.https.window.js (814B)


      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 = 'Reject with NotFoundError if there is no BT radio present.';
      8 const expected =
      9    new DOMException('Bluetooth adapter not available.', 'NotFoundError');
     10 
     11 bluetooth_bidi_test(
     12    () => navigator.bluetooth.test.simulateCentral({state: 'absent'})
     13              .then(
     14                  () => assert_promise_rejects_with_message(
     15                      requestDeviceWithTrustedClick(
     16                          {filters: [{services: ['generic_access']}]}),
     17                      expected, 'Bluetooth adapter is not present.')),
     18    test_desc);