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

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

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

Powered by Google App Engine
This is Rietveld 408576698