Index: remoting/host/chromoting_host_unittest.cc |
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc |
index 5c631f052d317b4aaf0a377e8cc1f2998b1f81e0..f01539bf7886dadce55bab3183f5193fcd6ba99e 100644 |
--- a/remoting/host/chromoting_host_unittest.cc |
+++ b/remoting/host/chromoting_host_unittest.cc |
@@ -136,7 +136,7 @@ |
get_client(connection_index) = client_ptr; |
// |host| is responsible for deleting |client| from now on. |
- host_->clients_.push_back(std::move(client)); |
+ host_->clients_.push_back(client.release()); |
if (authenticate) { |
client_ptr->OnConnectionAuthenticated(); |
@@ -244,6 +244,11 @@ |
return (connection_index == 0) ? client1_ : client2_; |
} |
+ // Returns the list of clients of the host_. |
+ std::list<ClientSession*>& get_clients_from_host() { |
+ return host_->clients_; |
+ } |
+ |
const std::string& get_session_jid(int connection_index) { |
return (connection_index == 0) ? session_jid1_ : session_jid2_; |
} |
@@ -333,8 +338,7 @@ |
host_->OnIncomingSession(session_unowned1_.release(), &response); |
EXPECT_EQ(protocol::SessionManager::ACCEPT, response); |
- host_->OnSessionAuthenticating( |
- host_->client_sessions_for_tests().front().get()); |
+ host_->OnSessionAuthenticating(get_clients_from_host().front()); |
host_->OnIncomingSession(session_unowned2_.get(), &response); |
EXPECT_EQ(protocol::SessionManager::OVERLOAD, response); |
} |
@@ -358,15 +362,13 @@ |
EXPECT_EQ(protocol::SessionManager::ACCEPT, response); |
// This will set the backoff. |
- host_->OnSessionAuthenticating( |
- host_->client_sessions_for_tests().front().get()); |
+ host_->OnSessionAuthenticating(get_clients_from_host().front()); |
// This should disconnect client2. |
- host_->OnSessionAuthenticating( |
- host_->client_sessions_for_tests().back().get()); |
+ host_->OnSessionAuthenticating(get_clients_from_host().back()); |
// Verify that the host only has 1 client at this point. |
- EXPECT_EQ(host_->client_sessions_for_tests().size(), 1U); |
+ EXPECT_EQ(get_clients_from_host().size(), 1U); |
} |
TEST_F(ChromotingHostTest, OnSessionRouteChange) { |