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

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

Issue 1894363004: Articulate the cancel behavior in WebMouseWheelEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_all_passive
Patch Set: Rebase 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 <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 63
64 ASSERT_EQ(WebInputEventQueueState::ITEM_NOT_PENDING, 64 ASSERT_EQ(WebInputEventQueueState::ITEM_NOT_PENDING,
65 wheel_event_queue().state()); 65 wheel_event_queue().state());
66 queue_.HandleEvent(&kEvents[0], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING, 66 queue_.HandleEvent(&kEvents[0], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING,
67 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING); 67 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
68 ASSERT_EQ(WebInputEventQueueState::ITEM_PENDING, wheel_event_queue().state()); 68 ASSERT_EQ(WebInputEventQueueState::ITEM_PENDING, wheel_event_queue().state());
69 queue_.HandleEvent(&kEvents[1], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING, 69 queue_.HandleEvent(&kEvents[1], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING,
70 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING); 70 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
71 ASSERT_EQ(kEvents[0].size, last_event_.size()); 71 ASSERT_EQ(kEvents[0].size, last_event_.size());
72 kEvents[0].dispatchType =
73 WebInputEvent::DispatchType::ListenersNonBlockingPassive;
72 ASSERT_TRUE(memcmp(&last_event_[0], &kEvents[0], kEvents[0].size) == 0); 74 ASSERT_TRUE(memcmp(&last_event_[0], &kEvents[0], kEvents[0].size) == 0);
73 queue_.EventHandled(blink::WebInputEvent::MouseWheel); 75 queue_.EventHandled(blink::WebInputEvent::MouseWheel);
74 ASSERT_EQ(kEvents[1].size, last_event_.size()); 76 ASSERT_EQ(kEvents[1].size, last_event_.size());
77 kEvents[1].dispatchType =
78 WebInputEvent::DispatchType::ListenersNonBlockingPassive;
75 ASSERT_TRUE(memcmp(&last_event_[0], &kEvents[1], kEvents[1].size) == 0); 79 ASSERT_TRUE(memcmp(&last_event_[0], &kEvents[1], kEvents[1].size) == 0);
76 ASSERT_EQ(WebInputEventQueueState::ITEM_PENDING, wheel_event_queue().state()); 80 ASSERT_EQ(WebInputEventQueueState::ITEM_PENDING, wheel_event_queue().state());
77 queue_.EventHandled(blink::WebInputEvent::MouseWheel); 81 queue_.EventHandled(blink::WebInputEvent::MouseWheel);
78 ASSERT_EQ(WebInputEventQueueState::ITEM_NOT_PENDING, 82 ASSERT_EQ(WebInputEventQueueState::ITEM_NOT_PENDING,
79 wheel_event_queue().state()); 83 wheel_event_queue().state());
80 84
81 // Ensure that coalescing takes place. 85 // Ensure that coalescing takes place.
82 queue_.HandleEvent(&kEvents[0], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING, 86 queue_.HandleEvent(&kEvents[0], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING,
83 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING); 87 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
84 queue_.HandleEvent(&kEvents[2], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING, 88 queue_.HandleEvent(&kEvents[2], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING); 130 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
127 queue_.HandleEvent(&kEvents[2], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING, 131 queue_.HandleEvent(&kEvents[2], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING,
128 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING); 132 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
129 queue_.HandleEvent(&kEvents[3], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING, 133 queue_.HandleEvent(&kEvents[3], ui::LatencyInfo(), DISPATCH_TYPE_BLOCKING,
130 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING); 134 INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
131 ASSERT_EQ(1u, touch_event_queue().size()); 135 ASSERT_EQ(1u, touch_event_queue().size());
132 ASSERT_EQ(WebInputEventQueueState::ITEM_PENDING, touch_event_queue().state()); 136 ASSERT_EQ(WebInputEventQueueState::ITEM_PENDING, touch_event_queue().state());
133 } 137 }
134 138
135 } // namespace content 139 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/main_thread_event_queue.cc ('k') | content/renderer/input/render_widget_input_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698