| Index: ash/display/display_manager_unittest.cc
|
| diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
|
| index 1a0b1f5b623902d6902b9b468036d724abab113e..1fdaadda1de601b0350f543217650bdf08504456 100644
|
| --- a/ash/display/display_manager_unittest.cc
|
| +++ b/ash/display/display_manager_unittest.cc
|
| @@ -1597,6 +1597,12 @@ bool IsTextSubpixelPositioningEnabled() {
|
| return params.subpixel_positioning;
|
| }
|
|
|
| +gfx::FontRenderParams::Hinting GetFontHintingParams() {
|
| + gfx::FontRenderParams params =
|
| + gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL);
|
| + return params.hinting;
|
| +}
|
| +
|
| } // namespace
|
|
|
| typedef testing::Test DisplayManagerFontTest;
|
| @@ -1606,6 +1612,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) {
|
| @@ -1613,6 +1620,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) {
|
| @@ -1620,6 +1628,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) {
|
| @@ -1627,6 +1644,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) {
|
| @@ -1634,6 +1652,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) {
|
| @@ -1641,6 +1660,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,
|
| @@ -1650,6 +1670,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);
|
| }
|
|
|
|
|