Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information