Chromium Code Reviews| Index: ui/gfx/font_list_unittest.cc |
| diff --git a/ui/gfx/font_list_unittest.cc b/ui/gfx/font_list_unittest.cc |
| index fc5f8392069f52c12be3c12bd508291e4c7771ff..cf84a00d83cfff95197791cf325bf467863c7d55 100644 |
| --- a/ui/gfx/font_list_unittest.cc |
| +++ b/ui/gfx/font_list_unittest.cc |
| @@ -286,4 +286,22 @@ TEST(FontListTest, Fonts_GetHeight_GetBaseline) { |
| font_list_mix.GetBaseline()); |
| } |
| +TEST(FontListTest, Fonts_DeriveWithHeightUpperBound) { |
| + std::vector<Font> fonts; |
| + |
| + fonts.push_back(gfx::Font("Arial", 18).Derive(0, Font::NORMAL)); |
|
msw
2014/08/28 21:43:51
Why do you need to derive the normal style for the
noms (inactive)
2014/08/29 17:10:29
Done.
|
| + fonts.push_back(gfx::Font("Sans serif", 18).Derive(0, Font::NORMAL)); |
| + fonts.push_back(gfx::Font("Symbol", 18).Derive(0, Font::NORMAL)); |
| + FontList font_list = FontList(fonts); |
| + |
| + FontList derived = font_list.DeriveWithHeightUpperBound( |
|
msw
2014/08/28 21:43:51
Maybe just do something like:
const int height =
noms (inactive)
2014/08/29 17:10:29
I've done something along these lines, but without
|
| + font_list.GetHeight() - 6); |
| + const std::vector<Font>& derived_fonts = derived.GetFonts(); |
| + |
| + EXPECT_EQ(3U, derived_fonts.size()); |
| + EXPECT_EQ("Arial|13", FontToString(derived_fonts[0])); |
| + EXPECT_EQ("Sans serif|13", FontToString(derived_fonts[1])); |
| + EXPECT_EQ("Symbol|13", FontToString(derived_fonts[2])); |
| +} |
| + |
| } // namespace gfx |