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

Unified Diff: ui/gfx/font_unittest.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for review issues. Created 4 years, 9 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
Index: ui/gfx/font_unittest.cc
diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc
index 2552b13ee9be505a931be43b50da54294766d9fe..2decb298a4c8535918a3de9584f7a3f4e32b444c 100644
--- a/ui/gfx/font_unittest.cc
+++ b/ui/gfx/font_unittest.cc
@@ -70,11 +70,12 @@ TEST_F(FontTest, MAYBE_LoadArial) {
#endif
TEST_F(FontTest, MAYBE_LoadArialBold) {
Font cf("Arial", 16);
- Font bold(cf.Derive(0, Font::BOLD));
+ Font bold(cf.Derive(0, Font::NORMAL, Font::WEIGHT_BOLD));
msw 2016/03/22 18:24:11 Update the enum values in this file.
Mikus 2016/03/23 17:53:21 Done.
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_IOS)
EXPECT_TRUE(bold.GetNativeFont());
#endif
- EXPECT_EQ(bold.GetStyle(), Font::BOLD);
+ EXPECT_EQ(bold.GetStyle(), Font::NORMAL);
+ EXPECT_EQ(bold.GetWeight(), Font::WEIGHT_BOLD);
EXPECT_EQ("arial", base::ToLowerASCII(cf.GetActualFontNameForTesting()));
}
@@ -163,7 +164,7 @@ TEST_F(FontTest, DeriveResizesIfSizeTooSmall) {
// The minimum font size is set to 5 in browser_main.cc.
ScopedMinimumFontSizeCallback minimum_size(5);
- Font derived_font = cf.Derive(-4, cf.GetStyle());
+ Font derived_font = cf.Derive(-4, cf.GetStyle(), cf.GetWeight());
EXPECT_EQ(5, derived_font.GetFontSize());
}
@@ -172,7 +173,7 @@ TEST_F(FontTest, DeriveKeepsOriginalSizeIfHeightOk) {
// The minimum font size is set to 5 in browser_main.cc.
ScopedMinimumFontSizeCallback minimum_size(5);
- Font derived_font = cf.Derive(-2, cf.GetStyle());
+ Font derived_font = cf.Derive(-2, cf.GetStyle(), cf.GetWeight());
EXPECT_EQ(6, derived_font.GetFontSize());
}
#endif // defined(OS_WIN)

Powered by Google App Engine
This is Rietveld 408576698