Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensors: Stop using "reading" events to check if a sensor is suspended. #25534

Merged
merged 1 commit into from Sep 16, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 15, 2020

Tests using generic-sensor-iframe-tests.sub.js have been flaky on the
Mac bots for a long time. The flakiness is usually seen in the
same-origin iframe focus traversal test, where the "is_sensor_suspended"
command returns true rather than false.

The cause is the same one as r805674 ("sensors: Rewrite the frequency
hint test"): the mock platform sensor uses window.setInterval() to
simulate the periodic reading of sensor data, but setInterval()'s actual
frequency can vary a lot (especially on the Mac bots), to the point that
we cannot rely on the other timer we created in
iframe_sensor_handler.html will consistently have a period longer than
setInterval()'s.

The only way to reliably check if a sensor is suspended or not is to
query the mock platform sensor directly at the expense of no longer
using only the public API: we now have a isReadingData() method in
MockSensor that we use to query if the sensor is fetching new readings
or not.

Bug: 1073865
Change-Id: I99941b88722fc68163cca54e44ac6fc61a6425cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411933
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807421}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

Tests using generic-sensor-iframe-tests.sub.js have been flaky on the
Mac bots for a long time. The flakiness is usually seen in the
same-origin iframe focus traversal test, where the "is_sensor_suspended"
command returns true rather than false.

The cause is the same one as r805674 ("sensors: Rewrite the frequency
hint test"): the mock platform sensor uses window.setInterval() to
simulate the periodic reading of sensor data, but setInterval()'s actual
frequency can vary a lot (especially on the Mac bots), to the point that
we cannot rely on the other timer we created in
iframe_sensor_handler.html will consistently have a period longer than
setInterval()'s.

The only way to reliably check if a sensor is suspended or not is to
query the mock platform sensor directly at the expense of no longer
using only the public API: we now have a isReadingData() method in
MockSensor that we use to query if the sensor is fetching new readings
or not.

Bug: 1073865
Change-Id: I99941b88722fc68163cca54e44ac6fc61a6425cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411933
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807421}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants