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

Unified Diff: device/generic_sensor/platform_sensor_and_provider_unittest_win.cc

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
« no previous file with comments | « device/generic_sensor/platform_sensor.cc ('k') | device/generic_sensor/platform_sensor_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
diff --git a/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc b/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
index f0f44bd71c442f3767c5adfb4b824638f4af2bf5..a87696d470e6f119e12f021978cd2353dd358562 100644
--- a/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
+++ b/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
@@ -486,4 +486,22 @@ TEST_F(PlatformSensorAndProviderTestWin, SensorStateChangedToReady) {
base::RunLoop().RunUntilIdle();
}
+// Tests that GetMaximumSupportedFrequency provides correct value.
+TEST_F(PlatformSensorAndProviderTestWin, GetMaximumSupportedFrequency) {
+ SetSupportedReportingFrequency(20);
+ SetSupportedSensor(SENSOR_TYPE_AMBIENT_LIGHT);
+ auto sensor = CreateSensor(SensorType::AMBIENT_LIGHT);
+ EXPECT_TRUE(sensor);
+ EXPECT_THAT(sensor->GetMaximumSupportedFrequency(), 20);
+}
+
+// Tests that GetMaximumSupportedFrequency returns fallback value.
+TEST_F(PlatformSensorAndProviderTestWin, GetMaximumSupportedFrequencyFallback) {
+ SetSupportedReportingFrequency(0);
+ SetSupportedSensor(SENSOR_TYPE_AMBIENT_LIGHT);
+ auto sensor = CreateSensor(SensorType::AMBIENT_LIGHT);
+ EXPECT_TRUE(sensor);
+ EXPECT_THAT(sensor->GetMaximumSupportedFrequency(), 5);
+}
+
} // namespace device
« no previous file with comments | « device/generic_sensor/platform_sensor.cc ('k') | device/generic_sensor/platform_sensor_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698