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

Unified Diff: device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java

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: device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
diff --git a/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java b/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
index 8355ddff6c8bed8ad83ec63ef6902a6ef47261ab..f8271fb1dadd1af6dd7faa0e216959782e708820 100644
--- a/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
+++ b/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
@@ -257,6 +257,22 @@ public class PlatformSensorAndProviderTest {
}
/**
+ * Test that PlatformSensor correctly returns its maximum supported frequency.
+ */
+ @Test
+ @Feature({"PlatformSensor"})
+ public void testSensorMaximumSupportedFrequency() {
+ PlatformSensor sensor = createPlatformSensor(50000, Sensor.TYPE_LIGHT,
+ SensorType.AMBIENT_LIGHT, Sensor.REPORTING_MODE_ON_CHANGE);
+ assertEquals(20, sensor.getMaximumSupportedFrequency(), 0.001);
+
+ sensor = createPlatformSensor(
+ 0, Sensor.TYPE_LIGHT, SensorType.AMBIENT_LIGHT, Sensor.REPORTING_MODE_ON_CHANGE);
+ assertEquals(
+ sensor.getDefaultConfiguration(), sensor.getMaximumSupportedFrequency(), 0.001);
+ }
+
+ /**
* Test that shared buffer is correctly populated from SensorEvent.
*/
@Test

Powered by Google App Engine
This is Rietveld 408576698