| Index: views/controls/textfield/textfield_views_model_unittest.cc
|
| diff --git a/views/controls/textfield/textfield_views_model_unittest.cc b/views/controls/textfield/textfield_views_model_unittest.cc
|
| index 51692313396df48de9ce837ae9f0741670bf9381..99721032b0f4e7619eea414b2520f8d67920dc5c 100644
|
| --- a/views/controls/textfield/textfield_views_model_unittest.cc
|
| +++ b/views/controls/textfield/textfield_views_model_unittest.cc
|
| @@ -198,6 +198,23 @@ TEST_F(TextfieldViewsModelTest, Word) {
|
| model.Append(
|
| ASCIIToUTF16("The answer to Life, the Universe, and Everything"));
|
| model.MoveCursorRight(gfx::WORD_BREAK, false);
|
| +#if defined(OS_WIN)
|
| + // TODO(msw): Revise word break algorithms and improve tests.
|
| + // Breaks are at "|The |answer |to |Life, |the |Universe, |and |Everything".
|
| + EXPECT_EQ(4U, model.GetCursorPosition());
|
| + model.MoveCursorRight(gfx::WORD_BREAK, false);
|
| + EXPECT_EQ(11U, model.GetCursorPosition());
|
| + model.MoveCursorRight(gfx::WORD_BREAK, false);
|
| + model.MoveCursorRight(gfx::WORD_BREAK, false);
|
| + EXPECT_EQ(20U, model.GetCursorPosition());
|
| +
|
| + model.MoveCursorLeft(gfx::CHARACTER_BREAK, false);
|
| + model.MoveCursorLeft(gfx::CHARACTER_BREAK, false);
|
| + // Should pass the non word char ',', but stop at ", |the |".
|
| + model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| + model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| + model.MoveCursorLeft(gfx::CHARACTER_BREAK, true);
|
| +#else
|
| EXPECT_EQ(3U, model.GetCursorPosition());
|
| model.MoveCursorRight(gfx::WORD_BREAK, false);
|
| EXPECT_EQ(10U, model.GetCursorPosition());
|
| @@ -205,8 +222,9 @@ TEST_F(TextfieldViewsModelTest, Word) {
|
| model.MoveCursorRight(gfx::WORD_BREAK, false);
|
| EXPECT_EQ(18U, model.GetCursorPosition());
|
|
|
| - // Should passes the non word char ','
|
| + // Should pass the non word char ','.
|
| model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| +#endif
|
| EXPECT_EQ(23U, model.GetCursorPosition());
|
| EXPECT_STR_EQ(", the", model.GetSelectedText());
|
|
|
| @@ -214,6 +232,11 @@ TEST_F(TextfieldViewsModelTest, Word) {
|
| model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| +#if defined(OS_WIN)
|
| + // TODO(msw): Revise word break algorithms and improve tests.
|
| + // Breaks are at "|The |answer |to |Life, |the |Universe, |and |Everything".
|
| + model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| +#endif
|
| EXPECT_STR_EQ(", the Universe, and Everything", model.GetSelectedText());
|
| // Should be safe to go next word at the end.
|
| model.MoveCursorRight(gfx::WORD_BREAK, true);
|
| @@ -375,13 +398,25 @@ TEST_F(TextfieldViewsModelTest, RangeTest) {
|
| EXPECT_FALSE(range.is_empty());
|
| EXPECT_FALSE(range.is_reversed());
|
| EXPECT_EQ(0U, range.start());
|
| +#if defined(OS_WIN)
|
| + // TODO(msw): Revise word break algorithms and improve tests.
|
| + // The current breaks are at "|HELLO |WORLD|".
|
| + EXPECT_EQ(6U, range.end());
|
| +#else
|
| EXPECT_EQ(5U, range.end());
|
| +#endif
|
|
|
| model.MoveCursorLeft(gfx::CHARACTER_BREAK, true);
|
| model.GetSelectedRange(&range);
|
| EXPECT_FALSE(range.is_empty());
|
| EXPECT_EQ(0U, range.start());
|
| +#if defined(OS_WIN)
|
| + // TODO(msw): Revise word break algorithms and improve tests.
|
| + // The current breaks are at "|HELLO |WORLD|".
|
| + EXPECT_EQ(5U, range.end());
|
| +#else
|
| EXPECT_EQ(4U, range.end());
|
| +#endif
|
|
|
| model.MoveCursorLeft(gfx::WORD_BREAK, true);
|
| model.GetSelectedRange(&range);
|
|
|