| OLD | NEW |
| 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 "content/browser/renderer_host/input/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 size_t GetSentMessageCountAndResetSink() { | 333 size_t GetSentMessageCountAndResetSink() { |
| 334 size_t count = process_->sink().message_count(); | 334 size_t count = process_->sink().message_count(); |
| 335 process_->sink().ClearMessages(); | 335 process_->sink().ClearMessages(); |
| 336 return count; | 336 return count; |
| 337 } | 337 } |
| 338 | 338 |
| 339 static void RunTasksAndWait(base::TimeDelta delay) { | 339 static void RunTasksAndWait(base::TimeDelta delay) { |
| 340 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 340 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 341 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), delay); | 341 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), delay); |
| 342 base::MessageLoop::current()->Run(); | 342 base::RunLoop().Run(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 InputRouterImpl::Config config_; | 345 InputRouterImpl::Config config_; |
| 346 std::unique_ptr<MockRenderProcessHost> process_; | 346 std::unique_ptr<MockRenderProcessHost> process_; |
| 347 std::unique_ptr<MockInputRouterClient> client_; | 347 std::unique_ptr<MockInputRouterClient> client_; |
| 348 std::unique_ptr<MockInputAckHandler> ack_handler_; | 348 std::unique_ptr<MockInputAckHandler> ack_handler_; |
| 349 std::unique_ptr<InputRouterImpl> input_router_; | 349 std::unique_ptr<InputRouterImpl> input_router_; |
| 350 | 350 |
| 351 private: | 351 private: |
| 352 base::MessageLoopForUI message_loop_; | 352 base::MessageLoopForUI message_loop_; |
| (...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2277 EXPECT_EQ(80, sent_event->data.flingStart.velocityY); | 2277 EXPECT_EQ(80, sent_event->data.flingStart.velocityY); |
| 2278 | 2278 |
| 2279 const WebGestureEvent* filter_event = | 2279 const WebGestureEvent* filter_event = |
| 2280 GetFilterWebInputEvent<WebGestureEvent>(); | 2280 GetFilterWebInputEvent<WebGestureEvent>(); |
| 2281 TestLocationInFilterEvent(filter_event, orig); | 2281 TestLocationInFilterEvent(filter_event, orig); |
| 2282 EXPECT_EQ(30, filter_event->data.flingStart.velocityX); | 2282 EXPECT_EQ(30, filter_event->data.flingStart.velocityX); |
| 2283 EXPECT_EQ(40, filter_event->data.flingStart.velocityY); | 2283 EXPECT_EQ(40, filter_event->data.flingStart.velocityY); |
| 2284 } | 2284 } |
| 2285 | 2285 |
| 2286 } // namespace content | 2286 } // namespace content |
| OLD | NEW |