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

Unified Diff: ui/gfx/font_list_unittest.cc

Issue 844083002: Get all font unittests running with DirectWrite on Windows 7+ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presubmit Created 5 years, 11 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_win.cc » ('j') | ui/gfx/platform_font_win_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_list_unittest.cc
diff --git a/ui/gfx/font_list_unittest.cc b/ui/gfx/font_list_unittest.cc
index 6dcbb855d083d4483fb3e85e110cad02714fe174..2af4aa508920aca567f36d44e2a82a413adfc491 100644
--- a/ui/gfx/font_list_unittest.cc
+++ b/ui/gfx/font_list_unittest.cc
@@ -266,24 +266,32 @@ TEST(FontListTest, Fonts_GetHeight_GetBaseline) {
EXPECT_EQ(font1.GetBaseline(), font_list1.GetBaseline());
// If there are two different fonts, the font list returns the max value
- // for ascent and descent.
+ // for the baseline (ascent) and height.
Font font2("Symbol", 16);
ASSERT_EQ("symbol",
base::StringToLowerASCII(font2.GetActualFontNameForTesting()));
EXPECT_NE(font1.GetBaseline(), font2.GetBaseline());
- EXPECT_NE(font1.GetHeight() - font1.GetBaseline(),
- font2.GetHeight() - font2.GetBaseline());
+ EXPECT_NE(font1.GetHeight(), font2.GetHeight());
std::vector<Font> fonts;
fonts.push_back(font1);
fonts.push_back(font2);
FontList font_list_mix(fonts);
- // ascent of FontList == max(ascent of Fonts)
- EXPECT_EQ(std::max(font1.GetHeight() - font1.GetBaseline(),
- font2.GetHeight() - font2.GetBaseline()),
- font_list_mix.GetHeight() - font_list_mix.GetBaseline());
// descent of FontList == max(descent of Fonts)
msw 2015/01/10 01:50:15 The baseline is actually the ascent, not descent.
ananta 2015/01/10 02:05:49 Done.
EXPECT_EQ(std::max(font1.GetBaseline(), font2.GetBaseline()),
font_list_mix.GetBaseline());
+ // FIXME
+ // The height of the font list should be the max height of the fonts in it.
msw 2015/01/10 01:50:15 Oh darn, my earlier advice was wrong. I remember w
ananta 2015/01/10 02:05:49 Done.
+ // This is not the case for Mac and should be fixed.
+#if defined(OS_MACOSX)
+ // ascent of FontList == max(ascent of Fonts)
+ EXPECT_EQ(std::max(font1.GetHeight() - font1.GetBaseline(),
+ font2.GetHeight() - font2.GetBaseline()),
+ font_list_mix.GetHeight() - font_list_mix.GetBaseline());
+#else
+ // Height of FontList == max(Height of Fonts)
+ EXPECT_EQ(std::max(font1.GetHeight(), font2.GetHeight()),
+ font_list_mix.GetHeight());
+#endif
}
TEST(FontListTest, Fonts_DeriveWithHeightUpperBound) {
« no previous file with comments | « no previous file | ui/gfx/platform_font_win.cc » ('j') | ui/gfx/platform_font_win_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698