diff options
Diffstat (limited to 'testing/web-platform/tests/orientation-event/motion/multiple-event-listeners.https.html')
-rw-r--r-- | testing/web-platform/tests/orientation-event/motion/multiple-event-listeners.https.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/orientation-event/motion/multiple-event-listeners.https.html b/testing/web-platform/tests/orientation-event/motion/multiple-event-listeners.https.html new file mode 100644 index 0000000000..f94c9d136e --- /dev/null +++ b/testing/web-platform/tests/orientation-event/motion/multiple-event-listeners.https.html @@ -0,0 +1,30 @@ +<!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, 'devicemotion'); + await helper.grantSensorsPermissions(); + await helper.initializeSensors(); + + const motionData1 = generateMotionData(1, 2, 3, + 4, 5, 6, + 7, 8, 9); + await helper.setData(motionData1); + await Promise.all([ + waitForEvent(getExpectedMotionEvent(motionData1)), + waitForEvent(getExpectedMotionEvent(motionData1)) + ]); + + const motionData2 = generateMotionData(11, 12, 13, + 14, 15, 16, + 17, 18, 19); + await helper.setData(motionData2); + await waitForEvent(getExpectedMotionEvent(motionData2)); +}, 'Tests using multiple event handlers for the Device Motion API.'); +</script> |