tor-browser

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

absolute-fallback.https.html (1026B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/resources/testdriver.js"></script>
      5 <script src="/resources/testdriver-vendor.js"></script>
      6 <script src="../resources/orientation-event-helpers.js"></script>
      7 <script>
      8 'use strict';
      9 
     10 promise_test(async (t) => {
     11  const helper = new SensorTestHelper(t, 'deviceorientation');
     12  await helper.grantSensorsPermissions();
     13 
     14  // Make the relative orientation sensor unavailable and set mock data for
     15  // the absolute one.
     16  await helper.initializeSensors({enabledSensors: ['absolute-orientation'], disabledSensors: ['relative-orientation']});
     17  const orientationData = generateOrientationData(1.1, 2.2, 3.3, true);
     18 
     19  // Check sensor values when fallback is activated.
     20  await helper.setData(orientationData);
     21  await waitForEvent(getExpectedOrientationEvent(orientationData));
     22 }, 'Tests that deviceorientation falls back to using absolute orientation data if relative is unavailable.');
     23 </script>