OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/protocol/webrtc_transport.h" | 5 #include "remoting/protocol/webrtc_transport.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 EXPECT_TRUE( | 177 EXPECT_TRUE( |
178 (*target_transport)->ProcessTransportInfo(transport_info.get())); | 178 (*target_transport)->ProcessTransportInfo(transport_info.get())); |
179 } | 179 } |
180 | 180 |
181 void InitializeConnection() { | 181 void InitializeConnection() { |
182 host_transport_.reset( | 182 host_transport_.reset( |
183 new WebrtcTransport(jingle_glue::JingleThreadWrapper::current(), | 183 new WebrtcTransport(jingle_glue::JingleThreadWrapper::current(), |
184 TransportContext::ForTests(TransportRole::SERVER), | 184 TransportContext::ForTests(TransportRole::SERVER), |
185 &host_event_handler_)); | 185 &host_event_handler_)); |
186 host_authenticator_.reset(new FakeAuthenticator( | 186 host_authenticator_.reset(new FakeAuthenticator(FakeAuthenticator::ACCEPT)); |
187 FakeAuthenticator::HOST, 0, FakeAuthenticator::ACCEPT, false)); | |
188 host_authenticator_->set_auth_key(kAuthKey); | 187 host_authenticator_->set_auth_key(kAuthKey); |
189 | 188 |
190 client_transport_.reset( | 189 client_transport_.reset( |
191 new WebrtcTransport(jingle_glue::JingleThreadWrapper::current(), | 190 new WebrtcTransport(jingle_glue::JingleThreadWrapper::current(), |
192 TransportContext::ForTests(TransportRole::CLIENT), | 191 TransportContext::ForTests(TransportRole::CLIENT), |
193 &client_event_handler_)); | 192 &client_event_handler_)); |
194 client_authenticator_.reset(new FakeAuthenticator( | 193 client_authenticator_.reset( |
195 FakeAuthenticator::CLIENT, 0, FakeAuthenticator::ACCEPT, false)); | 194 new FakeAuthenticator(FakeAuthenticator::ACCEPT)); |
196 client_authenticator_->set_auth_key(kAuthKey); | 195 client_authenticator_->set_auth_key(kAuthKey); |
197 } | 196 } |
198 | 197 |
199 void StartConnection() { | 198 void StartConnection() { |
200 host_event_handler_.set_connected_callback(base::Bind(&base::DoNothing)); | 199 host_event_handler_.set_connected_callback(base::Bind(&base::DoNothing)); |
201 client_event_handler_.set_connected_callback(base::Bind(&base::DoNothing)); | 200 client_event_handler_.set_connected_callback(base::Bind(&base::DoNothing)); |
202 | 201 |
203 host_event_handler_.set_error_callback( | 202 host_event_handler_.set_error_callback( |
204 base::Bind(&WebrtcTransportTest::OnSessionError, base::Unretained(this), | 203 base::Bind(&WebrtcTransportTest::OnSessionError, base::Unretained(this), |
205 TransportRole::SERVER)); | 204 TransportRole::SERVER)); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 run_loop_.reset(new base::RunLoop()); | 409 run_loop_.reset(new base::RunLoop()); |
411 run_loop_->Run(); | 410 run_loop_->Run(); |
412 | 411 |
413 // Check that OnHostChannelClosed() has been called. | 412 // Check that OnHostChannelClosed() has been called. |
414 EXPECT_EQ(OK, host_error_); | 413 EXPECT_EQ(OK, host_error_); |
415 EXPECT_FALSE(host_message_pipe_); | 414 EXPECT_FALSE(host_message_pipe_); |
416 } | 415 } |
417 | 416 |
418 } // namespace protocol | 417 } // namespace protocol |
419 } // namespace remoting | 418 } // namespace remoting |
OLD | NEW |