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

Unified Diff: remoting/host/chromoting_host_unittest.cc

Issue 10572005: Use SingleThreadTaskRunner instead of MessageLoopProxy in remoting/host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 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.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
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index edc5ac535a1584ddd788a9db80906dc233703b42..699efd1d47455983378bfd80aa4a8dcdebc8123b 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -68,22 +68,19 @@ class ChromotingHostTest : public testing::Test {
virtual void SetUp() OVERRIDE {
message_loop_proxy_ = base::MessageLoopProxy::current();
- ON_CALL(context_, main_message_loop())
- .WillByDefault(Return(&message_loop_));
- ON_CALL(context_, encode_message_loop())
- .WillByDefault(Return(&message_loop_));
- ON_CALL(context_, network_message_loop())
- .WillByDefault(Return(message_loop_proxy_.get()));
- ON_CALL(context_, ui_message_loop())
- .WillByDefault(Return(message_loop_proxy_.get()));
- EXPECT_CALL(context_, main_message_loop())
- .Times(AnyNumber());
- EXPECT_CALL(context_, encode_message_loop())
- .Times(AnyNumber());
- EXPECT_CALL(context_, network_message_loop())
- .Times(AnyNumber());
- EXPECT_CALL(context_, ui_message_loop())
- .Times(AnyNumber());
+
+ EXPECT_CALL(context_, ui_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(message_loop_proxy_.get()));
+ EXPECT_CALL(context_, capture_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(message_loop_proxy_.get()));
+ EXPECT_CALL(context_, encode_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(message_loop_proxy_.get()));
+ EXPECT_CALL(context_, network_task_runner())
+ .Times(AnyNumber())
+ .WillRepeatedly(Return(message_loop_proxy_.get()));
scoped_ptr<Capturer> capturer(new CapturerFake());
event_executor_ = new MockEventExecutor();
@@ -207,22 +204,22 @@ class ChromotingHostTest : public testing::Test {
desktop_environment_->capturer(), base::TimeDelta());
connection_ptr->set_host_stub(client);
- context_.network_message_loop()->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE, base::Bind(&ChromotingHostTest::AddClientToHost,
host_, client));
if (authenticate) {
- context_.network_message_loop()->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE, base::Bind(&ClientSession::OnConnectionAuthenticated,
base::Unretained(client), connection_ptr));
if (!reject) {
- context_.network_message_loop()->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE,
base::Bind(&ClientSession::OnConnectionChannelsConnected,
base::Unretained(client), connection_ptr));
}
} else {
- context_.network_message_loop()->PostTask(
+ context_.network_task_runner()->PostTask(
FROM_HERE, base::Bind(&ClientSession::OnConnectionClosed,
base::Unretained(client), connection_ptr,
protocol::AUTHENTICATION_FAILED));
« no previous file with comments | « remoting/host/chromoting_host_context_unittest.cc ('k') | remoting/host/desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698