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 |