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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 324983002: Move unusual character block logic to a helper function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 6 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.cc ('k') | ui/gfx/render_text_win.cc » ('j') | 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 8cef145e241030508fb0af370ce18c7751c373a0..19ba4e7847c1c111339eb8ad91fd502fa9b8321e 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -1903,7 +1903,6 @@ TEST_F(RenderTextTest, Multiline_Newline) {
}
}
-
TEST_F(RenderTextTest, Win_BreakRunsByUnicodeBlocks) {
scoped_ptr<RenderTextWin> render_text(
static_cast<RenderTextWin*>(RenderText::CreateInstance()));
@@ -1974,7 +1973,6 @@ TEST_F(RenderTextTest, HarfBuzz_CharToGlyph) {
run.CharRangeToGlyphRange(Range(j, j + 1)));
}
}
-
}
TEST_F(RenderTextTest, HarfBuzz_RunDirection) {
@@ -1989,4 +1987,23 @@ TEST_F(RenderTextTest, HarfBuzz_RunDirection) {
EXPECT_TRUE(render_text.runs_[2]->is_rtl);
}
+TEST_F(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks) {
+ RenderTextHarfBuzz render_text;
+
+ // The '\x25B6' "play character" should break runs. http://crbug.com/278913
+ render_text.SetText(WideToUTF16(L"x\x25B6y"));
+ render_text.EnsureLayout();
+ ASSERT_EQ(3U, render_text.runs_.size());
+ EXPECT_EQ(Range(0, 1), render_text.runs_[0]->range);
+ EXPECT_EQ(Range(1, 2), render_text.runs_[1]->range);
+ EXPECT_EQ(Range(2, 3), render_text.runs_[2]->range);
+
+ render_text.SetText(WideToUTF16(L"x \x25B6 y"));
+ render_text.EnsureLayout();
+ ASSERT_EQ(3U, render_text.runs_.size());
+ EXPECT_EQ(Range(0, 2), render_text.runs_[0]->range);
+ EXPECT_EQ(Range(2, 3), render_text.runs_[1]->range);
+ EXPECT_EQ(Range(3, 5), render_text.runs_[2]->range);
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | ui/gfx/render_text_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698