Bug 1876120 [wpt PR 44145] - sensors: Read Euler angles instead of quaternions from...
commitc2b9296e93abaaa3ee10eb5eaa6621a825d2c6d3
authorRaphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Thu, 25 Jan 2024 09:41:48 +0000 (25 09:41 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 26 Jan 2024 04:26:24 +0000 (26 04:26 +0000)
tree782e71c566fb60a76f2d63f0a84850632f2699f6
parentd3be8cee4072c8c701893abb01dadc0261c044f0
Bug 1876120 [wpt PR 44145] - sensors: Read Euler angles instead of quaternions from WebDriver, a=testonly

Automatic update from web-platform-tests
sensors: Read Euler angles instead of quaternions from WebDriver

As a result of https://github.com/w3c/deviceorientation/pull/124 and
https://github.com/w3c/orientation-sensor/pull/83.

The reading format is alpha-beta-gamma as described in the spec. They
are measured in degrees and must fall within certain ranges. Internally,
however, we always perform the Euler angles to quaternions conversion at
the edges (i.e. in ChromeDriver and the Internals implementation used by
content_shell), so that the the CDP and //services layers remain
unchanged and continue to support only quaternions and the
{ABSOLUTE,RELATIVE}_ORIENTATION_QUATERNION types for simplicity.

The code to convert Euler angles to quaternions was copied from
SensorInspectorAgent in Blink and is available for use by any callers
that need to validate Euler angles and convert them. The original code
remains in place because the entirety of the SensorInspectorAgent will
be removed soon due to the work on bug 1506995.

The test values for the orientation-sensor web tests had to be adapted:
we now provide the inputs as Euler angles. The expected values have
changed slightly as we had to find Euler _and_ quaternion values that
were easy enough to read.

Written in collaboration with Juha Vainio <juha.j.vainio@intel.com>

Bug: 150699515209121520919
Validate-Test-Flakiness: skip
Change-Id: I047f41f172f0bbcf30c7462926cec7ae0a66d4e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5229177
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Vladimir Nechaev <nechaev@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1251287}

--

wpt-commits: 95e6ad02194b81f525bdaa089f4574796a68d52d
wpt-pr: 44145
testing/web-platform/tests/orientation-sensor/resources/sensor-data.js