Index: ui/events/test/events_test_utils_x11.cc |
diff --git a/ui/events/test/events_test_utils_x11.cc b/ui/events/test/events_test_utils_x11.cc |
index 40d5d4a0dbb0274349f328c4309b811ec2a06af7..622684de93659fb66ce43839710710d1ccacb721 100644 |
--- a/ui/events/test/events_test_utils_x11.cc |
+++ b/ui/events/test/events_test_utils_x11.cc |
@@ -63,12 +63,11 @@ int XIButtonEventType(ui::EventType type) { |
unsigned int XKeyEventKeyCode(ui::KeyboardCode key_code, |
int flags, |
XDisplay* display) { |
- const int keysym = XKeysymForWindowsKeyCode(key_code, |
- flags & ui::EF_SHIFT_DOWN); |
- // Tests assume the keycode for XK_less is equal to the one of XK_comma, |
- // but XKeysymToKeycode returns 94 for XK_less while it returns 59 for |
- // XK_comma. Here we convert the value for XK_less to the value for XK_comma. |
- return (keysym == XK_less) ? 59 : XKeysymToKeycode(display, keysym); |
+ // XKeyEvent keycode is hardware keycode which doesn't consider SHIFT state. |
+ // There are bugs in XKeysymToKeycode that it returns wrong keycode for keysym |
+ // with SHIFT state. e.g. XK_less should return 59 but returns 94; |
+ // XK_parenright should return 19 but returns 188; etc. |
+ return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); |
} |
// Converts Aura event type and flag to X button event. |