| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void ClientSessionTest::CreateClientSession() { | 170 void ClientSessionTest::CreateClientSession() { |
| 171 // Mock protocol::Session APIs called directly by ClientSession. | 171 // Mock protocol::Session APIs called directly by ClientSession. |
| 172 scoped_ptr<protocol::MockSession> session(new MockSession()); | 172 scoped_ptr<protocol::MockSession> session(new MockSession()); |
| 173 EXPECT_CALL(*session, config()).WillRepeatedly(ReturnRef(*session_config_)); | 173 EXPECT_CALL(*session, config()).WillRepeatedly(ReturnRef(*session_config_)); |
| 174 EXPECT_CALL(*session, jid()).WillRepeatedly(ReturnRef(client_jid_)); | 174 EXPECT_CALL(*session, jid()).WillRepeatedly(ReturnRef(client_jid_)); |
| 175 | 175 |
| 176 // Mock protocol::ConnectionToClient APIs called directly by ClientSession. | 176 // Mock protocol::ConnectionToClient APIs called directly by ClientSession. |
| 177 // HostStub is not touched by ClientSession, so we can safely pass nullptr. | 177 // HostStub is not touched by ClientSession, so we can safely pass nullptr. |
| 178 scoped_ptr<protocol::FakeConnectionToClient> connection( | 178 scoped_ptr<protocol::FakeConnectionToClient> connection( |
| 179 new protocol::FakeConnectionToClient(session.Pass())); | 179 new protocol::FakeConnectionToClient(std::move(session))); |
| 180 connection->set_client_stub(&client_stub_); | 180 connection->set_client_stub(&client_stub_); |
| 181 connection_ = connection.get(); | 181 connection_ = connection.get(); |
| 182 | 182 |
| 183 client_session_.reset(new ClientSession( | 183 client_session_.reset(new ClientSession( |
| 184 &session_event_handler_, | 184 &session_event_handler_, |
| 185 task_runner_, // Audio thread. | 185 task_runner_, // Audio thread. |
| 186 task_runner_, // Input thread. | 186 task_runner_, // Input thread. |
| 187 task_runner_, // Capture thread. | 187 task_runner_, // Capture thread. |
| 188 task_runner_, // Encode thread. | 188 task_runner_, // Encode thread. |
| 189 task_runner_, // Network thread. | 189 task_runner_, // Network thread. |
| 190 task_runner_, // UI thread. | 190 task_runner_, // UI thread. |
| 191 connection.Pass(), | 191 std::move(connection), |
| 192 desktop_environment_factory_.get(), | 192 desktop_environment_factory_.get(), |
| 193 base::TimeDelta(), | 193 base::TimeDelta(), |
| 194 nullptr, | 194 nullptr, |
| 195 extensions_)); | 195 extensions_)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void ClientSessionTest::ConnectClientSession() { | 198 void ClientSessionTest::ConnectClientSession() { |
| 199 EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_)); | 199 EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_)); |
| 200 EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_)); | 200 EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_)); |
| 201 | 201 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 | 515 |
| 516 client_session_->DisconnectSession(protocol::OK); | 516 client_session_->DisconnectSession(protocol::OK); |
| 517 client_session_.reset(); | 517 client_session_.reset(); |
| 518 | 518 |
| 519 // ext1 was instantiated and wrapped the video capturer. | 519 // ext1 was instantiated and wrapped the video capturer. |
| 520 EXPECT_TRUE(extension.was_instantiated()); | 520 EXPECT_TRUE(extension.was_instantiated()); |
| 521 EXPECT_TRUE(extension.has_wrapped_video_capturer()); | 521 EXPECT_TRUE(extension.has_wrapped_video_capturer()); |
| 522 } | 522 } |
| 523 | 523 |
| 524 } // namespace remoting | 524 } // namespace remoting |
| OLD | NEW |