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

Side by Side Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2841263002: [VSync Queue] Flush input in CommitComplete() (Closed)
Patch Set: Test Patch: VsyncAlignedInput Enabled Created 3 years, 7 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 "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 gfx::ScrollOffset* offset) override { 195 gfx::ScrollOffset* offset) override {
196 return false; 196 return false;
197 } 197 }
198 bool ScrollLayerTo(int layer_id, const gfx::ScrollOffset& offset) override { 198 bool ScrollLayerTo(int layer_id, const gfx::ScrollOffset& offset) override {
199 return false; 199 return false;
200 } 200 }
201 201
202 void BindToClient(cc::InputHandlerClient* client, 202 void BindToClient(cc::InputHandlerClient* client,
203 bool touchpad_and_wheel_scroll_latching_enabled) override {} 203 bool touchpad_and_wheel_scroll_latching_enabled) override {}
204 204
205 InputHandlerState GetInputHandlerState() const override {
206 return input_handler_state_;
207 }
208
205 void MouseDown() override {} 209 void MouseDown() override {}
206 void MouseUp() override {} 210 void MouseUp() override {}
207 void MouseLeave() override {} 211 void MouseLeave() override {}
208 212
209 void MouseMoveAt(const gfx::Point& mouse_position) override {} 213 void MouseMoveAt(const gfx::Point& mouse_position) override {}
210 214
211 MOCK_CONST_METHOD2(IsCurrentlyScrollingLayerAt, 215 MOCK_CONST_METHOD2(IsCurrentlyScrollingLayerAt,
212 bool(const gfx::Point& point, 216 bool(const gfx::Point& point,
213 cc::InputHandler::ScrollInputType type)); 217 cc::InputHandler::ScrollInputType type));
214 218
215 MOCK_CONST_METHOD1( 219 MOCK_CONST_METHOD1(
216 GetEventListenerProperties, 220 GetEventListenerProperties,
217 cc::EventListenerProperties(cc::EventListenerClass event_class)); 221 cc::EventListenerProperties(cc::EventListenerClass event_class));
218 MOCK_METHOD1( 222 MOCK_METHOD1(
219 EventListenerTypeForTouchStartAt, 223 EventListenerTypeForTouchStartAt,
220 cc::InputHandler::TouchStartEventListenerType(const gfx::Point& point)); 224 cc::InputHandler::TouchStartEventListenerType(const gfx::Point& point));
221 225
222 MOCK_METHOD0(RequestUpdateForSynchronousInputHandler, void()); 226 MOCK_METHOD0(RequestUpdateForSynchronousInputHandler, void());
223 MOCK_METHOD1(SetSynchronousInputHandlerRootScrollOffset, 227 MOCK_METHOD1(SetSynchronousInputHandlerRootScrollOffset,
224 void(const gfx::ScrollOffset& root_offset)); 228 void(const gfx::ScrollOffset& root_offset));
225 229
226 bool IsCurrentlyScrollingViewport() const override { 230 bool IsCurrentlyScrollingViewport() const override {
227 return is_scrolling_root_; 231 return is_scrolling_root_;
228 } 232 }
229 void set_is_scrolling_root(bool is) { is_scrolling_root_ = is; } 233 void set_is_scrolling_root(bool is) { is_scrolling_root_ = is; }
234 void set_input_handler_state(InputHandlerState input_handler_state) {
235 input_handler_state_ = input_handler_state;
236 }
230 237
231 private: 238 private:
232 bool is_scrolling_root_ = true; 239 bool is_scrolling_root_ = true;
240 InputHandlerState input_handler_state_ = InputHandlerState::IDLE;
233 DISALLOW_COPY_AND_ASSIGN(MockInputHandler); 241 DISALLOW_COPY_AND_ASSIGN(MockInputHandler);
234 }; 242 };
235 243
236 class MockSynchronousInputHandler : public SynchronousInputHandler { 244 class MockSynchronousInputHandler : public SynchronousInputHandler {
237 public: 245 public:
238 MOCK_METHOD0(SetNeedsSynchronousAnimateInput, void()); 246 MOCK_METHOD0(SetNeedsSynchronousAnimateInput, void());
239 MOCK_METHOD6(UpdateRootLayerState, 247 MOCK_METHOD6(UpdateRootLayerState,
240 void(const gfx::ScrollOffset& total_scroll_offset, 248 void(const gfx::ScrollOffset& total_scroll_offset,
241 const gfx::ScrollOffset& max_scroll_offset, 249 const gfx::ScrollOffset& max_scroll_offset,
242 const gfx::SizeF& scrollable_size, 250 const gfx::SizeF& scrollable_size,
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 ~InputHandlerProxyEventQueueTest() { input_handler_proxy_.reset(); } 528 ~InputHandlerProxyEventQueueTest() { input_handler_proxy_.reset(); }
521 529
522 void SetUp() override { 530 void SetUp() override {
523 bool wheel_scroll_latching_enabled = GetParam(); 531 bool wheel_scroll_latching_enabled = GetParam();
524 event_disposition_recorder_.clear(); 532 event_disposition_recorder_.clear();
525 input_handler_proxy_ = base::MakeUnique<TestInputHandlerProxy>( 533 input_handler_proxy_ = base::MakeUnique<TestInputHandlerProxy>(
526 &mock_input_handler_, &mock_client_, wheel_scroll_latching_enabled); 534 &mock_input_handler_, &mock_client_, wheel_scroll_latching_enabled);
527 if (input_handler_proxy_->compositor_event_queue_) 535 if (input_handler_proxy_->compositor_event_queue_)
528 input_handler_proxy_->compositor_event_queue_ = 536 input_handler_proxy_->compositor_event_queue_ =
529 base::MakeUnique<CompositorThreadEventQueue>(); 537 base::MakeUnique<CompositorThreadEventQueue>();
538 mock_input_handler_.set_input_handler_state(
539 cc::InputHandler::InputHandlerState::INSIDE_IMPL_FRAME);
540 }
541
542 void TearDown() override {
543 mock_input_handler_.set_input_handler_state(
544 cc::InputHandler::InputHandlerState::IDLE);
530 } 545 }
531 546
532 void StartTracing() { 547 void StartTracing() {
533 base::trace_event::TraceLog::GetInstance()->SetEnabled( 548 base::trace_event::TraceLog::GetInstance()->SetEnabled(
534 base::trace_event::TraceConfig("*"), 549 base::trace_event::TraceConfig("*"),
535 base::trace_event::TraceLog::RECORDING_MODE); 550 base::trace_event::TraceLog::RECORDING_MODE);
536 } 551 }
537 552
538 void StopTracing() { 553 void StopTracing() {
539 base::trace_event::TraceLog::GetInstance()->SetDisabled(); 554 base::trace_event::TraceLog::GetInstance()->SetDisabled();
(...skipping 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after
3818 INSTANTIATE_TEST_CASE_P(AnimateInput, 3833 INSTANTIATE_TEST_CASE_P(AnimateInput,
3819 InputHandlerProxyWithoutWheelScrollLatchingTest, 3834 InputHandlerProxyWithoutWheelScrollLatchingTest,
3820 testing::ValuesIn(test_types)); 3835 testing::ValuesIn(test_types));
3821 3836
3822 INSTANTIATE_TEST_CASE_P(InputHandlerProxyEventQueueTests, 3837 INSTANTIATE_TEST_CASE_P(InputHandlerProxyEventQueueTests,
3823 InputHandlerProxyEventQueueTest, 3838 InputHandlerProxyEventQueueTest,
3824 testing::Bool()); 3839 testing::Bool());
3825 3840
3826 } // namespace test 3841 } // namespace test
3827 } // namespace ui 3842 } // namespace ui
OLDNEW
« testing/variations/fieldtrial_testing_config.json ('K') | « ui/events/blink/input_handler_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698