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

Unified Diff: remoting/host/chromoting_host_unittest.cc

Issue 11419265: Revert 170360 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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_context_unittest.cc ('k') | remoting/host/desktop_environment_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host_unittest.cc
===================================================================
--- remoting/host/chromoting_host_unittest.cc (revision 170590)
+++ remoting/host/chromoting_host_unittest.cc (working copy)
@@ -118,6 +118,19 @@
base::Bind(&ChromotingHostTest::QuitMainMessageLoop,
base::Unretained(this)));
+ EXPECT_CALL(context_, ui_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(ui_task_runner_.get()));
+ EXPECT_CALL(context_, capture_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(ui_task_runner_.get()));
+ EXPECT_CALL(context_, encode_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(ui_task_runner_.get()));
+ EXPECT_CALL(context_, network_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(ui_task_runner_.get()));
+
desktop_environment_factory_.reset(new MockDesktopEnvironmentFactory());
EXPECT_CALL(*desktop_environment_factory_, CreatePtr(_))
.Times(AnyNumber())
@@ -130,17 +143,18 @@
&signal_strategy_,
desktop_environment_factory_.get(),
scoped_ptr<protocol::SessionManager>(session_manager_),
- ui_task_runner_, // Audio
- ui_task_runner_, // Video capture
- ui_task_runner_, // Video encode
- ui_task_runner_); // Network
+ context_.audio_task_runner(),
+ context_.capture_task_runner(),
+ context_.encode_task_runner(),
+ context_.network_task_runner());
host_->AddStatusObserver(&host_status_observer_);
disconnect_window_ = new MockDisconnectWindow();
continue_window_ = new MockContinueWindow();
local_input_monitor_ = new MockLocalInputMonitor();
it2me_host_user_interface_.reset(
- new MockIt2MeHostUserInterface(ui_task_runner_, ui_task_runner_));
+ new MockIt2MeHostUserInterface(context_.network_task_runner(),
+ context_.ui_task_runner()));
it2me_host_user_interface_->InitFrom(
scoped_ptr<DisconnectWindow>(disconnect_window_),
scoped_ptr<ContinueWindow>(continue_window_),
@@ -236,10 +250,10 @@
protocol::ConnectionToClient* connection_ptr = connection.get();
scoped_refptr<ClientSession> client = new ClientSession(
host_.get(),
- ui_task_runner_, // Audio
- ui_task_runner_, // Video capture
- ui_task_runner_, // Video encode
- ui_task_runner_, // Network
+ context_.audio_task_runner(),
+ context_.capture_task_runner(),
+ context_.encode_task_runner(),
+ context_.network_task_runner(),
connection.Pass(),
desktop_environment_factory_.get(),
base::TimeDelta());
@@ -247,22 +261,22 @@
connection_ptr->set_input_stub(
client->desktop_environment()->event_executor());
- ui_task_runner_->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE, base::Bind(&ChromotingHostTest::AddClientToHost,
host_, client));
if (authenticate) {
- ui_task_runner_->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE, base::Bind(&ClientSession::OnConnectionAuthenticated,
client, connection_ptr));
if (!reject) {
- ui_task_runner_->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE,
base::Bind(&ClientSession::OnConnectionChannelsConnected,
client, connection_ptr));
}
} else {
- ui_task_runner_->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE, base::Bind(&ClientSession::OnConnectionClosed,
client, connection_ptr,
protocol::AUTHENTICATION_FAILED));
@@ -429,6 +443,7 @@
protected:
MessageLoop message_loop_;
scoped_refptr<AutoThreadTaskRunner> ui_task_runner_;
+ MockChromotingHostContext context_;
MockConnectionToClientEventHandler handler_;
MockSignalStrategy signal_strategy_;
scoped_ptr<MockDesktopEnvironmentFactory> desktop_environment_factory_;
« no previous file with comments | « remoting/host/chromoting_host_context_unittest.cc ('k') | remoting/host/desktop_environment_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698