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

Unified Diff: content/renderer/input/input_event_filter_unittest.cc

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 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 | « content/renderer/input/input_event_filter.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/input_event_filter_unittest.cc
===================================================================
--- content/renderer/input/input_event_filter_unittest.cc (revision 270218)
+++ content/renderer/input/input_event_filter_unittest.cc (working copy)
@@ -178,13 +178,11 @@
EXPECT_EQ(kTestRoutingID, message->routing_id());
EXPECT_EQ(InputHostMsg_HandleInputEvent_ACK::ID, message->type());
- WebInputEvent::Type event_type = WebInputEvent::Undefined;
- InputEventAckState ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
- ui::LatencyInfo latency_info;
- EXPECT_TRUE(InputHostMsg_HandleInputEvent_ACK::Read(message,
- &event_type,
- &ack_result,
- &latency_info));
+ InputHostMsg_HandleInputEvent_ACK::Param params;
+ EXPECT_TRUE(InputHostMsg_HandleInputEvent_ACK::Read(message, &params));
+ WebInputEvent::Type event_type = params.a;
+ InputEventAckState ack_result = params.b;
+
EXPECT_EQ(kEvents[i].type, event_type);
EXPECT_EQ(ack_result, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
@@ -206,11 +204,9 @@
const IPC::Message& message = message_recorder_.message_at(i);
ASSERT_EQ(InputMsg_HandleInputEvent::ID, message.type());
- const WebInputEvent* event = NULL;
- ui::LatencyInfo latency_info;
- bool is_kbd_shortcut;
- EXPECT_TRUE(InputMsg_HandleInputEvent::Read(
- &message, &event, &latency_info, &is_kbd_shortcut));
+ InputMsg_HandleInputEvent::Param params;
+ EXPECT_TRUE(InputMsg_HandleInputEvent::Read(&message, &params));
+ const WebInputEvent* event = params.a;
EXPECT_EQ(kEvents[i].size, event->size);
EXPECT_TRUE(memcmp(&kEvents[i], event, event->size) == 0);
@@ -234,13 +230,10 @@
EXPECT_EQ(kTestRoutingID, message->routing_id());
EXPECT_EQ(InputHostMsg_HandleInputEvent_ACK::ID, message->type());
- WebInputEvent::Type event_type = WebInputEvent::Undefined;
- InputEventAckState ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
- ui::LatencyInfo latency_info;
- EXPECT_TRUE(InputHostMsg_HandleInputEvent_ACK::Read(message,
- &event_type,
- &ack_result,
- &latency_info));
+ InputHostMsg_HandleInputEvent_ACK::Param params;
+ EXPECT_TRUE(InputHostMsg_HandleInputEvent_ACK::Read(message, &params));
+ WebInputEvent::Type event_type = params.a;
+ InputEventAckState ack_result = params.b;
EXPECT_EQ(kEvents[i].type, event_type);
EXPECT_EQ(ack_result, INPUT_EVENT_ACK_STATE_CONSUMED);
}
« no previous file with comments | « content/renderer/input/input_event_filter.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698