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

Unified Diff: ui/gfx/font_list_unittest.cc

Issue 2441343003: Allow the default generic font family settings to find the first available font (Closed)
Patch Set: msw review Created 4 years, 2 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/font_list.cc ('k') | no next file » | no next file with comments »
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 770e23e5ae3a9d3891dfec1b475a9222ebd96f3f..0d8bda779380eaa2084af599b904d95507148b5f 100644
--- a/ui/gfx/font_list_unittest.cc
+++ b/ui/gfx/font_list_unittest.cc
@@ -356,4 +356,24 @@ TEST(FontListTest, MAYBE_Fonts_DeriveWithHeightUpperBound) {
EXPECT_EQ(font_list.GetFontSize(), derived_2.GetFontSize());
}
+TEST(FontListTest, FirstAvailableOrFirst) {
+ EXPECT_TRUE(FontList::FirstAvailableOrFirst("").empty());
+ EXPECT_TRUE(FontList::FirstAvailableOrFirst(std::string()).empty());
+
+ EXPECT_EQ("Arial", FontList::FirstAvailableOrFirst("Arial"));
+ EXPECT_EQ("not exist", FontList::FirstAvailableOrFirst("not exist"));
+
+ EXPECT_EQ("Arial", FontList::FirstAvailableOrFirst("Arial, not exist"));
+ EXPECT_EQ("Arial", FontList::FirstAvailableOrFirst("not exist, Arial"));
+ EXPECT_EQ("Arial",
+ FontList::FirstAvailableOrFirst("not exist, Arial, not exist"));
+
+ EXPECT_EQ("not exist",
+ FontList::FirstAvailableOrFirst("not exist, not exist 2"));
+
+ EXPECT_EQ("Arial", FontList::FirstAvailableOrFirst(", not exist, Arial"));
+ EXPECT_EQ("not exist",
+ FontList::FirstAvailableOrFirst(", not exist, not exist"));
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/font_list.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698