Automatic update from web-platform-tests
sensors: Convert existing Generic Sensor web tests to test_driver (#41410)
All Generic Sensor web tests are now using virtual sensors and their
implementation in WPT's testdriver.js and ChromeDriver/content_shell.
These tests no longer depend on generic_sensor_mocks.js (or Mojo mocks
in general), which has been kept only for the Device Orientation tests
at this point, and should be fully interoperable now. This also
exercises the code in //content and //services.
Compared to the JS mocks-based implementation, one of the biggest
changes is that there is no equivalent to a MockSensor that takes an
array of readings and periodically rotates and reports them to
consumers. This was an implementation detail that was kind of hard to
justify in spec terms, and the interaction between the JS timer and the
C++ code in services could lead to races between shared buffer values
and expected values (bug 1073865 is probably related, for example).
We now follow the new Automation section in the Generic Sensor spec and
explicitly require reading updates to be done via calls to
test_driver.update_virtual_sensor(). These calls might not result in a
change in readings if the sensor is not active or if the
threshold/rounding checks fail, so the tests are careful to check that a
reading has gone through when necessary. Furthermore, given how the code
in //services is implemented it is not possible to assert that a call to
update_virtual_sensor() will resolve _before_ a "reading" event is
emitted, so some Promise.all() calls are required.
The iframe tests have been essentially rewritten for clarity and to test
the right things:
* iframe_sensor_handler.html is used only by the cross-origin test. The
same-origin one simply creates the sensor in the test file directly.
* send_message_to_iframe() does not take a |reply| argument anymore.
Instead, it propagate the replies to the callers so they can do
whatever they need and we do not need to come up with values like
"success" in replies.
* The cross-origin and same-origin tests follow a workflow that is
easier to follow and mostly relies on timestamps that are part of the
public API to determine whether readings are being provided or not
depending on frame focus.
Now that the //content code is being exercised, the Ambient Light Sensor
and Magnetometer web tests need the GenericSensorExtraClasses feature to
be enabled, which is done by the newly-created
generic-sensor-extra-classes virtual test suite.
Finally, the referenceFrame test in generic-sensor-tests.js has been
disabled and a copy was added to wpt_internal, as there is no
cross-platform way to set an orientation angle and in wpt_internal it
can be set via Internals' setMockScreenOrientation().
Bug: 1278377, 1471996
Change-Id: Ie556c6d7bcfc0b2b84abc5f0770f6b3120ec81a2
Co-authored-by: Raphael Kubo da Costa <[email protected]>
--
wpt-commits: ea2a5d683d75e38809bbe9ec5fb238267054b747
wpt-pr: 41410
Automatic update from web-platform-tests
sensors: Convert existing Generic Sensor web tests to test_driver (#41410)
All Generic Sensor web tests are now using virtual sensors and their
implementation in WPT's testdriver.js and ChromeDriver/content_shell.
These tests no longer depend on generic_sensor_mocks.js (or Mojo mocks
in general), which has been kept only for the Device Orientation tests
at this point, and should be fully interoperable now. This also
exercises the code in //content and //services.
Compared to the JS mocks-based implementation, one of the biggest
changes is that there is no equivalent to a MockSensor that takes an
array of readings and periodically rotates and reports them to
consumers. This was an implementation detail that was kind of hard to
justify in spec terms, and the interaction between the JS timer and the
C++ code in services could lead to races between shared buffer values
and expected values (bug 1073865 is probably related, for example).
We now follow the new Automation section in the Generic Sensor spec and
explicitly require reading updates to be done via calls to
test_driver.update_virtual_sensor(). These calls might not result in a
change in readings if the sensor is not active or if the
threshold/rounding checks fail, so the tests are careful to check that a
reading has gone through when necessary. Furthermore, given how the code
in //services is implemented it is not possible to assert that a call to
update_virtual_sensor() will resolve _before_ a "reading" event is
emitted, so some Promise.all() calls are required.
The iframe tests have been essentially rewritten for clarity and to test
the right things:
* iframe_sensor_handler.html is used only by the cross-origin test. The
same-origin one simply creates the sensor in the test file directly.
* send_message_to_iframe() does not take a |reply| argument anymore.
Instead, it propagate the replies to the callers so they can do
whatever they need and we do not need to come up with values like
"success" in replies.
* The cross-origin and same-origin tests follow a workflow that is
easier to follow and mostly relies on timestamps that are part of the
public API to determine whether readings are being provided or not
depending on frame focus.
Now that the //content code is being exercised, the Ambient Light Sensor
and Magnetometer web tests need the GenericSensorExtraClasses feature to
be enabled, which is done by the newly-created
generic-sensor-extra-classes virtual test suite.
Finally, the referenceFrame test in generic-sensor-tests.js has been
disabled and a copy was added to wpt_internal, as there is no
cross-platform way to set an orientation angle and in wpt_internal it
can be set via Internals' setMockScreenOrientation().
Bug: 1278377, 1471996
Change-Id: Ie556c6d7bcfc0b2b84abc5f0770f6b3120ec81a2
Co-authored-by: Raphael Kubo da Costa <[email protected]>
--
wpt-commits: ea2a5d683d75e38809bbe9ec5fb238267054b747
wpt-pr: 41410
Automatic update from web-platform-tests
sensors: Split accelerometer tests to avoid flake
The generic sensor test suite can take a long time. This change splits
the tests for the three accelerometer interfaces (Accelerometer,
GravitySensor and LinearAccelerationSensor) into separate test files to
avoid the likelihood that they time out.
Fixed: 833215
Change-Id: I406e71b9da08c36c3495de5029b322c9de039e63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3344186
Auto-Submit: Reilly Grant <[email protected]>
Reviewed-by: Hongchan Choi <[email protected]>
Commit-Queue: Hongchan Choi <[email protected]>
Cr-Commit-Position: refs/heads/main@{#952235}
--
wpt-commits: b53e0d432377bf15577a0c15af5978c9c3fe7305
wpt-pr: 32102
Automatic update from web-platform-tests
[sensor] Upstream sensor layout tests to wpt
Rewrote /external/wpt/resources/chromium/generic_sensor_mocks.js to align with
/http/tests/resources/sensor-helpers.js, but excluded those functions specific
for device orientation.
Merged tests from /sensor/resources/generic-sensor-tests.js to
/external/wpt/generic-sensor/generic-sensor-tests.js
Moved common utils into /external/wpt/generic-sensor/resources/generic-sensor-helpers.js
Merged tests from /sensor/*.html to corresponding test folders under /external/wpt/,
e.g. sensor/orientation-sensor.html -> external/wpt/orientation-sensor/OrientationSensor.https.html
Updated all sensor tests under external/wpt/ to adapt to sensor mojom mocks
Deleted folder web_tests/sensor/
Bug: 816462
Change-Id: I614ce82b7c90530b7a268d8f6a0f72cc96ea3d6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1770158
Commit-Queue: Wanming Lin <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Cr-Commit-Position: refs/heads/master@{#695905}
--
wpt-commits: db7bad01d261a21cb99405abb57f9dd7a421e147
wpt-pr: 18886
Automatic update from web-platform-tests
Add <meta name=timeout content=long> to WPT in SlowTests
This is the 2nd step in the process of banning external/wpt from
SlowTests. After cleaning up the wtp entries we're marking them as
slow by using wpt idioms, i.e.:
1) Add <meta name="timeout" content="long"> to .html files
2) Add // META: timeout=long to .js files
Bug: 765026
Change-Id: Iaf051104f419524916e19324996cc36ee37d5426
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497005
Commit-Queue: Sergio Villar <[email protected]>
Reviewed-by: Andy Paicu <[email protected]>
Reviewed-by: Robert Ma <[email protected]>
Cr-Commit-Position: refs/heads/master@{#643402}
--
wpt-commits: 7287608f90f6b9530635d10086fd2ab386faab38
wpt-pr: 15630
Automatic update from web-platform-tests
Add <meta name=timeout content=long> to WPT in SlowTests
This is the 2nd step in the process of banning external/wpt from
SlowTests. After cleaning up the wtp entries we're marking them as
slow by using wpt idioms, i.e.:
1) Add <meta name="timeout" content="long"> to .html files
2) Add // META: timeout=long to .js files
Bug: 765026
Change-Id: Iaf051104f419524916e19324996cc36ee37d5426
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497005
Commit-Queue: Sergio Villar <[email protected]>
Reviewed-by: Andy Paicu <[email protected]>
Reviewed-by: Robert Ma <[email protected]>
Cr-Commit-Position: refs/heads/master@{#643402}
--
wpt-commits: 7287608f90f6b9530635d10086fd2ab386faab38
wpt-pr: 15630
Automatic update from web-platform-testsEnable WPT tests for the Generic Sensor classes
This patch introduces mock implementations of the Sensor
and SensorProvider mojo interfaces to the WPT tests
for Chromium.
The ongoing WPT issue for the Generic Sensor tests automation:
https://github.com/w3c/web-platform-tests/issues/9686
Bug: 816462
Change-Id: I8e4880ee5269b07f0bf68a2752038e128d166c55
Reviewed-on: https://chromium-review.googlesource.com/980886
Reviewed-by: Mike West <[email protected]>
Reviewed-by: Philip Jägenstedt <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Reviewed-by: Alexander Shalamov <[email protected]>
Commit-Queue: Mikhail Pozdnyakov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#550586}
--
wpt-commits: b55a93ab1fa441d8998fcfb1173d00dab4b733c0
wpt-pr: 10198
Automatic update from web-platform-testsRename generic-sensor as sensors to align with specname (#9895)
* Rename generic-sensor.idl as sensors.idl to align with specname
* rename generic-sensor directory as sensors
wpt-commits: 857f5c373a8f6155b5a2c78b69800a00730dcb46
wpt-pr: 9895
wpt-commits: 857f5c373a8f6155b5a2c78b69800a00730dcb46
wpt-pr: 9895