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

Side by Side Diff: content/browser/renderer_host/web_input_event_aura_unittest.cc

Issue 1284433002: Revise ui::DomKey to unify character and non-character codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsDead Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/web_input_event_aura.h" 5 #include "content/browser/renderer_host/web_input_event_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #elif defined(OS_WIN) 128 #elif defined(OS_WIN)
129 // TODO(yusukes): Add tests for win_aura once keyboardEvent() in 129 // TODO(yusukes): Add tests for win_aura once keyboardEvent() in
130 // third_party/WebKit/Source/web/win/WebInputEventFactory.cpp is modified 130 // third_party/WebKit/Source/web/win/WebInputEventFactory.cpp is modified
131 // to return VKEY_[LR]XXX instead of VKEY_XXX. 131 // to return VKEY_[LR]XXX instead of VKEY_XXX.
132 // https://bugs.webkit.org/show_bug.cgi?id=86694 132 // https://bugs.webkit.org/show_bug.cgi?id=86694
133 #endif 133 #endif
134 { 134 {
135 // Press left Ctrl. 135 // Press left Ctrl.
136 ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_CONTROL, 136 ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_CONTROL,
137 ui::DomCode::CONTROL_LEFT, ui::EF_CONTROL_DOWN, 137 ui::DomCode::CONTROL_LEFT, ui::EF_CONTROL_DOWN,
138 ui::DomKey::CONTROL, 0, ui::EventTimeForNow()); 138 ui::DomKey::CONTROL, ui::EventTimeForNow());
139 blink::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(event); 139 blink::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(event);
140 // ui::VKEY_LCONTROL, instead of ui::VKEY_CONTROL, should be filled. 140 // ui::VKEY_LCONTROL, instead of ui::VKEY_CONTROL, should be filled.
141 EXPECT_EQ(ui::VKEY_LCONTROL, webkit_event.windowsKeyCode); 141 EXPECT_EQ(ui::VKEY_LCONTROL, webkit_event.windowsKeyCode);
142 } 142 }
143 { 143 {
144 // Press right Ctrl. 144 // Press right Ctrl.
145 ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_CONTROL, 145 ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_CONTROL,
146 ui::DomCode::CONTROL_RIGHT, ui::EF_CONTROL_DOWN, 146 ui::DomCode::CONTROL_RIGHT, ui::EF_CONTROL_DOWN,
147 ui::DomKey::CONTROL, 0, ui::EventTimeForNow()); 147 ui::DomKey::CONTROL, ui::EventTimeForNow());
148 blink::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(event); 148 blink::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(event);
149 // ui::VKEY_RCONTROL, instead of ui::VKEY_CONTROL, should be filled. 149 // ui::VKEY_RCONTROL, instead of ui::VKEY_CONTROL, should be filled.
150 EXPECT_EQ(ui::VKEY_RCONTROL, webkit_event.windowsKeyCode); 150 EXPECT_EQ(ui::VKEY_RCONTROL, webkit_event.windowsKeyCode);
151 } 151 }
152 } 152 }
153 153
154 // Checks that MakeWebKeyboardEvent fills a correct keypad modifier. 154 // Checks that MakeWebKeyboardEvent fills a correct keypad modifier.
155 TEST(WebInputEventAuraTest, TestMakeWebKeyboardEventKeyPadKeyCode) { 155 TEST(WebInputEventAuraTest, TestMakeWebKeyboardEventKeyPadKeyCode) {
156 #if defined(USE_X11) 156 #if defined(USE_X11)
157 #define XK(x) XK_##x 157 #define XK(x) XK_##x
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 << "{dom_code:" 240 << "{dom_code:"
241 << ui::KeycodeConverter::DomCodeToCodeString(test_case.dom_code) 241 << ui::KeycodeConverter::DomCodeToCodeString(test_case.dom_code)
242 << ", ui_keycode:" << test_case.ui_keycode 242 << ", ui_keycode:" << test_case.ui_keycode
243 << ", x_keysym:" << test_case.x_keysym 243 << ", x_keysym:" << test_case.x_keysym
244 << "}, expect: " << test_case.expected_result; 244 << "}, expect: " << test_case.expected_result;
245 } 245 }
246 #endif 246 #endif
247 } 247 }
248 248
249 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/keycode_text_conversion_ozone.cc ('k') | ui/base/ime/chromeos/character_composer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698