Chromium Code Reviews| Index: remoting/host/chromoting_host_unittest.cc |
| diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc |
| index e75a1cbb32f4b84e241eff2dbeb005c8bacde310..441147b67fbc0b4e85c7eb705fec26a169c92a6a 100644 |
| --- a/remoting/host/chromoting_host_unittest.cc |
| +++ b/remoting/host/chromoting_host_unittest.cc |
| @@ -215,6 +215,11 @@ class ChromotingHostTest : public testing::Test { |
| protocol::CandidateSessionConfig::CreateDefault(); |
| } |
| + virtual void TearDown() OVERRIDE { |
| + // Run the message loop to finish outstanding tasks. |
| + message_loop_.Run(); |
|
simonmorris
2012/09/13 16:51:40
I'm not convinced the benefits of this exceed the
alexeypa (please no reviews)
2012/09/13 18:06:17
Done.
|
| + } |
| + |
| // Helper method to pretend a client is connected to ChromotingHost. |
| void SimulateClientConnection(int connection_index, bool authenticate, |
| bool reject) { |
| @@ -470,7 +475,6 @@ TEST_F(ChromotingHostTest, StartAndShutdown) { |
| host_->Start(xmpp_login_); |
| ShutdownHost(); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, Connect) { |
| @@ -485,7 +489,6 @@ TEST_F(ChromotingHostTest, Connect) { |
| host_->Start(xmpp_login_); |
| SimulateClientConnection(0, true, false); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, RejectAuthenticatingClient) { |
| @@ -500,7 +503,6 @@ TEST_F(ChromotingHostTest, RejectAuthenticatingClient) { |
| host_->Start(xmpp_login_); |
| SimulateClientConnection(0, true, true); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, AuthenticationFailed) { |
| @@ -511,7 +513,6 @@ TEST_F(ChromotingHostTest, AuthenticationFailed) { |
| host_->Start(xmpp_login_); |
| SimulateClientConnection(0, false, false); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, Reconnect) { |
| @@ -537,7 +538,6 @@ TEST_F(ChromotingHostTest, Reconnect) { |
| SimulateClientConnection(0, true, false); |
| message_loop_.Run(); |
| SimulateClientConnection(1, true, false); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, ConnectWhenAnotherClientIsConnected) { |
| @@ -561,7 +561,6 @@ TEST_F(ChromotingHostTest, ConnectWhenAnotherClientIsConnected) { |
| host_->Start(xmpp_login_); |
| SimulateClientConnection(0, true, false); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, IncomingSessionDeclined) { |
| @@ -572,7 +571,6 @@ TEST_F(ChromotingHostTest, IncomingSessionDeclined) { |
| EXPECT_EQ(protocol::SessionManager::DECLINE, response); |
| ShutdownHost(); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, IncomingSessionIncompatible) { |
| @@ -591,7 +589,6 @@ TEST_F(ChromotingHostTest, IncomingSessionIncompatible) { |
| EXPECT_EQ(protocol::SessionManager::INCOMPATIBLE, response); |
| ShutdownHost(); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, IncomingSessionAccepted) { |
| @@ -614,7 +611,6 @@ TEST_F(ChromotingHostTest, IncomingSessionAccepted) { |
| EXPECT_EQ(protocol::SessionManager::ACCEPT, response); |
| ShutdownHost(); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, IncomingSessionOverload) { |
| @@ -640,7 +636,6 @@ TEST_F(ChromotingHostTest, IncomingSessionOverload) { |
| EXPECT_EQ(protocol::SessionManager::OVERLOAD, response); |
| ShutdownHost(); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, OnSessionRouteChange) { |
| @@ -661,7 +656,6 @@ TEST_F(ChromotingHostTest, OnSessionRouteChange) { |
| host_->Start(xmpp_login_); |
| SimulateClientConnection(0, true, false); |
| - message_loop_.Run(); |
| } |
| TEST_F(ChromotingHostTest, DisconnectAllClients) { |
| @@ -674,7 +668,6 @@ TEST_F(ChromotingHostTest, DisconnectAllClients) { |
| host_->Start(xmpp_login_); |
| SimulateClientConnection(0, true, false); |
| - message_loop_.Run(); |
| } |
| } // namespace remoting |