summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html
blob: 610b1b3c5643246ce8fcf004ddcb2e113aa8c761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="../resources/orientation-event-helpers.js"></script>
<script>
'use strict';

sensor_test(async (t, sensorProvider) => {
  const orientationData = generateOrientationData(1.1, 2.2, 3.3, true);

  // Make the relative orientation sensor unavailable and set mock data for
  // the absolute one.
  sensorProvider.setGetSensorShouldFail('RelativeOrientationEulerAngles', true);
  setMockOrientationData(sensorProvider, orientationData);
  return waitForEvent(getExpectedAbsoluteOrientationEvent(orientationData));
}, 'Tests that deviceorientation falls back to using absolute orientation data if relative is unavailable.');
</script>