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

Unified Diff: remoting/host/chromoting_host_unittest.cc

Issue 11761019: Tiny little refactoring of DesktopEnvironment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/host/client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host_unittest.cc
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 6e7c3268f180fc65244e187034f1c22b819b336a..69ef99ef0a480fec7482f18621688183e747903a 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -7,13 +7,11 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop_proxy.h"
#include "remoting/base/auto_thread_task_runner.h"
-#include "remoting/capturer/video_frame_capturer_fake.h"
#include "remoting/host/audio_capturer.h"
#include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h"
-#include "remoting/host/desktop_environment.h"
#include "remoting/host/desktop_environment_factory.h"
-#include "remoting/host/event_executor_fake.h"
+#include "remoting/host/desktop_environment_fake.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/it2me_host_user_interface.h"
#include "remoting/jingle_glue/mock_objects.h"
@@ -118,7 +116,8 @@ class ChromotingHostTest : public testing::Test {
base::Bind(&ChromotingHostTest::QuitMainMessageLoop,
base::Unretained(this)));
- desktop_environment_factory_.reset(new MockDesktopEnvironmentFactory());
+ desktop_environment_factory_.reset(
+ new MockDesktopEnvironmentFactory(ui_task_runner_));
EXPECT_CALL(*desktop_environment_factory_, CreatePtr())
.Times(AnyNumber())
.WillRepeatedly(Invoke(this,
@@ -131,9 +130,11 @@ class ChromotingHostTest : public testing::Test {
desktop_environment_factory_.get(),
scoped_ptr<protocol::SessionManager>(session_manager_),
ui_task_runner_, // Audio
+ ui_task_runner_, // Input
ui_task_runner_, // Video capture
ui_task_runner_, // Video encode
- ui_task_runner_); // Network
+ ui_task_runner_, // Network
+ ui_task_runner_); // UI
host_->AddStatusObserver(&host_status_observer_);
disconnect_window_ = new MockDisconnectWindow();
@@ -237,15 +238,16 @@ class ChromotingHostTest : public testing::Test {
scoped_refptr<ClientSession> client = new ClientSession(
host_.get(),
ui_task_runner_, // Audio
+ ui_task_runner_, // Input
ui_task_runner_, // Video capture
ui_task_runner_, // Video encode
ui_task_runner_, // Network
+ ui_task_runner_, // UI
connection.Pass(),
desktop_environment_factory_.get(),
base::TimeDelta());
connection_ptr->set_host_stub(client);
- connection_ptr->set_input_stub(
- client->desktop_environment()->event_executor());
+ connection_ptr->set_input_stub(client->desktop_environment());
ui_task_runner_->PostTask(
FROM_HERE, base::Bind(&ChromotingHostTest::AddClientToHost,
@@ -283,11 +285,7 @@ class ChromotingHostTest : public testing::Test {
}
DesktopEnvironment* CreateDesktopEnvironment() {
- scoped_ptr<EventExecutor> event_executor(new EventExecutorFake());
- scoped_ptr<VideoFrameCapturer> video_capturer(new VideoFrameCapturerFake());
- return new DesktopEnvironment(scoped_ptr<AudioCapturer>(NULL),
- event_executor.Pass(),
- video_capturer.Pass());
+ return new DesktopEnvironmentFake(ui_task_runner_);
}
void DisconnectAllClients() {
@@ -338,6 +336,7 @@ class ChromotingHostTest : public testing::Test {
it2me_host_user_interface_.reset();
ui_task_runner_ = NULL;
host_ = NULL;
+ desktop_environment_factory_.reset();
}
void QuitMainMessageLoop() {
« 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