Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| index aba2b57322ef07d0fe0960cff38befe6ac9c07b5..949e7210975a86ac029b649038df1fa270f66031 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| @@ -446,6 +446,8 @@ class RenderWidgetHostViewAuraTest : public testing::Test { |
| InputHostMsg_HandleInputEvent_ACK_Params ack; |
| ack.type = type; |
| ack.state = ack_result; |
| + if (WebInputEvent::isTouchEventType(type)) |
| + ack.unique_touch_event_id = last_send_event_id_; |
| InputHostMsg_HandleInputEvent_ACK response(0, ack); |
| widget_host_->OnMessageReceived(response); |
| } |
| @@ -466,12 +468,14 @@ class RenderWidgetHostViewAuraTest : public testing::Test { |
| return; |
| } |
| - if (WebInputEventTraits::IgnoresAckDisposition(*get<0>(params))) |
| + if (!WebInputEventTraits::WillReceiveAckFromRenderer(*get<0>(params))) |
| return; |
| SendInputEventACK(get<0>(params)->type, ack_result); |
| } |
| + void SetLastSentEventID(uint32 event_id) { last_send_event_id_ = event_id; } |
| + |
| protected: |
| // If true, then calls RWH::Shutdown() instead of deleting RWH. |
| bool widget_host_uses_shutdown_to_destroy_; |
| @@ -497,6 +501,8 @@ class RenderWidgetHostViewAuraTest : public testing::Test { |
| IPC::TestSink* sink_; |
| + uint32 last_send_event_id_; |
|
jdduke (slow)
2015/05/01 19:11:09
Nit: last_sent
lanwei
2015/05/07 04:11:37
Done.
|
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAuraTest); |
| }; |
| @@ -699,6 +705,7 @@ class RenderWidgetHostViewAuraOverscrollTest |
| void SendTouchEvent() { |
| widget_host_->ForwardTouchEventWithLatencyInfo(touch_event_, |
| ui::LatencyInfo()); |
| + last_send_event_id_ = touch_event_.uniqueTouchEventId; |
|
jdduke (slow)
2015/05/01 19:11:09
Hmm, but what if touches are still in the queue? O
|
| touch_event_.ResetPoints(); |
| } |
| @@ -3312,12 +3319,14 @@ TEST_F(RenderWidgetHostViewAuraTest, CorrectNumberOfAcksAreDispatched) { |
| ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0, ui::EventTimeForNow()); |
| view_->OnTouchEvent(&press1); |
| + SetLastSentEventID(press1.unique_event_id()); |
| SendInputEventACK(blink::WebInputEvent::TouchStart, |
| INPUT_EVENT_ACK_STATE_CONSUMED); |
| ui::TouchEvent press2( |
| ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), 1, ui::EventTimeForNow()); |
| view_->OnTouchEvent(&press2); |
| + SetLastSentEventID(press2.unique_event_id()); |
| SendInputEventACK(blink::WebInputEvent::TouchStart, |
| INPUT_EVENT_ACK_STATE_CONSUMED); |