Index: ash/display/display_manager_unittest.cc |
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc |
index 7a0b0a2b2b955edc4c18fb30602c2c9324ea518a..3761223a311ca2f8424a49e1fe71247c7fa3fa60 100644 |
--- a/ash/display/display_manager_unittest.cc |
+++ b/ash/display/display_manager_unittest.cc |
@@ -1572,10 +1572,16 @@ class FontTestHelper : public test::AshTestBase { |
bool IsTextSubpixelPositioningEnabled() { |
gfx::FontRenderParams params = |
- gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL); |
+ gfx::GetCurrentFontRenderParams(gfx::FontRenderParamsQuery(false), NULL); |
return params.subpixel_positioning; |
} |
+gfx::FontRenderParams::Hinting GetFontHintingParams() { |
+ gfx::FontRenderParams params = |
+ gfx::GetCurrentFontRenderParams(gfx::FontRenderParamsQuery(false), NULL); |
+ return params.hinting; |
+} |
+ |
} // namespace |
typedef testing::Test DisplayManagerFontTest; |
@@ -1585,6 +1591,7 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf100Internal) { |
ASSERT_DOUBLE_EQ( |
1.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_FALSE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_NE(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
} |
TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf125Internal) { |
@@ -1592,6 +1599,7 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf125Internal) { |
ASSERT_DOUBLE_EQ( |
1.25f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_TRUE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_EQ(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
} |
TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf200Internal) { |
@@ -1599,6 +1607,15 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf200Internal) { |
ASSERT_DOUBLE_EQ( |
2.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_TRUE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_EQ(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
+ |
+ Shell::GetInstance()->display_manager()->SetDisplayUIScale( |
+ Shell::GetScreen()->GetPrimaryDisplay().id(), 2.0f); |
+ |
+ ASSERT_DOUBLE_EQ( |
+ 1.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
+ EXPECT_FALSE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_NE(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
} |
TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf100External) { |
@@ -1606,6 +1623,7 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf100External) { |
ASSERT_DOUBLE_EQ( |
1.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_FALSE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_NE(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
} |
TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf125External) { |
@@ -1613,6 +1631,7 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf125External) { |
ASSERT_DOUBLE_EQ( |
1.25f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_FALSE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_NE(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
} |
TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf200External) { |
@@ -1620,6 +1639,7 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf200External) { |
ASSERT_DOUBLE_EQ( |
2.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_FALSE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_NE(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
} |
TEST_F(DisplayManagerFontTest, |
@@ -1629,6 +1649,16 @@ TEST_F(DisplayManagerFontTest, |
ASSERT_DOUBLE_EQ( |
1.0f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
EXPECT_FALSE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_NE(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
+ |
+ Shell::GetInstance()->display_manager()->SetDisplayUIScale( |
+ Shell::GetScreen()->GetPrimaryDisplay().id(), 0.8f); |
+ |
+ ASSERT_DOUBLE_EQ( |
+ 1.25f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
+ EXPECT_TRUE(IsTextSubpixelPositioningEnabled()); |
+ EXPECT_EQ(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
+ |
DisplayInfo::SetUse125DSFForUIScaling(false); |
} |