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

Unified Diff: remoting/host/client_session_unittest.cc

Issue 10894050: Remove support for Windows-style keycodes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux EventExecutor typo. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.cc ('k') | remoting/host/event_executor_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session_unittest.cc
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index bf54230d2223fb3f12d4ce38c97c22d4d0d1a8d5..bc41d67c94c71754c485e3f21557a9083158847d 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -116,8 +116,9 @@ TEST_F(ClientSessionTest, ClipboardStubFilter) {
connection_->clipboard_stub()->InjectClipboardEvent(clipboard_event3);
}
-MATCHER_P2(EqualsKeyEvent, keycode, pressed, "") {
- return arg.keycode() == keycode && arg.pressed() == pressed;
+MATCHER_P2(EqualsUsbEvent, usb_keycode, pressed, "") {
+ return arg.usb_keycode() == (unsigned int)usb_keycode &&
+ arg.pressed() == pressed;
}
MATCHER_P2(EqualsMouseEvent, x, y, "") {
@@ -131,19 +132,19 @@ MATCHER_P2(EqualsMouseButtonEvent, button, down, "") {
TEST_F(ClientSessionTest, InputStubFilter) {
protocol::KeyEvent key_event1;
key_event1.set_pressed(true);
- key_event1.set_keycode(1);
+ key_event1.set_usb_keycode(1);
protocol::KeyEvent key_event2_down;
key_event2_down.set_pressed(true);
- key_event2_down.set_keycode(2);
+ key_event2_down.set_usb_keycode(2);
protocol::KeyEvent key_event2_up;
key_event2_up.set_pressed(false);
- key_event2_up.set_keycode(2);
+ key_event2_up.set_usb_keycode(2);
protocol::KeyEvent key_event3;
key_event3.set_pressed(true);
- key_event3.set_keycode(3);
+ key_event3.set_usb_keycode(3);
protocol::MouseEvent mouse_event1;
mouse_event1.set_x(100);
@@ -160,8 +161,8 @@ TEST_F(ClientSessionTest, InputStubFilter) {
InSequence s;
EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_));
EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_));
- EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(2, true)));
- EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(2, false)));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsUsbEvent(2, true)));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsUsbEvent(2, false)));
EXPECT_CALL(host_input_stub_, InjectMouseEvent(EqualsMouseEvent(200, 201)));
EXPECT_CALL(session_event_handler_, OnSessionClosed(_));
@@ -220,11 +221,11 @@ TEST_F(ClientSessionTest, LocalInputTest) {
TEST_F(ClientSessionTest, RestoreEventState) {
protocol::KeyEvent key1;
key1.set_pressed(true);
- key1.set_keycode(1);
+ key1.set_usb_keycode(1);
protocol::KeyEvent key2;
key2.set_pressed(true);
- key2.set_keycode(2);
+ key2.set_usb_keycode(2);
protocol::MouseEvent mousedown;
mousedown.set_button(protocol::MouseEvent::BUTTON_LEFT);
@@ -233,12 +234,12 @@ TEST_F(ClientSessionTest, RestoreEventState) {
InSequence s;
EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_));
EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_));
- EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(1, true)));
- EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(2, true)));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsUsbEvent(1, true)));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsUsbEvent(2, true)));
EXPECT_CALL(host_input_stub_, InjectMouseEvent(EqualsMouseButtonEvent(
protocol::MouseEvent::BUTTON_LEFT, true)));
- EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(1, false)));
- EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(2, false)));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsUsbEvent(1, false)));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsUsbEvent(2, false)));
EXPECT_CALL(host_input_stub_, InjectMouseEvent(EqualsMouseButtonEvent(
protocol::MouseEvent::BUTTON_LEFT, false)));
EXPECT_CALL(session_event_handler_, OnSessionClosed(_));
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.cc ('k') | remoting/host/event_executor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698