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

Unified Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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: content/browser/renderer_host/render_widget_host_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 2fd0ea5497e5d0167f678e7ead865d39a324e9c7..3d4df7f4105145b279ddcb0e5a8415beb0799792 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -1523,24 +1523,24 @@ TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) {
EXPECT_TRUE(host_->mock_input_router()->message_received_);
}
-ui::LatencyInfo GetLatencyInfoFromInputEvent(RenderWidgetHostProcess* process) {
- const IPC::Message* message = process->sink().GetUniqueMessageMatching(
- InputMsg_HandleInputEvent::ID);
- EXPECT_TRUE(message);
+void CheckLatencyInfoComponentInMessage(RenderWidgetHostProcess* process,
+ int64_t component_id,
+ WebInputEvent::Type expected_type) {
+ EXPECT_EQ(process->sink().message_count(), 1U);
+
+ const IPC::Message* message = process->sink().GetMessageAt(0);
+ EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type());
InputMsg_HandleInputEvent::Param params;
EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, &params));
- process->sink().ClearMessages();
- return base::get<1>(params);
-}
-void CheckLatencyInfoComponentInMessage(RenderWidgetHostProcess* process,
- int64_t component_id,
- WebInputEvent::Type input_type) {
- ui::LatencyInfo latency_info = GetLatencyInfoFromInputEvent(process);
+ const WebInputEvent* event = base::get<0>(params);
+ ui::LatencyInfo latency_info = base::get<1>(params);
+
+ EXPECT_TRUE(event->type == expected_type);
EXPECT_TRUE(latency_info.FindLatency(
- ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- component_id,
- NULL));
+ ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL));
+
+ process->sink().ClearMessages();
}
// Tests that after input event passes through RWHI through ForwardXXXEvent()

Powered by Google App Engine
This is Rietveld 408576698