Index: ui/gfx/render_text_unittest.cc |
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc |
index 1c6f902d936fb435827912df67561e1d1af51c51..e7115814759bc19c5979bb605416db0265d23d8c 100644 |
--- a/ui/gfx/render_text_unittest.cc |
+++ b/ui/gfx/render_text_unittest.cc |
@@ -2326,4 +2326,30 @@ TEST_F(RenderTextTest, StringFitsOwnWidth) { |
EXPECT_EQ(kString, render_text->GetLayoutText()); |
} |
+// TODO(derat): Figure out why this fails on Windows: http://crbug.com/427184 |
+#if !defined(OS_WIN) |
+// Ensure that RenderText examines all of the fonts in its FontList before |
+// falling back to other fonts. |
+TEST_F(RenderTextTest, FontListFallback) { |
+ // Double-check that the requested fonts are present. |
+ FontList font_list("Arial, Symbol, 12px"); |
+ const std::vector<Font>& fonts = font_list.GetFonts(); |
+ ASSERT_EQ(2u, fonts.size()); |
+ ASSERT_EQ("arial", |
+ base::StringToLowerASCII(fonts[0].GetActualFontNameForTesting())); |
+ ASSERT_EQ("symbol", |
+ base::StringToLowerASCII(fonts[1].GetActualFontNameForTesting())); |
+ |
+ // "⊕" (CIRCLED PLUS) should be rendered with Symbol rather than falling back |
+ // to some other font that's present on the system. |
+ scoped_ptr<RenderText> render_text(RenderText::CreateInstance()); |
+ render_text->SetFontList(font_list); |
+ render_text->SetText(UTF8ToUTF16("\xE2\x8A\x95")); |
+ const std::vector<RenderText::FontSpan> spans = |
+ render_text->GetFontSpansForTesting(); |
+ ASSERT_EQ(static_cast<size_t>(1), spans.size()); |
+ EXPECT_EQ("Symbol", spans[0].first.GetFontName()); |
+} |
+#endif // !defined(OS_WIN) |
+ |
} // namespace gfx |