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

Side by Side Diff: content/browser/renderer_host/input/gesture_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 27 matching lines...) Expand all
38 queue_.reset(new GestureEventQueue(this, this, DefaultConfig())); 38 queue_.reset(new GestureEventQueue(this, this, DefaultConfig()));
39 } 39 }
40 40
41 virtual void TearDown() override { 41 virtual void TearDown() override {
42 // Process all pending tasks to avoid leaks. 42 // Process all pending tasks to avoid leaks.
43 RunUntilIdle(); 43 RunUntilIdle();
44 queue_.reset(); 44 queue_.reset();
45 } 45 }
46 46
47 // GestureEventQueueClient 47 // GestureEventQueueClient
48 virtual void SendGestureEventImmediately( 48 void SendGestureEventImmediately(
49 const GestureEventWithLatencyInfo& event) override { 49 const GestureEventWithLatencyInfo& event) override {
50 ++sent_gesture_event_count_; 50 ++sent_gesture_event_count_;
51 if (sync_ack_result_) { 51 if (sync_ack_result_) {
52 scoped_ptr<InputEventAckState> ack_result = sync_ack_result_.Pass(); 52 scoped_ptr<InputEventAckState> ack_result = sync_ack_result_.Pass();
53 SendInputEventACK(event.event.type, *ack_result); 53 SendInputEventACK(event.event.type, *ack_result);
54 } 54 }
55 } 55 }
56 56
57 virtual void OnGestureEventAck( 57 void OnGestureEventAck(const GestureEventWithLatencyInfo& event,
58 const GestureEventWithLatencyInfo& event, 58 InputEventAckState ack_result) override {
59 InputEventAckState ack_result) override {
60 ++acked_gesture_event_count_; 59 ++acked_gesture_event_count_;
61 last_acked_event_ = event.event; 60 last_acked_event_ = event.event;
62 if (sync_followup_event_) { 61 if (sync_followup_event_) {
63 auto sync_followup_event = sync_followup_event_.Pass(); 62 auto sync_followup_event = sync_followup_event_.Pass();
64 SimulateGestureEvent(*sync_followup_event); 63 SimulateGestureEvent(*sync_followup_event);
65 } 64 }
66 } 65 }
67 66
68 // TouchpadTapSuppressionControllerClient 67 // TouchpadTapSuppressionControllerClient
69 virtual void SendMouseEventImmediately( 68 void SendMouseEventImmediately(
70 const MouseEventWithLatencyInfo& event) override { 69 const MouseEventWithLatencyInfo& event) override {}
71 }
72 70
73 protected: 71 protected:
74 static GestureEventQueue::Config DefaultConfig() { 72 static GestureEventQueue::Config DefaultConfig() {
75 return GestureEventQueue::Config(); 73 return GestureEventQueue::Config();
76 } 74 }
77 75
78 void SetUpForDebounce(int interval_ms) { 76 void SetUpForDebounce(int interval_ms) {
79 queue()->set_debounce_interval_time_ms_for_testing(interval_ms); 77 queue()->set_debounce_interval_time_ms_for_testing(interval_ms);
80 } 78 }
81 79
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 WebInputEvent::GestureScrollUpdate}; 1148 WebInputEvent::GestureScrollUpdate};
1151 1149
1152 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type); 1150 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type);
1153 i++) { 1151 i++) {
1154 WebGestureEvent merged_event = GestureEventQueueEventAt(i); 1152 WebGestureEvent merged_event = GestureEventQueueEventAt(i);
1155 EXPECT_EQ(expected[i], merged_event.type); 1153 EXPECT_EQ(expected[i], merged_event.type);
1156 } 1154 }
1157 } 1155 }
1158 1156
1159 } // namespace content 1157 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/gpu_message_filter.h ('k') | content/browser/renderer_host/input/gesture_text_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698