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

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

Issue 2228833002: MacViews: Fix behavior of move and select commands when selection direction changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_text_commands
Patch Set: Created 4 years, 4 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 affd8dc47159c6d0273660df2bac6fd74e2163d5..c95d0c1a97646cd5dd48cd0a41f408370bc087e7 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -832,7 +832,13 @@ TEST_F(TextfieldTest, ControlAndSelectTest) {
SendEndEvent(true);
EXPECT_STR_EQ("two three", textfield_->GetSelectedText());
SendHomeEvent(true);
+
+ // On Mac, the existing selection should be extended.
+#if defined(OS_MACOSX)
+ EXPECT_STR_EQ("ZERO two three", textfield_->GetSelectedText());
+#else
EXPECT_STR_EQ("ZERO ", textfield_->GetSelectedText());
+#endif
}
TEST_F(TextfieldTest, InsertionDeletionTest) {

Powered by Google App Engine
This is Rietveld 408576698