Index: ui/gfx/font_render_params_linux_unittest.cc |
diff --git a/ui/gfx/font_render_params_linux_unittest.cc b/ui/gfx/font_render_params_linux_unittest.cc |
index 46a4fcfaac27f036693448205271b265cc92db1e..ee80e9be653c3c2673b2fa71583ec67649b24752 100644 |
--- a/ui/gfx/font_render_params_linux_unittest.cc |
+++ b/ui/gfx/font_render_params_linux_unittest.cc |
@@ -47,7 +47,8 @@ class TestFontDelegate : public LinuxFontDelegate { |
}; |
// Loads the first system font defined by fontconfig_util_linux.h with a base |
-// filename of |basename|. Case is ignored. |
+// filename of |basename|. Case is ignored. FcFontMatch() requires there to be |
+// at least one font present. |
bool LoadSystemFont(const std::string& basename) { |
for (size_t i = 0; i < kNumSystemFontsForFontconfig; ++i) { |
base::FilePath path(gfx::kSystemFontsForFontconfig[i]); |
@@ -96,8 +97,11 @@ TEST_F(FontRenderParamsTest, Default) { |
CreateFontconfigEditStanza("hintstyle", "const", "hintslight") + |
CreateFontconfigEditStanza("rgba", "const", "rgb") + |
kFontconfigMatchFooter + |
- // Add a font match for Arial; it shouldn't be used when querying for |
- // default settings: http://crbug.com/421247 |
+ // Add a font match for Arial; it shouldn't be used on Chrome OS but when |
+ // querying for default settings: http://crbug.com/421247 |
+ // |
+ // The match _should_ take effect on desktop Linux, though: |
+ // http://crbug.com/442443 |
kFontconfigMatchFontHeader + |
CreateFontconfigTestStanza("family", "eq", "string", "Arial") + |
CreateFontconfigEditStanza("antialias", "bool", "true") + |
@@ -110,9 +114,14 @@ TEST_F(FontRenderParamsTest, Default) { |
FontRenderParams params = GetFontRenderParams( |
FontRenderParamsQuery(true), NULL); |
EXPECT_TRUE(params.antialiasing); |
- EXPECT_TRUE(params.autohinter); |
EXPECT_TRUE(params.use_bitmaps); |
+#if defined(OS_CHROMEOS) |
+ EXPECT_TRUE(params.autohinter); |
EXPECT_EQ(FontRenderParams::HINTING_SLIGHT, params.hinting); |
+#else |
+ EXPECT_FALSE(params.autohinter); |
+ EXPECT_EQ(FontRenderParams::HINTING_FULL, params.hinting); |
+#endif |
EXPECT_FALSE(params.subpixel_positioning); |
EXPECT_EQ(FontRenderParams::SUBPIXEL_RENDERING_RGB, |
params.subpixel_rendering); |
@@ -214,6 +223,7 @@ TEST_F(FontRenderParamsTest, Style) { |
} |
TEST_F(FontRenderParamsTest, Scalable) { |
+ ASSERT_TRUE(LoadSystemFont("arial.ttf")); |
msw
2014/12/18 01:10:49
nit: We previously tried to avoid loading fonts fo
Daniel Erat
2014/12/18 17:17:59
sure, done. just added it here since just about al
|
// Load a config that only enables antialiasing for scalable fonts. |
ASSERT_TRUE(LoadConfigDataIntoFontconfig(temp_dir_.path(), |
std::string(kFontconfigFileHeader) + |
@@ -256,6 +266,7 @@ TEST_F(FontRenderParamsTest, UseBitmaps) { |
} |
TEST_F(FontRenderParamsTest, ForceFullHintingWhenAntialiasingIsDisabled) { |
+ ASSERT_TRUE(LoadSystemFont("arial.ttf")); |
// Load a config that disables antialiasing and hinting while requesting |
// subpixel rendering. |
ASSERT_TRUE(LoadConfigDataIntoFontconfig(temp_dir_.path(), |