| 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 4252de322b03d5a9cde97d13b5442a8196a44a5e..002831c10bfeb90ff0cf6e0daad6b35b9b10322d 100644
|
| --- a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
|
| +++ b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
|
| @@ -195,6 +195,7 @@ function sensor_mocks(mojo) {
|
| this.get_sensor_should_fail_ = false;
|
| this.resolve_func_ = null;
|
| this.is_continuous_ = false;
|
| + this.max_frequency_ = 0;
|
| }
|
|
|
| // Returns initialized Sensor proxy to the client.
|
| @@ -231,7 +232,8 @@ function sensor_mocks(mojo) {
|
| { memory: rv.handle,
|
| buffer_offset: offset,
|
| mode: reporting_mode,
|
| - default_configuration: default_config });
|
| + default_configuration: default_config,
|
| + maximum_supported_frequency: this.max_frequency_});
|
|
|
| if (this.resolve_func_ !== null) {
|
| this.resolve_func_(this.active_sensor_);
|
| @@ -240,7 +242,6 @@ function sensor_mocks(mojo) {
|
| var client_handle = connection.bindProxy(proxy => {
|
| this.active_sensor_.client_ = proxy;
|
| }, sensor.SensorClient);
|
| -
|
| return getSensorResponse(init_params, client_handle);
|
| }
|
|
|
| @@ -261,6 +262,7 @@ function sensor_mocks(mojo) {
|
|
|
| this.get_sensor_should_fail_ = false;
|
| this.resolve_func_ = null;
|
| + this.max_frequency_ = 0;
|
| }
|
|
|
| // Sets flag that forces mock SensorProvider to fail when getSensor() is
|
| @@ -284,6 +286,11 @@ function sensor_mocks(mojo) {
|
| setContinuousReportingMode(reporting_mode) {
|
| this.is_continuous_ = reporting_mode;
|
| }
|
| +
|
| + // Sets the maximum frequency for a concrete sensor.
|
| + setMaximumSupportedFrequency(frequency) {
|
| + this.max_frequency_ = frequency;
|
| + }
|
| }
|
|
|
| let mockSensorProvider = new MockSensorProvider;
|
|
|