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

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

Issue 2465363004: [Sensors] Consider maximum supported frequency (Closed)
Patch Set: Comment from Tim 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 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;

Powered by Google App Engine
This is Rietveld 408576698