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

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

Issue 2465363004: [Sensors] Consider maximum supported frequency (Closed)
Patch Set: Comments from Alex 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 4252de322b03d5a9cde97d13b5442a8196a44a5e..a46154911bc28ce566a51a1e1ecb7c1b8bfb263c 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_ = 60;
}
// 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_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_ = 60;
}
// 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;

Powered by Google App Engine
This is Rietveld 408576698