From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../orientation-sensor/resources/sensor-data.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 testing/web-platform/tests/orientation-sensor/resources/sensor-data.js (limited to 'testing/web-platform/tests/orientation-sensor/resources/sensor-data.js') diff --git a/testing/web-platform/tests/orientation-sensor/resources/sensor-data.js b/testing/web-platform/tests/orientation-sensor/resources/sensor-data.js new file mode 100644 index 0000000000..a2886e7553 --- /dev/null +++ b/testing/web-platform/tests/orientation-sensor/resources/sensor-data.js @@ -0,0 +1,30 @@ +'use strict'; + +const kAbsoluteOrientationSensorData = { + sensorName: 'AbsoluteOrientationSensor', + permissionName: 'accelerometer', + testDriverName: 'absolute-orientation', + featurePolicyNames: ['accelerometer', 'gyroscope', 'magnetometer'] +}; + +const kRelativeOrientationSensorData = { + sensorName: 'RelativeOrientationSensor', + permissionName: 'accelerometer', + testDriverName: 'relative-orientation', + featurePolicyNames: ['accelerometer', 'gyroscope'] +}; + +const kOrientationReadings = { + // WebDriver input data must be given in Euler angles according to + // https://w3c.github.io/deviceorientation/#parse-orientation-data-reading-algorithm + // and converted to quaternions via + // https://w3c.github.io/orientation-sensor/#create-a-quaternion-from-euler-angles. + readings: [{alpha: 0, beta: -180, gamma: 0}], + expectedReadings: [{quaternion: [-1, 0, 0, 0]}], + expectedRemappedReadings: [{quaternion: [0.70710678, -0.70710678, 0, 0]}] +}; + +const kRotationMatrix = [1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1]; -- cgit v1.2.3