tor-browser

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

GeolocationSensor-disabled-by-feature-policy.https.html (893B)


      1 <!DOCTYPE html>
      2 <body>
      3 <title>GeolocationSensor Feature Policy Test: Disabled</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/feature-policy/resources/featurepolicy.js"></script>
      7 <script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script>
      8 <script>
      9 "use strict";
     10 
     11 run_fp_tests_disabled('GeolocationSensor');
     12 
     13 promise_test(async t => {
     14  await promise_rejects_dom(t, 'SecurityError', GeolocationSensor.read());
     15 }, "GeolocationSensor.read(): 'SecurityError' is thrown when disabled by Feature Policy");
     16 
     17 promise_test(async t => {
     18  const controller = new AbortController();
     19  const signal = controller.signal;
     20  controller.abort();
     21 
     22  await promise_rejects_dom(t, 'AbortError', GeolocationSensor.read({ signal }));
     23 }, "GeolocationSensor.read(): 'AbortError' takes priority");
     24 </script>
     25 </body>