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

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

Issue 12545026: ResizingHostObserver is created by the desktop environment together with other stubs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback & rebased 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
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/host/client_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 // Creates a DesktopEnvironment with a fake media::ScreenCapturer, to mock 288 // Creates a DesktopEnvironment with a fake media::ScreenCapturer, to mock
289 // DesktopEnvironmentFactory::Create(). 289 // DesktopEnvironmentFactory::Create().
290 DesktopEnvironment* CreateDesktopEnvironment() { 290 DesktopEnvironment* CreateDesktopEnvironment() {
291 MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment(); 291 MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment();
292 EXPECT_CALL(*desktop_environment, CreateAudioCapturerPtr(_)) 292 EXPECT_CALL(*desktop_environment, CreateAudioCapturerPtr(_))
293 .Times(0); 293 .Times(0);
294 EXPECT_CALL(*desktop_environment, CreateEventExecutorPtr(_, _)) 294 EXPECT_CALL(*desktop_environment, CreateEventExecutorPtr(_, _))
295 .Times(AnyNumber()) 295 .Times(AnyNumber())
296 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateEventExecutor)); 296 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateEventExecutor));
297 EXPECT_CALL(*desktop_environment, CreateSessionControllerPtr())
298 .Times(AnyNumber())
299 .WillRepeatedly(Invoke(this,
300 &ChromotingHostTest::CreateSessionController));
297 EXPECT_CALL(*desktop_environment, CreateVideoCapturerPtr(_, _)) 301 EXPECT_CALL(*desktop_environment, CreateVideoCapturerPtr(_, _))
298 .Times(AnyNumber()) 302 .Times(AnyNumber())
299 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateVideoCapturer)); 303 .WillRepeatedly(Invoke(this, &ChromotingHostTest::CreateVideoCapturer));
300 304
301 return desktop_environment; 305 return desktop_environment;
302 } 306 }
303 307
304 // Creates a dummy EventExecutor, to mock 308 // Creates a dummy EventExecutor, to mock
305 // DesktopEnvironment::CreateEventExecutor(). 309 // DesktopEnvironment::CreateEventExecutor().
306 EventExecutor* CreateEventExecutor( 310 EventExecutor* CreateEventExecutor(
307 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 311 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
308 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 312 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
309 MockEventExecutor* event_executor = new MockEventExecutor(); 313 MockEventExecutor* event_executor = new MockEventExecutor();
310 EXPECT_CALL(*event_executor, StartPtr(_)); 314 EXPECT_CALL(*event_executor, StartPtr(_));
311 return event_executor; 315 return event_executor;
312 } 316 }
313 317
318 // Creates a dummy SessionController, to mock
319 // DesktopEnvironment::CreateSessionController().
320 SessionController* CreateSessionController() {
321 return new MockSessionController();
322 }
323
314 // Creates a fake media::ScreenCapturer, to mock 324 // Creates a fake media::ScreenCapturer, to mock
315 // DesktopEnvironment::CreateVideoCapturer(). 325 // DesktopEnvironment::CreateVideoCapturer().
316 media::ScreenCapturer* CreateVideoCapturer( 326 media::ScreenCapturer* CreateVideoCapturer(
317 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, 327 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
318 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) { 328 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) {
319 return new media::ScreenCapturerFake(); 329 return new media::ScreenCapturerFake();
320 } 330 }
321 331
322 void DisconnectAllClients() { 332 void DisconnectAllClients() {
323 host_->DisconnectAllClients(); 333 host_->DisconnectAllClients();
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 ExpectClientDisconnected(0, true, video_packet_sent, 729 ExpectClientDisconnected(0, true, video_packet_sent,
720 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); 730 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost));
721 EXPECT_CALL(host_status_observer_, OnShutdown()); 731 EXPECT_CALL(host_status_observer_, OnShutdown());
722 732
723 host_->Start(xmpp_login_); 733 host_->Start(xmpp_login_);
724 SimulateClientConnection(0, true, false); 734 SimulateClientConnection(0, true, false);
725 message_loop_.Run(); 735 message_loop_.Run();
726 } 736 }
727 737
728 } // namespace remoting 738 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/host/client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698