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

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

Issue 2529343002: [sensors] Fix flakiness in generic sensors tests (Closed)
Patch Set: Fixes for review comments from Reilly 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..68b705aae59402569f31439fed20d031a3143666 100644
--- a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
+++ b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
@@ -53,7 +53,7 @@ function sensor_mocks(mojo) {
this.resetBuffer();
bindings.StubBindings(this.stub_).delegate = this;
bindings.StubBindings(this.stub_).connectionErrorHandler = () => {
- reset();
+ this.reset();
};
}
@@ -272,6 +272,9 @@ function sensor_mocks(mojo) {
this.stub_ = connection.bindHandleToStub(
pipe, sensor_provider.SensorProvider);
bindings.StubBindings(this.stub_).delegate = this;
+ bindings.StubBindings(this.stub_).connectionErrorHandler = () => {
+ this.reset();
+ };
}
// Mock functions
@@ -286,6 +289,8 @@ function sensor_mocks(mojo) {
this.get_sensor_should_fail_ = false;
this.resolve_func_ = null;
this.max_frequency_ = 60;
+ if (this.stub_)
+ bindings.StubBindings(this.stub_).close();
}
// Sets flag that forces mock SensorProvider to fail when getSensor() is

Powered by Google App Engine
This is Rietveld 408576698