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

Unified Diff: ui/gfx/font_render_params_linux_unittest.cc

Issue 407143005: linux: Add FontRenderParam test for failed Fontconfig match. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6fe55bc86035da133e55622c933af4d29968004f..18443201db8e4a7a427db11a390eaaa02ef62acc 100644
--- a/ui/gfx/font_render_params_linux_unittest.cc
+++ b/ui/gfx/font_render_params_linux_unittest.cc
@@ -269,4 +269,27 @@ TEST_F(FontRenderParamsTest, OnlySetConfiguredValues) {
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698