tor-browser

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

simulate_adapter.https.html (1454B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8"/>
      3 <title>TestDriver bidi.bluetooth.simulate_adapter method</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js?feature=bidi"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 
      9 <script>
     10    promise_test(async (t) => {
     11        await test_driver.bidi.bluetooth.simulate_adapter({
     12            state: "absent"
     13        });
     14 
     15        assert_equals(false, await navigator.bluetooth.getAvailability(),
     16            "Assert bluetooth is not available");
     17        await test_driver.bidi.bluetooth.disable_simulation();
     18    }, "simulate bluetooth adapter 'absent'");
     19 
     20    promise_test(async (t) => {
     21        await test_driver.bidi.bluetooth.simulate_adapter({
     22            state: "powered-off"
     23        });
     24 
     25        assert_equals(true, await navigator.bluetooth.getAvailability(),
     26            "Assert bluetooth available");
     27        await test_driver.bidi.bluetooth.disable_simulation();
     28    }, "simulate bluetooth adapter 'powered-off'");
     29 
     30    promise_test(async (t) => {
     31        await test_driver.bidi.bluetooth.simulate_adapter({
     32            state: "powered-on"
     33        });
     34 
     35        assert_equals(true, await navigator.bluetooth.getAvailability(),
     36            "Assert bluetooth available");
     37        await test_driver.bidi.bluetooth.disable_simulation();
     38    }, "simulate bluetooth adapter 'powered-on'");
     39 </script>