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

Unified Diff: ui/gfx/font_unittest.cc

Issue 2222483002: Mac: Fix PlatformFontMac::DeriveFont. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@font_mac
Patch Set: Created 4 years, 4 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/platform_font_mac.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 b93589ddd724af0f43986d5aa55673873c31a028..a5ac50888fb9e3f92f172671f602ac4bca297dc7 100644
--- a/ui/gfx/font_unittest.cc
+++ b/ui/gfx/font_unittest.cc
@@ -158,6 +158,19 @@ TEST_F(FontTest, MAYBE_GetActualFontNameForTesting) {
base::ToLowerASCII(fallback_font.GetActualFontNameForTesting()));
}
+TEST_F(FontTest, DeriveFont) {
+ Font cf("Arial", 8);
+ const int kSizeDelta = 2;
+ Font cf_underlined =
+ cf.Derive(0, cf.GetStyle() | gfx::Font::UNDERLINE, cf.GetWeight());
+ Font cf_underlined_resized = cf_underlined.Derive(
+ kSizeDelta, cf_underlined.GetStyle(), cf_underlined.GetWeight());
+ EXPECT_EQ(cf.GetStyle() | gfx::Font::UNDERLINE,
+ cf_underlined_resized.GetStyle());
+ EXPECT_EQ(cf.GetFontSize() + kSizeDelta, cf_underlined_resized.GetFontSize());
+ EXPECT_EQ(cf.GetWeight(), cf_underlined_resized.GetWeight());
+}
+
#if defined(OS_WIN)
TEST_F(FontTest, DeriveResizesIfSizeTooSmall) {
Font cf("Arial", 8);
« no previous file with comments | « no previous file | ui/gfx/platform_font_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698