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

Unified Diff: ui/views/controls/textfield/textfield_views_model_unittest.cc

Issue 8802011: Revert 112983 - Improve RenderTextWin font fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield_views_model_unittest.cc
===================================================================
--- ui/views/controls/textfield/textfield_views_model_unittest.cc (revision 112993)
+++ ui/views/controls/textfield/textfield_views_model_unittest.cc (working copy)
@@ -138,7 +138,6 @@
TEST_F(TextfieldViewsModelTest, EditString_ComplexScript) {
TextfieldViewsModel model(NULL);
-
// Append two Hindi strings.
model.Append(WideToUTF16(L"\x0915\x093f\x0915\x094d\x0915"));
EXPECT_EQ(WideToUTF16(L"\x0915\x093f\x0915\x094d\x0915"),
@@ -149,8 +148,13 @@
model.GetText());
// Check it is not able to place cursor in middle of a grapheme.
+ // TODO(xji): temporarily disable in platform Win since the complex script
+ // characters turned into empty square due to font regression. So, not able
+ // to test 2 characters belong to the same grapheme.
+#if defined(OS_LINUX)
model.MoveCursorTo(gfx::SelectionModel(1U));
EXPECT_EQ(0U, model.GetCursorPosition());
+#endif
model.MoveCursorTo(gfx::SelectionModel(2U));
EXPECT_EQ(2U, model.GetCursorPosition());
@@ -181,7 +185,6 @@
EXPECT_EQ(WideToUTF16(L"\x0061\x0062\x0915\x0915\x094d\x092e\x094d"),
model.GetText());
model.MoveCursorTo(gfx::SelectionModel(model.GetText().length()));
- EXPECT_EQ(model.GetText().length(), model.GetCursorPosition());
EXPECT_TRUE(model.Backspace());
EXPECT_EQ(WideToUTF16(L"\x0061\x0062\x0915\x0915\x094d\x092e"),
model.GetText());
@@ -192,21 +195,30 @@
model.MoveCursorTo(gfx::SelectionModel(0));
EXPECT_EQ(0U, model.GetCursorPosition());
+ // TODO(xji): temporarily disable in platform Win since the complex script
+ // characters turned into empty square due to font regression. So, not able
+ // to test 2 characters belong to the same grapheme.
+#if defined(OS_LINUX)
model.MoveCursorTo(gfx::SelectionModel(1));
EXPECT_EQ(0U, model.GetCursorPosition());
+#endif
+ model.MoveCursorTo(gfx::SelectionModel(2));
+ EXPECT_EQ(2U, model.GetCursorPosition());
+
model.MoveCursorTo(gfx::SelectionModel(3));
EXPECT_EQ(3U, model.GetCursorPosition());
- // TODO(asvitkine): Temporarily disable the following check on Windows. It
- // seems Windows treats "\x0D38\x0D4D\x0D15" as a single grapheme.
-#if !defined(OS_WIN)
model.MoveCursorTo(gfx::SelectionModel(2));
- EXPECT_EQ(2U, model.GetCursorPosition());
+
EXPECT_TRUE(model.Backspace());
EXPECT_EQ(WideToUTF16(L"\x0D38\x0D15\x0D16\x0D2E"), model.GetText());
-#endif
+ // Test Delete/Backspace on Hebrew with non-spacing marks.
+ // TODO(xji): temporarily disable in platform Win since the complex script
+ // characters turned into empty square due to font regression. So, not able
+ // to test 2 characters belong to the same grapheme.
+#if defined(OS_LINUX)
model.SetText(WideToUTF16(L"\x05d5\x05b7\x05D9\x05B0\x05D4\x05B4\x05D9"));
model.MoveCursorTo(gfx::SelectionModel(0));
EXPECT_TRUE(model.Delete());
@@ -214,6 +226,7 @@
EXPECT_TRUE(model.Delete());
EXPECT_TRUE(model.Delete());
EXPECT_EQ(WideToUTF16(L""), model.GetText());
+#endif
// The first 2 characters are not strong directionality characters.
model.SetText(WideToUTF16(L"\x002C\x0020\x05D1\x05BC\x05B7\x05E9\x05BC"));
@@ -548,7 +561,7 @@
EXPECT_EQ(29U, model.GetCursorPosition());
}
-static void SelectWordTestVerifier(const TextfieldViewsModel& model,
+void SelectWordTestVerifier(TextfieldViewsModel &model,
const string16 &expected_selected_string, size_t expected_cursor_pos) {
EXPECT_EQ(expected_selected_string, model.GetSelectedText());
EXPECT_EQ(expected_cursor_pos, model.GetCursorPosition());
Property changes on: ui/views/controls/textfield/textfield_views_model_unittest.cc
___________________________________________________________________
Deleted: svn:mergeinfo
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698