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

Side by Side Diff: remoting/host/chromoting_host_unittest.cc

Issue 12760012: Rename EventExecutor to InputInjector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "media/video/capture/screen/screen_capturer_fake.h" 9 #include "media/video/capture/screen/screen_capturer_fake.h"
10 #include "remoting/base/auto_thread_task_runner.h" 10 #include "remoting/base/auto_thread_task_runner.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 const protocol::TransportRoute& route) { 286 const protocol::TransportRoute& route) {
287 host_->OnSessionRouteChange(get_client(0), channel_name, route); 287 host_->OnSessionRouteChange(get_client(0), channel_name, route);
288 } 288 }
289 289
290 // Creates a DesktopEnvironment with a fake media::ScreenCapturer, to mock 290 // Creates a DesktopEnvironment with a fake media::ScreenCapturer, to mock
291 // DesktopEnvironmentFactory::Create(). 291 // DesktopEnvironmentFactory::Create().
292 DesktopEnvironment* CreateDesktopEnvironment() { 292 DesktopEnvironment* CreateDesktopEnvironment() {
293 MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment(); 293 MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment();
294 EXPECT_CALL(*desktop_environment, CreateAudioCapturerPtr(_)) 294 EXPECT_CALL(*desktop_environment, CreateAudioCapturerPtr(_))
295 .Times(0); 295 .Times(0);
296 EXPECT_CALL(*desktop_environment, CreateEventExecutorPtr(_, _)) 296 EXPECT_CALL(*desktop_environment, CreateInputInjectorPtr(_, _))
297 .Times(AnyNumber()) 297 .Times(AnyNumber())
298 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateEventExecutor)); 298 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateInputInjector));
299 EXPECT_CALL(*desktop_environment, CreateSessionControllerPtr()) 299 EXPECT_CALL(*desktop_environment, CreateSessionControllerPtr())
300 .Times(AnyNumber()) 300 .Times(AnyNumber())
301 .WillRepeatedly(Invoke(this, 301 .WillRepeatedly(Invoke(this,
302 &ChromotingHostTest::CreateSessionController)); 302 &ChromotingHostTest::CreateSessionController));
303 EXPECT_CALL(*desktop_environment, CreateVideoCapturerPtr(_, _)) 303 EXPECT_CALL(*desktop_environment, CreateVideoCapturerPtr(_, _))
304 .Times(AnyNumber()) 304 .Times(AnyNumber())
305 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateVideoCapturer)); 305 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateVideoCapturer));
306 306
307 return desktop_environment; 307 return desktop_environment;
308 } 308 }
309 309
310 // Creates a dummy EventExecutor, to mock 310 // Creates a dummy InputInjector, to mock
311 // DesktopEnvironment::CreateEventExecutor(). 311 // DesktopEnvironment::CreateInputInjector().
312 EventExecutor* CreateEventExecutor( 312 InputInjector* CreateInputInjector(
313 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 313 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
314 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 314 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
315 MockEventExecutor* event_executor = new MockEventExecutor(); 315 MockInputInjector* event_executor = new MockInputInjector();
316 EXPECT_CALL(*event_executor, StartPtr(_)); 316 EXPECT_CALL(*event_executor, StartPtr(_));
317 return event_executor; 317 return event_executor;
318 } 318 }
319 319
320 // Creates a dummy SessionController, to mock 320 // Creates a dummy SessionController, to mock
321 // DesktopEnvironment::CreateSessionController(). 321 // DesktopEnvironment::CreateSessionController().
322 SessionController* CreateSessionController() { 322 SessionController* CreateSessionController() {
323 return new MockSessionController(); 323 return new MockSessionController();
324 } 324 }
325 325
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 ExpectClientDisconnected(0, true, video_packet_sent, 732 ExpectClientDisconnected(0, true, video_packet_sent,
733 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); 733 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost));
734 EXPECT_CALL(host_status_observer_, OnShutdown()); 734 EXPECT_CALL(host_status_observer_, OnShutdown());
735 735
736 host_->Start(xmpp_login_); 736 host_->Start(xmpp_login_);
737 SimulateClientConnection(0, true, false); 737 SimulateClientConnection(0, true, false);
738 message_loop_.Run(); 738 message_loop_.Run();
739 } 739 }
740 740
741 } // namespace remoting 741 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698