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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "remoting/base/auto_thread_task_runner.h" | 9 #include "remoting/base/auto_thread_task_runner.h" |
10 #include "remoting/host/audio_capturer.h" | 10 #include "remoting/host/audio_capturer.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 empty_candidate_config_ = | 175 empty_candidate_config_ = |
176 protocol::CandidateSessionConfig::CreateEmpty(); | 176 protocol::CandidateSessionConfig::CreateEmpty(); |
177 default_candidate_config_ = | 177 default_candidate_config_ = |
178 protocol::CandidateSessionConfig::CreateDefault(); | 178 protocol::CandidateSessionConfig::CreateDefault(); |
179 } | 179 } |
180 | 180 |
181 // Helper method to pretend a client is connected to ChromotingHost. | 181 // Helper method to pretend a client is connected to ChromotingHost. |
182 void SimulateClientConnection(int connection_index, bool authenticate, | 182 void SimulateClientConnection(int connection_index, bool authenticate, |
183 bool reject) { | 183 bool reject) { |
184 scoped_ptr<protocol::ConnectionToClient> connection = | 184 scoped_ptr<protocol::ConnectionToClient> connection = |
185 ((connection_index == 0) ? owned_connection1_ : owned_connection2_). | 185 ((connection_index == 0) ? owned_connection1_ : owned_connection2_) |
186 PassAs<protocol::ConnectionToClient>(); | 186 .Pass(); |
187 protocol::ConnectionToClient* connection_ptr = connection.get(); | 187 protocol::ConnectionToClient* connection_ptr = connection.get(); |
188 scoped_ptr<ClientSession> client(new ClientSession( | 188 scoped_ptr<ClientSession> client(new ClientSession( |
189 host_.get(), | 189 host_.get(), |
190 task_runner_, // Audio | 190 task_runner_, // Audio |
191 task_runner_, // Input | 191 task_runner_, // Input |
192 task_runner_, // Video capture | 192 task_runner_, // Video capture |
193 task_runner_, // Video encode | 193 task_runner_, // Video encode |
194 task_runner_, // Network | 194 task_runner_, // Network |
195 task_runner_, // UI | 195 task_runner_, // UI |
196 connection.Pass(), | 196 connection.Pass(), |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 ExpectClientDisconnected(0, true, video_packet_sent, | 711 ExpectClientDisconnected(0, true, video_packet_sent, |
712 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); | 712 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); |
713 EXPECT_CALL(host_status_observer_, OnShutdown()); | 713 EXPECT_CALL(host_status_observer_, OnShutdown()); |
714 | 714 |
715 host_->Start(xmpp_login_); | 715 host_->Start(xmpp_login_); |
716 SimulateClientConnection(0, true, false); | 716 SimulateClientConnection(0, true, false); |
717 message_loop_.Run(); | 717 message_loop_.Run(); |
718 } | 718 } |
719 | 719 |
720 } // namespace remoting | 720 } // namespace remoting |
OLD | NEW |