| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 | 245 |
| 246 // This function starts the port/address gathering and check the existence of | 246 // This function starts the port/address gathering and check the existence of |
| 247 // candidates as specified. When |expect_stun_candidate| is true, | 247 // candidates as specified. When |expect_stun_candidate| is true, |
| 248 // |stun_candidate_addr| carries the expected reflective address, which is | 248 // |stun_candidate_addr| carries the expected reflective address, which is |
| 249 // also the related address for TURN candidate if it is expected. Otherwise, | 249 // also the related address for TURN candidate if it is expected. Otherwise, |
| 250 // it should be ignore. | 250 // it should be ignore. |
| 251 void CheckDisableAdapterEnumeration( | 251 void CheckDisableAdapterEnumeration( |
| 252 uint32 total_ports, | 252 uint32_t total_ports, |
| 253 const rtc::IPAddress& host_candidate_addr, | 253 const rtc::IPAddress& host_candidate_addr, |
| 254 const rtc::IPAddress& stun_candidate_addr, | 254 const rtc::IPAddress& stun_candidate_addr, |
| 255 const rtc::IPAddress& relay_candidate_udp_transport_addr, | 255 const rtc::IPAddress& relay_candidate_udp_transport_addr, |
| 256 const rtc::IPAddress& relay_candidate_tcp_transport_addr) { | 256 const rtc::IPAddress& relay_candidate_tcp_transport_addr) { |
| 257 if (!session_) { | 257 if (!session_) { |
| 258 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); | 258 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
| 259 } | 259 } |
| 260 session_->set_flags(session_->flags() | | 260 session_->set_flags(session_->flags() | |
| 261 cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION | | 261 cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION | |
| 262 cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); | 262 cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
| 263 allocator().set_allow_tcp_listen(false); | 263 allocator().set_allow_tcp_listen(false); |
| 264 session_->StartGettingPorts(); | 264 session_->StartGettingPorts(); |
| 265 EXPECT_TRUE_WAIT(candidate_allocation_done_, kDefaultAllocationTimeout); | 265 EXPECT_TRUE_WAIT(candidate_allocation_done_, kDefaultAllocationTimeout); |
| 266 | 266 |
| 267 uint32 total_candidates = 0; | 267 uint32_t total_candidates = 0; |
| 268 if (!host_candidate_addr.IsNil()) { | 268 if (!host_candidate_addr.IsNil()) { |
| 269 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], | 269 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], |
| 270 cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp", | 270 cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp", |
| 271 rtc::SocketAddress(host_candidate_addr, 0)); | 271 rtc::SocketAddress(host_candidate_addr, 0)); |
| 272 ++total_candidates; | 272 ++total_candidates; |
| 273 } | 273 } |
| 274 if (!stun_candidate_addr.IsNil()) { | 274 if (!stun_candidate_addr.IsNil()) { |
| 275 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], | 275 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], |
| 276 cricket::ICE_CANDIDATE_COMPONENT_RTP, "stun", "udp", | 276 cricket::ICE_CANDIDATE_COMPONENT_RTP, "stun", "udp", |
| 277 rtc::SocketAddress(stun_candidate_addr, 0)); | 277 rtc::SocketAddress(stun_candidate_addr, 0)); |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 | 1326 |
| 1327 // After clearing getting ports, adding a new interface will start getting | 1327 // After clearing getting ports, adding a new interface will start getting |
| 1328 // ports again. | 1328 // ports again. |
| 1329 candidates_.clear(); | 1329 candidates_.clear(); |
| 1330 ports_.clear(); | 1330 ports_.clear(); |
| 1331 candidate_allocation_done_ = false; | 1331 candidate_allocation_done_ = false; |
| 1332 network_manager_.AddInterface(kClientAddr2); | 1332 network_manager_.AddInterface(kClientAddr2); |
| 1333 ASSERT_EQ_WAIT(2U, candidates_.size(), 1000); | 1333 ASSERT_EQ_WAIT(2U, candidates_.size(), 1000); |
| 1334 EXPECT_EQ(2U, ports_.size()); | 1334 EXPECT_EQ(2U, ports_.size()); |
| 1335 } | 1335 } |
| OLD | NEW |