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

Unified Diff: ui/gfx/platform_font_win_unittest.cc

Issue 251773002: PlatformFontWin::DeriveFontWithHeight insensitive to base font's height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PlatformFontWin::DeriveFontWithHeight consistency fix after code review changes Created 6 years, 6 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/platform_font_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_win_unittest.cc
diff --git a/ui/gfx/platform_font_win_unittest.cc b/ui/gfx/platform_font_win_unittest.cc
index 1ecdde1d352db9d7b25e5a6c3ee62be48d79ca0a..08e5d0840a58965faeed4a2b43bbd7b1e1b858df 100644
--- a/ui/gfx/platform_font_win_unittest.cc
+++ b/ui/gfx/platform_font_win_unittest.cc
@@ -69,6 +69,22 @@ TEST(PlatformFontWinTest, DeriveFontWithHeight) {
}
}
+TEST(PlatformFontWinTest, DeriveFontWithHeight_Consistency) {
+ gfx::Font arial_12("Arial", 12);
+ ASSERT_GT(16, arial_12.GetHeight());
+ gfx::Font derived_1 = static_cast<PlatformFontWin*>(
+ arial_12.platform_font())->DeriveFontWithHeight(16, 0);
+
+ gfx::Font arial_15("Arial", 15);
+ ASSERT_LT(16, arial_15.GetHeight());
+ gfx::Font derived_2 = static_cast<PlatformFontWin*>(
+ arial_15.platform_font())->DeriveFontWithHeight(16, 0);
+
+ EXPECT_EQ(derived_1.GetFontSize(), derived_2.GetFontSize());
+ EXPECT_EQ(16, derived_1.GetHeight());
+ EXPECT_EQ(16, derived_2.GetHeight());
+}
+
// Callback function used by DeriveFontWithHeight_MinSize() below.
static int GetMinFontSize() {
return 10;
« no previous file with comments | « ui/gfx/platform_font_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698