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

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

Issue 1779743004: MacViews: Fix MenuRunnerTest.NonLatinMnemonic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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/events/test/cocoa_test_event_utils.h ('k') | ui/views/test/event_generator_delegate_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6c7819f8f1a486809f3f04c43479d235949cc249..9810d589419b6f6a1f2ebd1b6d01313e80cef5c5 100644
--- a/ui/events/test/cocoa_test_event_utils.mm
+++ b/ui/events/test/cocoa_test_event_utils.mm
@@ -190,7 +190,8 @@ NSTimeInterval TimeIntervalSinceSystemStartup() {
NSEvent* SynthesizeKeyEvent(NSWindow* window,
bool keyDown,
ui::KeyboardCode keycode,
- NSUInteger flags) {
+ NSUInteger flags,
+ ui::DomKey dom_key) {
// If caps lock is set for an alpha keycode, treat it as if shift was pressed.
// Note on Mac (unlike other platforms) shift while caps is down does not go
// back to lowercase.
@@ -210,6 +211,11 @@ NSEvent* SynthesizeKeyEvent(NSWindow* window,
if (macKeycode < 0)
return nil;
+ // If an explicit unicode character is provided, use that instead of the one
+ // derived from the keycode.
+ if (dom_key.IsCharacter())
+ shifted_character = dom_key.ToCharacter();
+
// Note that, in line with AppKit's documentation (and tracing "real" events),
// -[NSEvent charactersIngoringModifiers]" are "the characters generated by
// the receiving key event as if no modifier key (except for Shift)".
« no previous file with comments | « ui/events/test/cocoa_test_event_utils.h ('k') | ui/views/test/event_generator_delegate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698