Commit 7136e1ca authored by derat@chromium.org's avatar derat@chromium.org

linux: Add FontRenderParam test for failed Fontconfig match.

Test that GetCustomFontRenderParams() returns the system
defaults when Fontconfig fails to find any matches.

BUG=125235

Review URL: https://codereview.chromium.org/407143005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284836 0039d316-1c4b-4281-b951-d872f2087c98
parent e3636158
...@@ -269,4 +269,27 @@ TEST_F(FontRenderParamsTest, OnlySetConfiguredValues) { ...@@ -269,4 +269,27 @@ TEST_F(FontRenderParamsTest, OnlySetConfiguredValues) {
EXPECT_EQ(system_params.subpixel_rendering, params.subpixel_rendering); EXPECT_EQ(system_params.subpixel_rendering, params.subpixel_rendering);
} }
TEST_F(FontRenderParamsTest, NoFontconfigMatch) {
// Don't load a Fontconfig configuration.
FontRenderParams system_params;
system_params.antialiasing = true;
system_params.hinting = FontRenderParams::HINTING_MEDIUM;
system_params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_RGB;
test_font_delegate_.set_params(system_params);
std::vector<std::string> families;
families.push_back("Arial");
families.push_back("Times New Roman");
const int pixel_size = 10;
std::string suggested_family;
FontRenderParams params = GetCustomFontRenderParams(
false, &families, &pixel_size, NULL, NULL, &suggested_family);
// The system params and the first requested family should be returned.
EXPECT_EQ(system_params.antialiasing, params.antialiasing);
EXPECT_EQ(system_params.hinting, params.hinting);
EXPECT_EQ(system_params.subpixel_rendering, params.subpixel_rendering);
EXPECT_EQ("Arial", suggested_family);
}
} // namespace gfx } // namespace gfx
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment