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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 23522018: RenderTextWin: Break runs between any two characters that are not in the same code block (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mike's comments Created 7 years, 3 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 | « no previous file | ui/gfx/render_text_win.h » ('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 263ef92d8159c7088650ddd538457e49061d7ea0..bf3015bc15008fe76a93c67deac1dec7dd3ac906 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -1650,5 +1650,27 @@ TEST_F(RenderTextTest, SelectionKeepsLigatures) {
render_text->MoveCursorTo(SelectionModel(0, CURSOR_FORWARD));
}
}
+
+#if defined(OS_WIN)
+TEST_F(RenderTextTest, Win_BreakRunsByUnicodeBlocks) {
+ scoped_ptr<RenderTextWin> render_text(
+ static_cast<RenderTextWin*>(RenderText::CreateInstance()));
+
+ render_text->SetText(WideToUTF16(L"x\x25B6y"));
+ render_text->EnsureLayout();
+ ASSERT_EQ(3U, render_text->runs_.size());
+ EXPECT_EQ(ui::Range(0, 1), render_text->runs_[0]->range);
+ EXPECT_EQ(ui::Range(1, 2), render_text->runs_[1]->range);
+ EXPECT_EQ(ui::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(ui::Range(0, 2), render_text->runs_[0]->range);
+ EXPECT_EQ(ui::Range(2, 3), render_text->runs_[1]->range);
+ EXPECT_EQ(ui::Range(3, 5), render_text->runs_[2]->range);
+
+}
+#endif // !defined(OS_WIN)
} // namespace gfx
« no previous file with comments | « no previous file | ui/gfx/render_text_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698