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

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

Issue 2050583002: BridgedContentView: Modify IsTextRTL to use GetFirstStrongCharacterDirection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 years, 6 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_content_view.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 82a712abe53994b6d757f7bd9dfd8265e9360a93..e1604a64047fcc76db536bd87927cd2e82d01f09 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -515,21 +515,25 @@ class TextfieldTest : public ViewsTestBase, public TextfieldController {
}
}
- // Sends a platform-specific move (and select) to start of line.
+ // Sends a platform-specific move (and select) to the logical start of line.
+ // Eg. this should move (and select) to the right end of line for RTL text.
void SendHomeEvent(bool shift) {
if (TestingNativeMac()) {
- // Use Cmd+Left on native Mac. An RTL-agnostic "end" doesn't have a
- // default key-binding on Mac.
- SendKeyEvent(ui::VKEY_LEFT, shift /* shift */, true /* command */);
+ // [NSResponder moveToBeginningOfLine:] is the correct way to do this on
+ // Mac, but that doesn't have a default key binding. Since
+ // views::Textfield doesn't currently support multiple lines, the same
+ // effect can be achieved by Cmd+Up which maps to
+ // [NSResponder moveToBeginningOfDocument:].
+ SendKeyEvent(ui::VKEY_UP, shift /* shift */, true /* command */);
return;
}
SendKeyEvent(ui::VKEY_HOME, shift /* shift */, false /* control */);
}
- // Sends a platform-specific move (and select) to end of line.
+ // Sends a platform-specific move (and select) to the logical end of line.
void SendEndEvent(bool shift) {
if (TestingNativeMac()) {
- SendKeyEvent(ui::VKEY_RIGHT, shift, true); // Cmd+Right.
+ SendKeyEvent(ui::VKEY_DOWN, shift, true); // Cmd+Down.
return;
}
SendKeyEvent(ui::VKEY_END, shift, false);
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698