Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1836)

Unified Diff: third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js

Issue 2529343002: [sensors] Fix flakiness in generic sensors tests (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
diff --git a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
index 60c6775c03fd78b14f7e6301041ce5e33bd98c09..c8d92ff2577dafc21662bb3691d2ce6285aa60cf 100644
--- a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
+++ b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
@@ -276,6 +276,12 @@ function sensor_mocks(mojo) {
// Mock functions
+ // Resets mock sensor provider stub bindings.
+ resetSensorProvider() {
+ this.reset();
+ bindings.StubBindings(this.stub_).close();
+ }
+
// Resets state of mock SensorProvider between test runs.
reset() {
if (this.active_sensor_ != null) {
@@ -347,3 +353,10 @@ function sensor_test(func, name, properties) {
return Promise.resolve(func(sensor)).then(onSuccess, onFailure);
}), name, properties);
}
+
+function resetSensorProvider() {
+ sensor_test(sensor => {
+ sensor.mockSensorProvider.resetSensorProvider();
+ return Promise.resolve();
+ }, 'Reset sensor provider proxy.');
+}

Powered by Google App Engine
This is Rietveld 408576698