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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 971673002: Mac: Implement GetFallbackFontFamilies for Harfbuzz (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150129-MacViews-Bringup5-RTHB-in-Label
Patch Set: Move to font_fallback_mac_unittest Created 5 years, 10 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/render_text_harfbuzz.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_unittest.cc
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index 542939ea3081369af9a50fdf080f3490eaa7d3d8..e274a266eaa9acfd18bfbaca370a327215f5f7f8 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -2569,6 +2569,24 @@ TEST_F(RenderTextTest, HarfBuzz_UniscribeFallback) {
}
#endif // defined(OS_WIN)
+// Ensure that the fallback fonts offered by gfx::GetFallbackFontFamilies() are
+// tried. Note this test assumes the font "Arial" doesn't provide a unicode
+// glyph for a particular character, and that there exists a system fallback
+// font which does.
+#if defined(OS_WIN) || defined(OS_MACOSX)
+TEST_F(RenderTextTest, HarfBuzz_UnicodeFallback) {
+ RenderTextHarfBuzz render_text;
+ render_text.SetFontList(FontList("Arial, 12px"));
+
+ // Korean character "han".
+ render_text.SetText(WideToUTF16(L"\xd55c"));
+ render_text.EnsureLayout();
+ internal::TextRunList* run_list = render_text.GetRunList();
+ ASSERT_EQ(1U, run_list->size());
+ EXPECT_EQ(0U, run_list->runs()[0]->CountMissingGlyphs());
+}
+#endif // defined(OS_WIN) || defined(OS_MACOSX)
+
// Ensure that the width reported by RenderText is sufficient for drawing. Draws
// to a canvas and checks whether any pixel beyond the width is colored.
TEST_F(RenderTextTest, TextDoesntClip) {
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698