<!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>
