updates.https.html (1600B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testdriver.js"></script> 5 <script src="/resources/testdriver-vendor.js"></script> 6 <script src="../resources/orientation-event-helpers.js"></script> 7 <script> 8 'use strict'; 9 10 promise_test(async (t) => { 11 const helper = new SensorTestHelper(t, 'deviceorientation'); 12 await helper.grantSensorsPermissions(); 13 await helper.initializeSensors(); 14 15 const orientationData1 = generateOrientationData(1.1, 2.2, 3.3, false); 16 await helper.setData(orientationData1); 17 await waitForEvent(getExpectedOrientationEvent(orientationData1)); 18 19 const orientationData2 = generateOrientationData(11.1, 22.2, 33.3, false); 20 await helper.setData(orientationData2); 21 await waitForEvent(getExpectedOrientationEvent(orientationData2)); 22 }, 'Tests that updates to the relative orientation causes new events to fire.'); 23 24 promise_test(async (t) => { 25 const helper = new SensorTestHelper(t, 'deviceorientationabsolute'); 26 await helper.grantSensorsPermissions(); 27 await helper.initializeSensors(); 28 29 const orientationData1 = generateOrientationData(1.1, 2.2, 3.3, true); 30 await helper.setData(orientationData1); 31 await waitForEvent(getExpectedAbsoluteOrientationEvent(orientationData1)); 32 33 const orientationData2 = generateOrientationData(11.1, 22.2, 33.3, true); 34 await helper.setData(orientationData2); 35 await waitForEvent(getExpectedAbsoluteOrientationEvent(orientationData2)); 36 }, 'Tests that updates to the absolute orientation causes new events to fire.'); 37 </script>