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 f3e8ee7031a1a0f56b693fa75b435eca49be30d9..92f47592d4f352d4507d483db1c4f0b25001ad31 100644 |
| --- a/ui/gfx/font_list_unittest.cc |
| +++ b/ui/gfx/font_list_unittest.cc |
| @@ -14,6 +14,7 @@ |
| namespace { |
| +#if !defined(OS_ANDROID) |
| // Helper function for comparing fonts for equality. |
| std::string FontToString(const gfx::Font& font) { |
| std::string font_string = font.GetFontName(); |
| @@ -28,6 +29,7 @@ std::string FontToString(const gfx::Font& font) { |
| font_string += "|underline"; |
| return font_string; |
| } |
| +#endif |
| } // namespace |
| @@ -73,6 +75,22 @@ TEST(FontListTest, ParseDescription) { |
| &size_pixels)); |
| } |
| +TEST(FontListTest, FontDescString_GetStyle) { |
| + FontList font_list = FontList("Arial,Sans serif, 8px"); |
| + EXPECT_EQ(Font::NORMAL, font_list.GetFontStyle()); |
| + |
| + font_list = FontList("Arial,Sans serif,Bold 8px"); |
| + EXPECT_EQ(Font::BOLD, font_list.GetFontStyle()); |
| + |
| + font_list = FontList("Arial,Sans serif,Italic 8px"); |
| + EXPECT_EQ(Font::ITALIC, font_list.GetFontStyle()); |
| + |
| + font_list = FontList("Arial,Italic Bold 8px"); |
| + EXPECT_EQ(Font::BOLD | Font::ITALIC, font_list.GetFontStyle()); |
| +} |
| + |
| +// TODO(489354): Enable tests on Android |
| +#if !defined(OS_ANDROID) |
|
jbudorick
2015/05/18 19:17:56
I think this should be done via the MAYBE_FooTest
pkotwicz
2015/05/18 20:59:05
Done.
|
| TEST(FontListTest, Fonts_FromDescString) { |
| // Test init from font name size string. |
| FontList font_list = FontList("arial, Courier New, 13px"); |
| @@ -138,20 +156,6 @@ TEST(FontListTest, Fonts_FromFontVector) { |
| EXPECT_EQ("Courier New|8|bold", FontToString(fonts[1])); |
| } |
| -TEST(FontListTest, FontDescString_GetStyle) { |
| - FontList font_list = FontList("Arial,Sans serif, 8px"); |
| - EXPECT_EQ(Font::NORMAL, font_list.GetFontStyle()); |
| - |
| - font_list = FontList("Arial,Sans serif,Bold 8px"); |
| - EXPECT_EQ(Font::BOLD, font_list.GetFontStyle()); |
| - |
| - font_list = FontList("Arial,Sans serif,Italic 8px"); |
| - EXPECT_EQ(Font::ITALIC, font_list.GetFontStyle()); |
| - |
| - font_list = FontList("Arial,Italic Bold 8px"); |
| - EXPECT_EQ(Font::BOLD | Font::ITALIC, font_list.GetFontStyle()); |
| -} |
| - |
| TEST(FontListTest, Fonts_GetStyle) { |
| std::vector<Font> fonts; |
| fonts.push_back(gfx::Font("Arial", 8)); |
| @@ -245,4 +249,6 @@ TEST(FontListTest, Fonts_DeriveWithHeightUpperBound) { |
| EXPECT_EQ(font_list.GetFontSize(), derived_2.GetFontSize()); |
| } |
| +#endif // !defined(OS_ANDROID) |
| + |
| } // namespace gfx |