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

Unified Diff: ui/events/test/cocoa_test_event_utils.mm

Issue 2095283002: MacViews: Don't handle character events in textfield_unittest's MockInputMethod::DispatchKeyEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: ui/events/test/cocoa_test_event_utils.mm
diff --git a/ui/events/test/cocoa_test_event_utils.mm b/ui/events/test/cocoa_test_event_utils.mm
index 9810d589419b6f6a1f2ebd1b6d01313e80cef5c5..5cd47568403b1d8e37da249f556228206d5e2ce6 100644
--- a/ui/events/test/cocoa_test_event_utils.mm
+++ b/ui/events/test/cocoa_test_event_utils.mm
@@ -203,6 +203,12 @@ NSEvent* SynthesizeKeyEvent(NSWindow* window,
// logic to support it.
flags &= ~NSAlphaShiftKeyMask;
+ // Call sites may generate unicode character events with an undefined
+ // keycode. Since it's not feasible to determine the correct keycode for
+ // each unicode character, we use a dummy keycode corresponding to key 'A'.
tapted 2016/06/29 07:21:39 (also this probably only really matters for things
karandeepb 2016/06/29 07:54:07 I didn't get the bit about NSCommandKeyMask. This
+ if (dom_key.IsCharacter() && keycode == ui::VKEY_UNKNOWN)
+ keycode = ui::VKEY_A;
+
unichar character;
unichar shifted_character;
int macKeycode = ui::MacKeyCodeForWindowsKeyCode(
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield_unittest.cc » ('j') | ui/views/controls/textfield/textfield_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698