Chromium Code Reviews| 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..8f2b091bafeb5d9ecd602e80357b655fcd00a276 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,9 @@ 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(); |
| + } |
|
Reilly Grant (use Gerrit)
2016/11/28 19:40:33
nit: unnecessary braces
shalamov
2016/11/29 09:02:23
Done.
|
| } |
| // Sets flag that forces mock SensorProvider to fail when getSensor() is |