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

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

Issue 1159623009: content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test build fix. Created 5 years, 6 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 <math.h> 5 #include <math.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/thread_task_runner_handle.h"
11 #include "content/browser/renderer_host/input/gesture_event_queue.h" 14 #include "content/browser/renderer_host/input/gesture_event_queue.h"
12 #include "content/browser/renderer_host/input/input_router_client.h" 15 #include "content/browser/renderer_host/input/input_router_client.h"
13 #include "content/browser/renderer_host/input/input_router_impl.h" 16 #include "content/browser/renderer_host/input/input_router_impl.h"
14 #include "content/browser/renderer_host/input/mock_input_ack_handler.h" 17 #include "content/browser/renderer_host/input/mock_input_ack_handler.h"
15 #include "content/browser/renderer_host/input/mock_input_router_client.h" 18 #include "content/browser/renderer_host/input/mock_input_router_client.h"
16 #include "content/common/content_constants_internal.h" 19 #include "content/common/content_constants_internal.h"
17 #include "content/common/edit_command.h" 20 #include "content/common/edit_command.h"
18 #include "content/common/input/synthetic_web_input_event_builders.h" 21 #include "content/common/input/synthetic_web_input_event_builders.h"
19 #include "content/common/input/touch_action.h" 22 #include "content/common/input/touch_action.h"
20 #include "content/common/input/web_input_event_traits.h" 23 #include "content/common/input/web_input_event_traits.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 InputHostMsg_SetTouchAction(0, touch_action)); 322 InputHostMsg_SetTouchAction(0, touch_action));
320 } 323 }
321 324
322 size_t GetSentMessageCountAndResetSink() { 325 size_t GetSentMessageCountAndResetSink() {
323 size_t count = process_->sink().message_count(); 326 size_t count = process_->sink().message_count();
324 process_->sink().ClearMessages(); 327 process_->sink().ClearMessages();
325 return count; 328 return count;
326 } 329 }
327 330
328 static void RunTasksAndWait(base::TimeDelta delay) { 331 static void RunTasksAndWait(base::TimeDelta delay) {
329 base::MessageLoop::current()->PostDelayedTask( 332 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
330 FROM_HERE, base::MessageLoop::QuitClosure(), delay); 333 FROM_HERE, base::MessageLoop::QuitClosure(), delay);
331 base::MessageLoop::current()->Run(); 334 base::MessageLoop::current()->Run();
332 } 335 }
333 336
334 InputRouterImpl::Config config_; 337 InputRouterImpl::Config config_;
335 scoped_ptr<MockRenderProcessHost> process_; 338 scoped_ptr<MockRenderProcessHost> process_;
336 scoped_ptr<MockInputRouterClient> client_; 339 scoped_ptr<MockInputRouterClient> client_;
337 scoped_ptr<MockInputAckHandler> ack_handler_; 340 scoped_ptr<MockInputAckHandler> ack_handler_;
338 scoped_ptr<InputRouterImpl> input_router_; 341 scoped_ptr<InputRouterImpl> input_router_;
339 342
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 client_overscroll = client_->GetAndResetOverscroll(); 1834 client_overscroll = client_->GetAndResetOverscroll();
1832 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, 1835 EXPECT_EQ(wheel_overscroll.accumulated_overscroll,
1833 client_overscroll.accumulated_overscroll); 1836 client_overscroll.accumulated_overscroll);
1834 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, 1837 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta,
1835 client_overscroll.latest_overscroll_delta); 1838 client_overscroll.latest_overscroll_delta);
1836 EXPECT_EQ(wheel_overscroll.current_fling_velocity, 1839 EXPECT_EQ(wheel_overscroll.current_fling_velocity,
1837 client_overscroll.current_fling_velocity); 1840 client_overscroll.current_fling_velocity);
1838 } 1841 }
1839 1842
1840 } // namespace content 1843 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698