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

Side by Side Diff: content/renderer/input/main_thread_event_queue_unittest.cc

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <new> 7 #include <new>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 feature_list_.InitFromCommandLine(base::JoinString(features, ","), 63 feature_list_.InitFromCommandLine(base::JoinString(features, ","),
64 std::string()); 64 std::string());
65 } 65 }
66 66
67 void SetUp() override { 67 void SetUp() override {
68 queue_ = new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_, 68 queue_ = new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_,
69 &renderer_scheduler_); 69 &renderer_scheduler_);
70 } 70 }
71 71
72 void HandleEventOnMainThread(int routing_id, 72 void HandleEventOnMainThread(
73 const blink::WebInputEvent* event, 73 int routing_id,
74 const ui::LatencyInfo& latency, 74 const blink::CoalescedWebInputEvent* coalescedEvent,
75 InputEventDispatchType type) override { 75 const ui::LatencyInfo& latency,
76 InputEventDispatchType type) override {
76 EXPECT_EQ(kTestRoutingID, routing_id); 77 EXPECT_EQ(kTestRoutingID, routing_id);
77 handled_events_.push_back(ui::WebInputEventTraits::Clone(*event)); 78 handled_events_.push_back(
78 queue_->EventHandled(event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 79 ui::WebInputEventTraits::Clone(coalescedEvent->event()));
80 queue_->EventHandled(coalescedEvent->event().type,
81 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
79 } 82 }
80 83
81 void SendInputEventAck(int routing_id, 84 void SendInputEventAck(int routing_id,
82 blink::WebInputEvent::Type type, 85 blink::WebInputEvent::Type type,
83 InputEventAckState ack_result, 86 InputEventAckState ack_result,
84 uint32_t touch_event_id) override { 87 uint32_t touch_event_id) override {
85 additional_acked_events_.push_back(touch_event_id); 88 additional_acked_events_.push_back(touch_event_id);
86 } 89 }
87 90
88 void HandleEvent(WebInputEvent& event, InputEventAckState ack_result) { 91 void HandleEvent(WebInputEvent& event, InputEventAckState ack_result) {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 562
560 // The boolean parameterized test varies whether rAF aligned input 563 // The boolean parameterized test varies whether rAF aligned input
561 // is enabled or not. 564 // is enabled or not.
562 INSTANTIATE_TEST_CASE_P( 565 INSTANTIATE_TEST_CASE_P(
563 MainThreadEventQueueTests, 566 MainThreadEventQueueTests,
564 MainThreadEventQueueTest, 567 MainThreadEventQueueTest,
565 testing::Range(0u, 568 testing::Range(0u,
566 (kRafAlignedEnabledTouch | kRafAlignedEnabledMouse) + 1)); 569 (kRafAlignedEnabledTouch | kRafAlignedEnabledMouse) + 1));
567 570
568 } // namespace content 571 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698