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

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

Issue 1989143002: MacViews: Correct behavior of move and select commands when selection direction changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_commands
Patch Set: Created 4 years, 7 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
Index: ui/views/controls/textfield/textfield_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 82a712abe53994b6d757f7bd9dfd8265e9360a93..b8d02e52f7837c95d2bc05c4b492e02832727fa8 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -808,7 +808,14 @@ TEST_F(TextfieldTest, ControlAndSelectTest) {
SendEndEvent(true);
EXPECT_STR_EQ("two three", textfield_->GetSelectedText());
SendHomeEvent(true);
+
+// On Mac, moving to beginning of line while selecting, extends the existing
tapted 2016/05/20 06:47:36 It's possible some of the existing behaviours are
karandeepb 2016/05/24 07:47:15 Have checked this, the existing behavior is correc
+// selection.
+#if defined(OS_MACOSX)
+ EXPECT_STR_EQ("ZERO two three", textfield_->text());
+#else
EXPECT_STR_EQ("ZERO ", textfield_->GetSelectedText());
+#endif
}
TEST_F(TextfieldTest, InsertionDeletionTest) {

Powered by Google App Engine
This is Rietveld 408576698