blob: 65f2b508b7b7553812d5b6a6c0222bf688881621 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../http/tests/resources/sensor-helpers.js"></script>
<script src="../resources/device-orientation-helpers.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/services/device/public/mojom/sensor_provider.mojom.js"></script>
<script>
'use strict';
sensor_test(async 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(device.mojom.SensorType.RELATIVE_ORIENTATION_EULER_ANGLES, true);
setMockOrientationData(sensorProvider, orientationData);
return waitForOrientation(orientationData);
}, 'Tests that deviceorientation falls back to using absolute orientation data if relative is unavailable.');
</script>
</body>
</html>