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

Unified Diff: ui/gfx/font_unittest.cc

Issue 2189353002: Mac: Fix PlatformFontMac::DeriveFont for underline font style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | ui/gfx/platform_font_mac.h » ('j') | ui/gfx/platform_font_mac.h » ('J')
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) {
karandeepb 2016/08/05 11:03:07 All the other tests seem to be disabled on Android
Avi (use Gerrit) 2016/08/05 14:54:58 Perhaps you'll find out on the trybots :)
+ 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,
karandeepb 2016/08/05 11:03:07 This fails on Mac currently. The derived font does
Avi (use Gerrit) 2016/08/05 14:54:59 As long as it passes with the other changes in the
+ 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') | ui/gfx/platform_font_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698