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

Unified Diff: ui/base/resource/resource_bundle_unittest.cc

Issue 903423002: Make FontList description-parsing public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and apply review feedback Created 5 years, 10 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 | ui/gfx/font_list.h » ('j') | ui/gfx/pango_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle_unittest.cc
diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc
index ddaa62667e2998935c0130c341d7f6d582abea51..5aa5017c9662b8ab18726f91f36bbe7719a9cb3f 100644
--- a/ui/base/resource/resource_bundle_unittest.cc
+++ b/ui/base/resource/resource_bundle_unittest.cc
@@ -378,19 +378,18 @@ TEST_F(ResourceBundleTest, FontListReload) {
.Times(16)
.WillRepeatedly(Return(test_font));
- std::string expected = "test font, 12px";
EXPECT_CALL(delegate, GetLocalizedStringMock(IDS_UI_FONT_FAMILY_CROS))
- .WillOnce(Return(base::UTF8ToUTF16(expected)));
-
+ .WillOnce(Return(base::UTF8ToUTF16("test font, 12px")));
resource_bundle->ReloadFonts();
- EXPECT_EQ(expected, gfx::FontList().GetFontDescriptionString());
+ // Don't test the font name; it'll get mapped to something else by Fontconfig.
+ EXPECT_EQ(12, gfx::FontList().GetPrimaryFont().GetFontSize());
+ EXPECT_EQ(gfx::Font::NORMAL, gfx::FontList().GetPrimaryFont().GetStyle());
- expected = "test font 2, 12px";
EXPECT_CALL(delegate, GetLocalizedStringMock(IDS_UI_FONT_FAMILY_CROS))
- .WillOnce(Return(base::UTF8ToUTF16(expected)));
-
+ .WillOnce(Return(base::UTF8ToUTF16("test font 2, Bold 10px")));
resource_bundle->ReloadFonts();
- EXPECT_EQ(expected, gfx::FontList().GetFontDescriptionString());
+ EXPECT_EQ(10, gfx::FontList().GetPrimaryFont().GetFontSize());
+ EXPECT_EQ(gfx::Font::BOLD, gfx::FontList().GetPrimaryFont().GetStyle());
}
#endif
« no previous file with comments | « no previous file | ui/gfx/font_list.h » ('j') | ui/gfx/pango_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698