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: addressed 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') | ui/gfx/render_text_win.cc » ('J')
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..8e3530f19cd233dc12164e890508a7d38e62e2f6 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -1650,5 +1650,21 @@ TEST_F(RenderTextTest, SelectionKeepsLigatures) {
render_text->MoveCursorTo(SelectionModel(0, CURSOR_FORWARD));
}
}
+
+#if defined(OS_WIN)
+TEST_F(RenderTextTest, Win_BreakRunsByUnicodeBlocks) {
+ const base::string16 kTestString = WideToUTF16(L"x\x25B6y");
msw 2013/09/04 22:05:38 nit: Add another test case with spaces, like "x \x
ckocagil 2013/09/05 20:13:15 Done.
+
+ scoped_ptr<RenderTextWin> render_text(
+ static_cast<RenderTextWin*>(RenderText::CreateInstance()));
+ render_text->SetText(kTestString);
+ 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);
+}
+#endif // !defined(OS_WIN)
} // namespace gfx
« no previous file with comments | « no previous file | ui/gfx/render_text_win.h » ('j') | ui/gfx/render_text_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698