summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html')
-rw-r--r--testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html b/testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html
new file mode 100644
index 0000000000..27a430728e
--- /dev/null
+++ b/testing/web-platform/tests/orientation-event/orientation/absolute-fallback.https.html
@@ -0,0 +1,23 @@
+<!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';
+
+promise_test(async (t) => {
+ const helper = new SensorTestHelper(t, 'deviceorientation');
+ await helper.grantSensorsPermissions();
+
+ // Make the relative orientation sensor unavailable and set mock data for
+ // the absolute one.
+ await helper.initializeSensors({enabledSensors: ['absolute-orientation'], disabledSensors: ['relative-orientation']});
+ const orientationData = generateOrientationData(1.1, 2.2, 3.3, true);
+
+ // Check sensor values when fallback is activated.
+ await helper.setData(orientationData);
+ await waitForEvent(getExpectedOrientationEvent(orientationData));
+}, 'Tests that deviceorientation falls back to using absolute orientation data if relative is unavailable.');
+</script>