| 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 1e369ba2cf92c44da1e3bd3196f8d7eb22b07914..60c6775c03fd78b14f7e6301041ce5e33bd98c09 100644
|
| --- a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
|
| +++ b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
|
| @@ -217,6 +217,7 @@ function sensor_mocks(mojo) {
|
| this.get_sensor_should_fail_ = false;
|
| this.resolve_func_ = null;
|
| this.is_continuous_ = false;
|
| + this.max_frequency_ = 60;
|
| }
|
|
|
| // Returns initialized Sensor proxy to the client.
|
| @@ -253,7 +254,8 @@ function sensor_mocks(mojo) {
|
| { memory: rv.handle,
|
| buffer_offset: offset,
|
| mode: reporting_mode,
|
| - default_configuration: default_config });
|
| + default_configuration: default_config,
|
| + maximum_frequency: this.max_frequency_});
|
|
|
| if (this.resolve_func_ !== null) {
|
| this.resolve_func_(this.active_sensor_);
|
| @@ -262,7 +264,6 @@ function sensor_mocks(mojo) {
|
| var client_handle = connection.bindProxy(proxy => {
|
| this.active_sensor_.client_ = proxy;
|
| }, sensor.SensorClient);
|
| -
|
| return getSensorResponse(init_params, client_handle);
|
| }
|
|
|
| @@ -284,6 +285,7 @@ function sensor_mocks(mojo) {
|
|
|
| this.get_sensor_should_fail_ = false;
|
| this.resolve_func_ = null;
|
| + this.max_frequency_ = 60;
|
| }
|
|
|
| // Sets flag that forces mock SensorProvider to fail when getSensor() is
|
| @@ -307,6 +309,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;
|
|
|