Index: remoting/host/chromoting_host_unittest.cc |
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc |
index f01539bf7886dadce55bab3183f5193fcd6ba99e..5c631f052d317b4aaf0a377e8cc1f2998b1f81e0 100644 |
--- a/remoting/host/chromoting_host_unittest.cc |
+++ b/remoting/host/chromoting_host_unittest.cc |
@@ -136,7 +136,7 @@ class ChromotingHostTest : public testing::Test { |
get_client(connection_index) = client_ptr; |
// |host| is responsible for deleting |client| from now on. |
- host_->clients_.push_back(client.release()); |
+ host_->clients_.push_back(std::move(client)); |
if (authenticate) { |
client_ptr->OnConnectionAuthenticated(); |
@@ -244,11 +244,6 @@ class ChromotingHostTest : public testing::Test { |
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_; |
} |
@@ -338,7 +333,8 @@ TEST_F(ChromotingHostTest, LoginBackOffUponConnection) { |
host_->OnIncomingSession(session_unowned1_.release(), &response); |
EXPECT_EQ(protocol::SessionManager::ACCEPT, response); |
- host_->OnSessionAuthenticating(get_clients_from_host().front()); |
+ host_->OnSessionAuthenticating( |
+ host_->client_sessions_for_tests().front().get()); |
host_->OnIncomingSession(session_unowned2_.get(), &response); |
EXPECT_EQ(protocol::SessionManager::OVERLOAD, response); |
} |
@@ -362,13 +358,15 @@ TEST_F(ChromotingHostTest, LoginBackOffUponAuthenticating) { |
EXPECT_EQ(protocol::SessionManager::ACCEPT, response); |
// This will set the backoff. |
- host_->OnSessionAuthenticating(get_clients_from_host().front()); |
+ host_->OnSessionAuthenticating( |
+ host_->client_sessions_for_tests().front().get()); |
// This should disconnect client2. |
- host_->OnSessionAuthenticating(get_clients_from_host().back()); |
+ host_->OnSessionAuthenticating( |
+ host_->client_sessions_for_tests().back().get()); |
// Verify that the host only has 1 client at this point. |
- EXPECT_EQ(get_clients_from_host().size(), 1U); |
+ EXPECT_EQ(host_->client_sessions_for_tests().size(), 1U); |
} |
TEST_F(ChromotingHostTest, OnSessionRouteChange) { |