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 1907253002: MacViews: Implement move and move*AndModifySelection commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. 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
« no previous file with comments | « ui/views/cocoa/bridged_native_widget_unittest.mm ('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_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index be3f3bbe52c579aa1d0d581d3122f88ff92e81d4..82a712abe53994b6d757f7bd9dfd8265e9360a93 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -992,7 +992,7 @@ TEST_F(TextfieldTest, OnKeyPress) {
EXPECT_TRUE(textfield_->key_handled());
textfield_->clear();
- // F20, up/down key won't be handled.
+ // F20 key won't be handled.
SendKeyEvent(ui::VKEY_F20);
#if defined(OS_MACOSX)
// On Mac, key combinations that don't map to editing commands are forwarded
@@ -1004,14 +1004,24 @@ TEST_F(TextfieldTest, OnKeyPress) {
EXPECT_FALSE(textfield_->key_handled());
textfield_->clear();
+ // Up/Down keys won't be handled except on Mac where they map to move
+ // commands.
SendKeyEvent(ui::VKEY_UP);
EXPECT_TRUE(textfield_->key_received());
+#if defined(OS_MACOSX)
+ EXPECT_TRUE(textfield_->key_handled());
+#else
EXPECT_FALSE(textfield_->key_handled());
+#endif
textfield_->clear();
SendKeyEvent(ui::VKEY_DOWN);
EXPECT_TRUE(textfield_->key_received());
+#if defined(OS_MACOSX)
+ EXPECT_TRUE(textfield_->key_handled());
+#else
EXPECT_FALSE(textfield_->key_handled());
+#endif
textfield_->clear();
}
« no previous file with comments | « ui/views/cocoa/bridged_native_widget_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698