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

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

Issue 1847823005: Fix Event Latency Info on generate gesture events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove debugging 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mouse_wheel_event_queue.h" 5 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // MouseWheelEventQueueClient 129 // MouseWheelEventQueueClient
130 void SendMouseWheelEventImmediately( 130 void SendMouseWheelEventImmediately(
131 const MouseWheelEventWithLatencyInfo& event) override { 131 const MouseWheelEventWithLatencyInfo& event) override {
132 WebMouseWheelEvent* cloned_event = new WebMouseWheelEvent(); 132 WebMouseWheelEvent* cloned_event = new WebMouseWheelEvent();
133 scoped_ptr<WebInputEvent> cloned_event_holder(cloned_event); 133 scoped_ptr<WebInputEvent> cloned_event_holder(cloned_event);
134 *cloned_event = event.event; 134 *cloned_event = event.event;
135 sent_events_.push_back(std::move(cloned_event_holder)); 135 sent_events_.push_back(std::move(cloned_event_holder));
136 } 136 }
137 137
138 void SendGestureEvent(const GestureEventWithLatencyInfo& event) override { 138 void ForwardGestureEvent(const blink::WebGestureEvent& event) override {
139 WebGestureEvent* cloned_event = new WebGestureEvent(); 139 WebGestureEvent* cloned_event = new WebGestureEvent();
140 scoped_ptr<WebInputEvent> cloned_event_holder(cloned_event); 140 scoped_ptr<WebInputEvent> cloned_event_holder(cloned_event);
141 *cloned_event = event.event; 141 *cloned_event = event;
142 sent_events_.push_back(std::move(cloned_event_holder)); 142 sent_events_.push_back(std::move(cloned_event_holder));
143 } 143 }
144 144
145 void OnMouseWheelEventAck(const MouseWheelEventWithLatencyInfo& event, 145 void OnMouseWheelEventAck(const MouseWheelEventWithLatencyInfo& event,
146 InputEventAckState ack_result) override { 146 InputEventAckState ack_result) override {
147 ++acked_event_count_; 147 ++acked_event_count_;
148 last_acked_event_ = event.event; 148 last_acked_event_ = event.event;
149 last_acked_event_state_ = ack_result; 149 last_acked_event_state_ = ack_result;
150 } 150 }
151 151
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 EXPECT_EQ(1U, GetAndResetAckedEventCount()); 536 EXPECT_EQ(1U, GetAndResetAckedEventCount());
537 EXPECT_EQ(2U, all_sent_events().size()); 537 EXPECT_EQ(2U, all_sent_events().size());
538 EXPECT_GESTURE_SCROLL_BEGIN(sent_gesture_event(0)); 538 EXPECT_GESTURE_SCROLL_BEGIN(sent_gesture_event(0));
539 EXPECT_GESTURE_SCROLL_UPDATE(sent_gesture_event(1)); 539 EXPECT_GESTURE_SCROLL_UPDATE(sent_gesture_event(1));
540 EXPECT_EQ(0U, sent_gesture_event(1)->data.scrollUpdate.deltaX); 540 EXPECT_EQ(0U, sent_gesture_event(1)->data.scrollUpdate.deltaX);
541 EXPECT_EQ(1U, sent_gesture_event(1)->data.scrollUpdate.deltaY); 541 EXPECT_EQ(1U, sent_gesture_event(1)->data.scrollUpdate.deltaY);
542 EXPECT_EQ(2U, GetAndResetSentEventCount()); 542 EXPECT_EQ(2U, GetAndResetSentEventCount());
543 } 543 }
544 544
545 } // namespace content 545 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698