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

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: DCHECK in EventExecutors if the USB keycode is missing Created 8 years, 4 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: remoting/host/client_session_unittest.cc
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index 84783bbea8973d1becb5724f7312257ec5ae6d9f..4b109635a33a86d361615a1ad67bbf4736fd558a 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -115,8 +115,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, "") {
@@ -130,19 +131,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);
@@ -159,8 +160,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(_));
@@ -219,11 +220,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);
@@ -232,12 +233,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(_));

Powered by Google App Engine
This is Rietveld 408576698