mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 02:40:22 -10:00
Automatic update from web-platform-tests [generic-sensor] Avoid unhandled promise rejection (#16414) By testing for a global binding via an unqualified IdentifierReference, the Generic Sensor utility file produces a rejected promise which is not handled. If testharness.js has not yet determined that testing is complete, this unhandled rejection will cause a harness-level error. Such errors will occur based on relative timing of asynchronous operations, and this has been observed to be unstable in Apple Safari as hosted on Azure Pipelines. Update the feature detection logic to avoid generating an unhandled rejection by instead referencing a property of the global object. Update the subsquent assertion to provide a more clear explanation of the failure which occurs in non-supporting browsers. -- wpt-commits: 4131304c0d6b6a94b6bc4c4c0c9818a66fe31c39 wpt-pr: 16414
The generic-sensor-tests.js tests require an implementation of
the GenericSensorTest interface, which should emulate platform
sensor backends. The GenericSensorTest interface is defined as:
class GenericSensorTest {
async initialize(); // Sets up the testing enviroment.
async reset(); // Frees the resources.
};
The Chromium implementation of the GenericSensorTest interface is located in
generic_sensor_mocks.js.
Other browser vendors should provide their own implementations of
the GenericSensorTest interface.
Known issue: a WebDriver extension is a better approach for the Generic Sensor tests automation.