OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #if defined(WEBRTC_POSIX) | 10 #if defined(WEBRTC_POSIX) |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // helper methods call this, such that "SetIceRole" and "ConnectSignals" (and | 256 // helper methods call this, such that "SetIceRole" and "ConnectSignals" (and |
257 // possibly other things in the future) only happen in one place. | 257 // possibly other things in the future) only happen in one place. |
258 void CreateTurnPortWithAllParams(rtc::Network* network, | 258 void CreateTurnPortWithAllParams(rtc::Network* network, |
259 const std::string& username, | 259 const std::string& username, |
260 const std::string& password, | 260 const std::string& password, |
261 const ProtocolAddress& server_address, | 261 const ProtocolAddress& server_address, |
262 const std::string& origin) { | 262 const std::string& origin) { |
263 RelayCredentials credentials(username, password); | 263 RelayCredentials credentials(username, password); |
264 turn_port_.reset(TurnPort::Create(&main_, &socket_factory_, network, 0, 0, | 264 turn_port_.reset(TurnPort::Create(&main_, &socket_factory_, network, 0, 0, |
265 kIceUfrag1, kIcePwd1, server_address, | 265 kIceUfrag1, kIcePwd1, server_address, |
266 credentials, 0, origin)); | 266 credentials, 0, origin, |
| 267 std::vector<std::string>())); |
267 // This TURN port will be the controlling. | 268 // This TURN port will be the controlling. |
268 turn_port_->SetIceRole(ICEROLE_CONTROLLING); | 269 turn_port_->SetIceRole(ICEROLE_CONTROLLING); |
269 ConnectSignals(); | 270 ConnectSignals(); |
270 | 271 |
271 if (server_address.proto == cricket::PROTO_TLS) { | 272 if (server_address.proto == cricket::PROTO_TLS) { |
272 // The test TURN server has a self-signed certificate so will not pass | 273 // The test TURN server has a self-signed certificate so will not pass |
273 // the normal client validation. Instruct the client to ignore certificate | 274 // the normal client validation. Instruct the client to ignore certificate |
274 // errors for testing only. | 275 // errors for testing only. |
275 turn_port_->SetTlsCertPolicy( | 276 turn_port_->SetTlsCertPolicy( |
276 TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK); | 277 TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK); |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 EXPECT_TRUE(turn_port_->Candidates().empty()); | 1439 EXPECT_TRUE(turn_port_->Candidates().empty()); |
1439 turn_port_.reset(); | 1440 turn_port_.reset(); |
1440 rtc::Thread::Current()->Post(RTC_FROM_HERE, this, MSG_TESTFINISH); | 1441 rtc::Thread::Current()->Post(RTC_FROM_HERE, this, MSG_TESTFINISH); |
1441 // Waiting for above message to be processed. | 1442 // Waiting for above message to be processed. |
1442 ASSERT_TRUE_SIMULATED_WAIT(test_finish_, 1, fake_clock_); | 1443 ASSERT_TRUE_SIMULATED_WAIT(test_finish_, 1, fake_clock_); |
1443 EXPECT_EQ(last_fd_count, GetFDCount()); | 1444 EXPECT_EQ(last_fd_count, GetFDCount()); |
1444 } | 1445 } |
1445 #endif | 1446 #endif |
1446 | 1447 |
1447 } // namespace cricket | 1448 } // namespace cricket |
OLD | NEW |