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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 578553002: Use DSF instead of UI scale if the native DSF is 1.25 and UI Scale is 0.8x (dsf=1.25 equivalent) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove upgrade Created 6 years, 3 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
« ash/display/display_manager.cc ('K') | « ash/display/display_manager.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_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index ff260761e6cb713d73dd0d58019adf7bc271775f..309d881179517f42b2d07a10b3d259dfa2e5fdcd 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -1102,6 +1102,33 @@ TEST_F(DisplayManagerTest, UIScaleUpgradeToHighDPI) {
EXPECT_EQ("480x270", GetDisplayForId(display_id).size().ToString());
}
+TEST_F(DisplayManagerTest, Use125DSFRorUIScaling) {
+ int64 display_id = Shell::GetScreen()->GetPrimaryDisplay().id();
+ gfx::Display::SetInternalDisplayId(display_id);
+ DisplayInfo::SetUse125DSFForUIScaling(true);
+
+ UpdateDisplay("1920x1080*1.25");
+ EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor());
+ EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveUIScale());
+
+ display_manager()->SetDisplayUIScale(display_id, 0.8f);
+ EXPECT_EQ(1.25f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor());
+ EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveUIScale());
+ EXPECT_EQ("1536x864", GetDisplayForId(display_id).size().ToString());
+
+ display_manager()->SetDisplayUIScale(display_id, 0.5f);
+ EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor());
+ EXPECT_EQ(0.5f, GetDisplayInfoAt(0).GetEffectiveUIScale());
+ EXPECT_EQ("960x540", GetDisplayForId(display_id).size().ToString());
+
+ display_manager()->SetDisplayUIScale(display_id, 1.25f);
+ EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor());
+ EXPECT_EQ(1.25f, GetDisplayInfoAt(0).GetEffectiveUIScale());
+ EXPECT_EQ("2400x1350", GetDisplayForId(display_id).size().ToString());
+
+ DisplayInfo::SetUse125DSFForUIScaling(false);
+}
+
#if defined(OS_WIN)
// TODO(scottmg): RootWindow doesn't get resized on Windows
// Ash. http://crbug.com/247916.
@@ -1474,6 +1501,16 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf200External) {
EXPECT_FALSE(IsTextSubpixelPositioningEnabled());
}
+TEST_F(DisplayManagerFontTest,
+ TextSubpixelPositioningWithDsf125InternalWithScaling) {
+ DisplayInfo::SetUse125DSFForUIScaling(true);
+ FontTestHelper helper(1.25f, FontTestHelper::INTERNAL);
+ ASSERT_DOUBLE_EQ(
+ 1.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_FALSE(IsTextSubpixelPositioningEnabled());
+ DisplayInfo::SetUse125DSFForUIScaling(false);
+}
+
#endif // OS_CHROMEOS
} // namespace ash
« ash/display/display_manager.cc ('K') | « ash/display/display_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698