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

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

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/browser/renderer_host/input/timeout_monitor.h" 9 #include "content/browser/renderer_host/input/timeout_monitor.h"
10 #include "content/browser/renderer_host/input/touch_event_queue.h" 10 #include "content/browser/renderer_host/input/touch_event_queue.h"
(...skipping 29 matching lines...) Expand all
40 virtual ~TouchEventQueueTest() {} 40 virtual ~TouchEventQueueTest() {}
41 41
42 // testing::Test 42 // testing::Test
43 virtual void SetUp() override { ResetQueueWithConfig(CreateConfig()); } 43 virtual void SetUp() override { ResetQueueWithConfig(CreateConfig()); }
44 44
45 virtual void TearDown() override { 45 virtual void TearDown() override {
46 queue_.reset(); 46 queue_.reset();
47 } 47 }
48 48
49 // TouchEventQueueClient 49 // TouchEventQueueClient
50 virtual void SendTouchEventImmediately( 50 void SendTouchEventImmediately(
51 const TouchEventWithLatencyInfo& event) override { 51 const TouchEventWithLatencyInfo& event) override {
52 ++sent_event_count_; 52 ++sent_event_count_;
53 last_sent_event_ = event.event; 53 last_sent_event_ = event.event;
54 if (sync_ack_result_) { 54 if (sync_ack_result_) {
55 auto sync_ack_result = sync_ack_result_.Pass(); 55 auto sync_ack_result = sync_ack_result_.Pass();
56 SendTouchEventAck(*sync_ack_result); 56 SendTouchEventAck(*sync_ack_result);
57 } 57 }
58 } 58 }
59 59
60 virtual void OnTouchEventAck( 60 void OnTouchEventAck(const TouchEventWithLatencyInfo& event,
61 const TouchEventWithLatencyInfo& event, 61 InputEventAckState ack_result) override {
62 InputEventAckState ack_result) override {
63 ++acked_event_count_; 62 ++acked_event_count_;
64 last_acked_event_ = event.event; 63 last_acked_event_ = event.event;
65 last_acked_event_state_ = ack_result; 64 last_acked_event_state_ = ack_result;
66 if (followup_touch_event_) { 65 if (followup_touch_event_) {
67 scoped_ptr<WebTouchEvent> followup_touch_event = 66 scoped_ptr<WebTouchEvent> followup_touch_event =
68 followup_touch_event_.Pass(); 67 followup_touch_event_.Pass();
69 SendTouchEvent(*followup_touch_event); 68 SendTouchEvent(*followup_touch_event);
70 } 69 }
71 if (followup_gesture_event_) { 70 if (followup_gesture_event_) {
72 scoped_ptr<WebGestureEvent> followup_gesture_event = 71 scoped_ptr<WebGestureEvent> followup_gesture_event =
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 2221
2223 // Give the touchmove a valid id; it should be sent. 2222 // Give the touchmove a valid id; it should be sent.
2224 event.touches[0].id = press_id; 2223 event.touches[0].id = press_id;
2225 SendTouchEvent(event); 2224 SendTouchEvent(event);
2226 EXPECT_EQ(1U, GetAndResetSentEventCount()); 2225 EXPECT_EQ(1U, GetAndResetSentEventCount());
2227 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); 2226 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED);
2228 EXPECT_EQ(1U, GetAndResetAckedEventCount()); 2227 EXPECT_EQ(1U, GetAndResetAckedEventCount());
2229 } 2228 }
2230 2229
2231 } // namespace content 2230 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698