Index: remoting/host/host_status_logger_unittest.cc |
diff --git a/remoting/host/host_status_logger_unittest.cc b/remoting/host/host_status_logger_unittest.cc |
index 67aa6c4dec079de1d6fd469a687753f980ce8d9e..6b24ccf7d60fe6d9fde7392666091353fdaf4f2c 100644 |
--- a/remoting/host/host_status_logger_unittest.cc |
+++ b/remoting/host/host_status_logger_unittest.cc |
@@ -24,8 +24,8 @@ namespace remoting { |
namespace { |
-ACTION_P(QuitMainMessageLoop, message_loop) { |
- message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
+ACTION_P(QuitRunLoop, run_loop) { |
+ run_loop->QuitWhenIdle(); |
} |
const char kJabberClientNamespace[] = "jabber:client"; |
@@ -143,6 +143,7 @@ class HostStatusLoggerTest : public testing::Test { |
}; |
TEST_F(HostStatusLoggerTest, SendNow) { |
+ base::RunLoop run_loop; |
{ |
InSequence s; |
EXPECT_CALL(signal_strategy_, GetLocalJid()) |
@@ -152,7 +153,7 @@ TEST_F(HostStatusLoggerTest, SendNow) { |
EXPECT_CALL(signal_strategy_, SendStanzaPtr(IsClientConnected("direct"))) |
.WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
EXPECT_CALL(signal_strategy_, RemoveListener(_)) |
- .WillOnce(QuitMainMessageLoop(&message_loop_)) |
+ .WillOnce(QuitRunLoop(&run_loop)) |
.RetiresOnSaturation(); |
} |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); |
@@ -163,10 +164,11 @@ TEST_F(HostStatusLoggerTest, SendNow) { |
host_status_logger_->OnClientConnected(kClientJid1); |
host_status_logger_->SetSignalingStateForTest( |
SignalStrategy::DISCONNECTED); |
- base::RunLoop().Run(); |
+ run_loop.Run(); |
} |
TEST_F(HostStatusLoggerTest, SendLater) { |
+ base::RunLoop run_loop; |
protocol::TransportRoute route; |
route.type = protocol::TransportRoute::DIRECT; |
host_status_logger_->OnClientRouteChange(kClientJid1, "video", route); |
@@ -181,15 +183,16 @@ TEST_F(HostStatusLoggerTest, SendLater) { |
EXPECT_CALL(signal_strategy_, SendStanzaPtr(IsClientConnected("direct"))) |
.WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
EXPECT_CALL(signal_strategy_, RemoveListener(_)) |
- .WillOnce(QuitMainMessageLoop(&message_loop_)) |
+ .WillOnce(QuitRunLoop(&run_loop)) |
.RetiresOnSaturation(); |
} |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); |
- base::RunLoop().Run(); |
+ run_loop.Run(); |
} |
TEST_F(HostStatusLoggerTest, SendTwoEntriesLater) { |
+ base::RunLoop run_loop; |
protocol::TransportRoute route1; |
route1.type = protocol::TransportRoute::DIRECT; |
host_status_logger_->OnClientRouteChange(kClientJid1, "video", route1); |
@@ -210,15 +213,16 @@ TEST_F(HostStatusLoggerTest, SendTwoEntriesLater) { |
SendStanzaPtr(IsTwoClientsConnected("direct", "stun"))) |
.WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
EXPECT_CALL(signal_strategy_, RemoveListener(_)) |
- .WillOnce(QuitMainMessageLoop(&message_loop_)) |
+ .WillOnce(QuitRunLoop(&run_loop)) |
.RetiresOnSaturation(); |
} |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); |
- base::RunLoop().Run(); |
+ run_loop.Run(); |
} |
TEST_F(HostStatusLoggerTest, HandleRouteChangeInUnusualOrder) { |
+ base::RunLoop run_loop; |
{ |
InSequence s; |
EXPECT_CALL(signal_strategy_, GetLocalJid()) |
@@ -234,7 +238,7 @@ TEST_F(HostStatusLoggerTest, HandleRouteChangeInUnusualOrder) { |
EXPECT_CALL(signal_strategy_, SendStanzaPtr(IsClientConnected("stun"))) |
.WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
EXPECT_CALL(signal_strategy_, RemoveListener(_)) |
- .WillOnce(QuitMainMessageLoop(&message_loop_)) |
+ .WillOnce(QuitRunLoop(&run_loop)) |
.RetiresOnSaturation(); |
} |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); |
@@ -250,7 +254,7 @@ TEST_F(HostStatusLoggerTest, HandleRouteChangeInUnusualOrder) { |
host_status_logger_->OnClientAuthenticated(kClientJid2); |
host_status_logger_->OnClientConnected(kClientJid2); |
host_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); |
- base::RunLoop().Run(); |
+ run_loop.Run(); |
} |
} // namespace remoting |