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

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: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 7 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 | « ui/gfx/font_render_params_linux_unittest.cc ('k') | ui/gfx/linux_font_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_unittest.cc
diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc
index 2552b13ee9be505a931be43b50da54294766d9fe..b93589ddd724af0f43986d5aa55673873c31a028 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));
#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)
« no previous file with comments | « ui/gfx/font_render_params_linux_unittest.cc ('k') | ui/gfx/linux_font_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698