Chromium Code Reviews| 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..67446ebc39e3cb2fa828a76f3f48fadfc0b83129 100644 |
| --- a/ui/gfx/platform_font_win_unittest.cc |
| +++ b/ui/gfx/platform_font_win_unittest.cc |
| @@ -67,6 +67,23 @@ TEST(PlatformFontWinTest, DeriveFontWithHeight) { |
| EXPECT_EQ(expected_font.GetFontSize(), rederived_font.GetFontSize()); |
| EXPECT_EQ(expected_font.GetHeight(), rederived_font.GetHeight()); |
| } |
| + |
| + const Font bigger_font(base_font.GetFontName(), base_font.GetFontSize() + 10); |
|
Alexei Svitkine (slow)
2014/05/09 21:21:00
Oops, I see you already added a test.
Can you mak
Tomasz Moniuszko
2014/05/29 10:46:40
Done.
|
| + PlatformFontWin* bigger_platform_font = |
| + static_cast<PlatformFontWin*>(bigger_font.platform_font()); |
| + |
| + int requested_height = (base_font.GetHeight() + bigger_font.GetHeight()) / 2; |
|
Alexei Svitkine (slow)
2014/05/09 21:21:00
Is it possible to do something more straight forwa
Tomasz Moniuszko
2014/05/29 10:46:40
Done.
|
| + ASSERT_GT(requested_height, base_font.GetHeight()); |
| + ASSERT_LT(requested_height, bigger_font.GetHeight()); |
| + |
| + Font derived_font_1 = |
| + platform_font->DeriveFontWithHeight(requested_height, 0); |
| + Font derived_font_2 = |
| + bigger_platform_font->DeriveFontWithHeight(requested_height, 0); |
| + |
| + // Derived fonts should be the same height for both higher and lower base |
| + // fonts. |
| + EXPECT_EQ(derived_font_1.GetHeight(), derived_font_2.GetHeight()); |
| } |
| // Callback function used by DeriveFontWithHeight_MinSize() below. |