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

Side by Side Diff: content/browser/renderer_host/input/mock_input_ack_handler.cc

Issue 24312009: Properly forward queued touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/input/mock_input_ack_handler.h" 5 #include "content/browser/renderer_host/input/mock_input_ack_handler.h"
6 6
7 #include "content/browser/renderer_host/input/input_router.h" 7 #include "content/browser/renderer_host/input/input_router.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using base::TimeDelta; 10 using base::TimeDelta;
(...skipping 30 matching lines...) Expand all
41 RecordAckCalled(ack_result); 41 RecordAckCalled(ack_result);
42 } 42 }
43 43
44 void MockInputAckHandler::OnTouchEventAck( 44 void MockInputAckHandler::OnTouchEventAck(
45 const TouchEventWithLatencyInfo& event, 45 const TouchEventWithLatencyInfo& event,
46 InputEventAckState ack_result) { 46 InputEventAckState ack_result) {
47 VLOG(1) << __FUNCTION__ << " called!"; 47 VLOG(1) << __FUNCTION__ << " called!";
48 acked_touch_event_ = event; 48 acked_touch_event_ = event;
49 RecordAckCalled(ack_result); 49 RecordAckCalled(ack_result);
50 if (touch_followup_event_) 50 if (touch_followup_event_)
51 input_router_->SendGestureEvent(*touch_followup_event_); 51 input_router_->SendTouchEvent(*touch_followup_event_);
52 if (gesture_followup_event_)
53 input_router_->SendGestureEvent(*gesture_followup_event_);
52 } 54 }
53 55
54 void MockInputAckHandler::OnGestureEventAck( 56 void MockInputAckHandler::OnGestureEventAck(
55 const WebGestureEvent& event, 57 const WebGestureEvent& event,
56 InputEventAckState ack_result) { 58 InputEventAckState ack_result) {
57 VLOG(1) << __FUNCTION__ << " called!"; 59 VLOG(1) << __FUNCTION__ << " called!";
58 acked_gesture_event_ = event; 60 acked_gesture_event_ = event;
59 RecordAckCalled(ack_result); 61 RecordAckCalled(ack_result);
60 } 62 }
61 63
62 void MockInputAckHandler::OnUnexpectedEventAck(UnexpectedEventAckType type) { 64 void MockInputAckHandler::OnUnexpectedEventAck(UnexpectedEventAckType type) {
63 VLOG(1) << __FUNCTION__ << " called!"; 65 VLOG(1) << __FUNCTION__ << " called!";
64 unexpected_event_ack_called_ = true; 66 unexpected_event_ack_called_ = true;
65 } 67 }
66 68
67 void MockInputAckHandler::ExpectAckCalled(int times) { 69 void MockInputAckHandler::ExpectAckCalled(int times) {
68 EXPECT_EQ(times, ack_count_); 70 EXPECT_EQ(times, ack_count_);
69 ack_count_ = 0; 71 ack_count_ = 0;
70 } 72 }
71 73
72 void MockInputAckHandler::RecordAckCalled(InputEventAckState ack_result) { 74 void MockInputAckHandler::RecordAckCalled(InputEventAckState ack_result) {
73 ++ack_count_; 75 ++ack_count_;
74 ack_state_ = ack_result; 76 ack_state_ = ack_result;
75 } 77 }
76 78
77 } // namespace content 79 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/mock_input_ack_handler.h ('k') | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698