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

Unified Diff: ash/display/display_change_observer_chromeos_unittest.cc

Issue 411763004: Use 1.25 DSF for 150~180 DPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 | « ash/display/display_change_observer_chromeos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_change_observer_chromeos_unittest.cc
diff --git a/ash/display/display_change_observer_chromeos_unittest.cc b/ash/display/display_change_observer_chromeos_unittest.cc
index aa668e96d1356d35c8db0cf6d28c4b895e25e9a4..b0df4ae43eb31ca9dba9e192469166b3a983d154 100644
--- a/ash/display/display_change_observer_chromeos_unittest.cc
+++ b/ash/display/display_change_observer_chromeos_unittest.cc
@@ -82,4 +82,29 @@ TEST_F(DisplayChangeObserverTest, GetDisplayModeList) {
EXPECT_EQ(0u, display_modes.size());
}
+TEST_F(DisplayChangeObserverTest, FindDeviceScaleFactor) {
+ // 19.5" 1600x900
+ EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(94.14f));
+
+ // 21.5" 1920x1080
+ EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(102.46f));
+
+ // 12.1" 1280x800
+ EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(124.75f));
+
+ // 13.3" 1920x1080
+ EXPECT_EQ(1.25f, DisplayChangeObserver::FindDeviceScaleFactor(157.35f));
+
+ // 14" 1920x1080
+ EXPECT_EQ(1.25f, DisplayChangeObserver::FindDeviceScaleFactor(165.63f));
+
+ // 12.85" 2560x1700
+ EXPECT_EQ(2.0f, DisplayChangeObserver::FindDeviceScaleFactor(239.15f));
+
+ // Erroneous values should still work.
+ EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(-100.0f));
+ EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(0.0f));
+ EXPECT_EQ(2.0f, DisplayChangeObserver::FindDeviceScaleFactor(10000.0f));
+}
+
} // namespace ash
« no previous file with comments | « ash/display/display_change_observer_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698