| 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 18 matching lines...) Expand all Loading... |
| 29 #include "webrtc/base/socketaddress.h" | 29 #include "webrtc/base/socketaddress.h" |
| 30 #include "webrtc/base/ssladapter.h" | 30 #include "webrtc/base/ssladapter.h" |
| 31 #include "webrtc/base/thread.h" | 31 #include "webrtc/base/thread.h" |
| 32 #include "webrtc/base/virtualsocketserver.h" | 32 #include "webrtc/base/virtualsocketserver.h" |
| 33 | 33 |
| 34 using cricket::ServerAddresses; | 34 using cricket::ServerAddresses; |
| 35 using rtc::SocketAddress; | 35 using rtc::SocketAddress; |
| 36 using rtc::Thread; | 36 using rtc::Thread; |
| 37 | 37 |
| 38 static const SocketAddress kClientAddr("11.11.11.11", 0); | 38 static const SocketAddress kClientAddr("11.11.11.11", 0); |
| 39 static const SocketAddress kLoopbackAddr("127.0.0.1", 0); | |
| 40 static const SocketAddress kPrivateAddr("192.168.1.11", 0); | 39 static const SocketAddress kPrivateAddr("192.168.1.11", 0); |
| 41 static const SocketAddress kPrivateAddr2("192.168.1.12", 0); | 40 static const SocketAddress kPrivateAddr2("192.168.1.12", 0); |
| 42 static const SocketAddress kClientIPv6Addr( | 41 static const SocketAddress kClientIPv6Addr( |
| 43 "2401:fa00:4:1000:be30:5bff:fee5:c3", 0); | 42 "2401:fa00:4:1000:be30:5bff:fee5:c3", 0); |
| 44 static const SocketAddress kClientAddr2("22.22.22.22", 0); | 43 static const SocketAddress kClientAddr2("22.22.22.22", 0); |
| 45 static const SocketAddress kNatUdpAddr("77.77.77.77", rtc::NAT_SERVER_UDP_PORT); | 44 static const SocketAddress kNatUdpAddr("77.77.77.77", rtc::NAT_SERVER_UDP_PORT); |
| 46 static const SocketAddress kNatTcpAddr("77.77.77.77", rtc::NAT_SERVER_TCP_PORT); | 45 static const SocketAddress kNatTcpAddr("77.77.77.77", rtc::NAT_SERVER_TCP_PORT); |
| 47 static const SocketAddress kRemoteClientAddr("22.22.22.22", 0); | 46 static const SocketAddress kRemoteClientAddr("22.22.22.22", 0); |
| 48 static const SocketAddress kStunAddr("99.99.99.1", cricket::STUN_SERVER_PORT); | 47 static const SocketAddress kStunAddr("99.99.99.1", cricket::STUN_SERVER_PORT); |
| 49 static const SocketAddress kRelayUdpIntAddr("99.99.99.2", 5000); | 48 static const SocketAddress kRelayUdpIntAddr("99.99.99.2", 5000); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 236 } |
| 238 } | 237 } |
| 239 | 238 |
| 240 // This function starts the port/address gathering and check the existence of | 239 // This function starts the port/address gathering and check the existence of |
| 241 // candidates as specified. When |expect_stun_candidate| is true, | 240 // candidates as specified. When |expect_stun_candidate| is true, |
| 242 // |stun_candidate_addr| carries the expected reflective address, which is | 241 // |stun_candidate_addr| carries the expected reflective address, which is |
| 243 // also the related address for TURN candidate if it is expected. Otherwise, | 242 // also the related address for TURN candidate if it is expected. Otherwise, |
| 244 // it should be ignore. | 243 // it should be ignore. |
| 245 void CheckDisableAdapterEnumeration( | 244 void CheckDisableAdapterEnumeration( |
| 246 uint32 total_ports, | 245 uint32 total_ports, |
| 247 const rtc::IPAddress& host_candidate_addr, | |
| 248 const rtc::IPAddress& stun_candidate_addr, | 246 const rtc::IPAddress& stun_candidate_addr, |
| 249 const rtc::IPAddress& relay_candidate_udp_transport_addr, | 247 const rtc::IPAddress& relay_candidate_udp_transport_addr, |
| 250 const rtc::IPAddress& relay_candidate_tcp_transport_addr) { | 248 const rtc::IPAddress& relay_candidate_tcp_transport_addr) { |
| 251 if (!session_) { | 249 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
| 252 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); | 250 session_->set_flags(cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION | |
| 253 } | |
| 254 session_->set_flags(session_->flags() | | |
| 255 cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION | | |
| 256 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | | 251 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
| 257 cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); | 252 cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
| 258 allocator().set_allow_tcp_listen(false); | 253 allocator().set_allow_tcp_listen(false); |
| 259 session_->StartGettingPorts(); | 254 session_->StartGettingPorts(); |
| 260 EXPECT_TRUE_WAIT(candidate_allocation_done_, kDefaultAllocationTimeout); | 255 EXPECT_TRUE_WAIT(candidate_allocation_done_, kDefaultAllocationTimeout); |
| 261 | 256 |
| 262 uint32 total_candidates = 0; | 257 uint32 total_candidates = 0; |
| 263 if (!host_candidate_addr.IsNil()) { | 258 if (!stun_candidate_addr.IsNil()) { |
| 264 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], | |
| 265 cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp", | |
| 266 rtc::SocketAddress(host_candidate_addr, 0)); | |
| 267 ++total_candidates; | 259 ++total_candidates; |
| 268 } | 260 EXPECT_PRED5(CheckCandidate, candidates_[0], |
| 269 if (!stun_candidate_addr.IsNil()) { | |
| 270 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], | |
| 271 cricket::ICE_CANDIDATE_COMPONENT_RTP, "stun", "udp", | 261 cricket::ICE_CANDIDATE_COMPONENT_RTP, "stun", "udp", |
| 272 rtc::SocketAddress(stun_candidate_addr, 0)); | 262 rtc::SocketAddress(stun_candidate_addr, 0)); |
| 273 EXPECT_EQ(rtc::EmptySocketAddressWithFamily( | 263 EXPECT_EQ( |
| 274 candidates_[total_candidates].address().family()), | 264 rtc::EmptySocketAddressWithFamily(candidates_[0].address().family()), |
| 275 candidates_[total_candidates].related_address()); | 265 candidates_[0].related_address()); |
| 276 ++total_candidates; | |
| 277 } | 266 } |
| 278 if (!relay_candidate_udp_transport_addr.IsNil()) { | 267 if (!relay_candidate_udp_transport_addr.IsNil()) { |
| 279 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], | 268 ++total_candidates; |
| 269 EXPECT_PRED5(CheckCandidate, candidates_[1], |
| 280 cricket::ICE_CANDIDATE_COMPONENT_RTP, "relay", "udp", | 270 cricket::ICE_CANDIDATE_COMPONENT_RTP, "relay", "udp", |
| 281 rtc::SocketAddress(relay_candidate_udp_transport_addr, 0)); | 271 rtc::SocketAddress(relay_candidate_udp_transport_addr, 0)); |
| 282 EXPECT_EQ(stun_candidate_addr, | 272 EXPECT_EQ(stun_candidate_addr, candidates_[1].related_address().ipaddr()); |
| 283 candidates_[total_candidates].related_address().ipaddr()); | |
| 284 ++total_candidates; | |
| 285 } | 273 } |
| 286 if (!relay_candidate_tcp_transport_addr.IsNil()) { | 274 if (!relay_candidate_tcp_transport_addr.IsNil()) { |
| 287 EXPECT_PRED5(CheckCandidate, candidates_[total_candidates], | 275 ++total_candidates; |
| 276 EXPECT_PRED5(CheckCandidate, candidates_[2], |
| 288 cricket::ICE_CANDIDATE_COMPONENT_RTP, "relay", "udp", | 277 cricket::ICE_CANDIDATE_COMPONENT_RTP, "relay", "udp", |
| 289 rtc::SocketAddress(relay_candidate_tcp_transport_addr, 0)); | 278 rtc::SocketAddress(relay_candidate_tcp_transport_addr, 0)); |
| 290 EXPECT_EQ(stun_candidate_addr, | 279 EXPECT_EQ(stun_candidate_addr, candidates_[2].related_address().ipaddr()); |
| 291 candidates_[total_candidates].related_address().ipaddr()); | |
| 292 ++total_candidates; | |
| 293 } | 280 } |
| 294 | 281 |
| 295 EXPECT_EQ(total_candidates, candidates_.size()); | 282 EXPECT_EQ(total_candidates, candidates_.size()); |
| 296 EXPECT_EQ(total_ports, ports_.size()); | 283 EXPECT_EQ(total_ports, ports_.size()); |
| 297 } | 284 } |
| 298 | 285 |
| 299 protected: | 286 protected: |
| 300 cricket::BasicPortAllocator& allocator() { | 287 cricket::BasicPortAllocator& allocator() { |
| 301 return *allocator_; | 288 return *allocator_; |
| 302 } | 289 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 session_->StartGettingPorts(); | 376 session_->StartGettingPorts(); |
| 390 // Waiting for one second to make sure BasicPortAllocatorSession has not | 377 // Waiting for one second to make sure BasicPortAllocatorSession has not |
| 391 // called OnAllocate multiple times. In old behavior it's called every 250ms. | 378 // called OnAllocate multiple times. In old behavior it's called every 250ms. |
| 392 // When there are no network interfaces, each execution of OnAllocate will | 379 // When there are no network interfaces, each execution of OnAllocate will |
| 393 // result in SignalCandidatesAllocationDone signal. | 380 // result in SignalCandidatesAllocationDone signal. |
| 394 rtc::Thread::Current()->ProcessMessages(1000); | 381 rtc::Thread::Current()->ProcessMessages(1000); |
| 395 EXPECT_TRUE(candidate_allocation_done_); | 382 EXPECT_TRUE(candidate_allocation_done_); |
| 396 EXPECT_EQ(0U, candidates_.size()); | 383 EXPECT_EQ(0U, candidates_.size()); |
| 397 } | 384 } |
| 398 | 385 |
| 399 // Test that we could use loopback interface as host candidate. | |
| 400 TEST_F(PortAllocatorTest, TestLoopbackNetworkInterface) { | |
| 401 AddInterface(kLoopbackAddr); | |
| 402 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); | |
| 403 session_->set_flags(cricket::PORTALLOCATOR_DISABLE_STUN | | |
| 404 cricket::PORTALLOCATOR_DISABLE_RELAY | | |
| 405 cricket::PORTALLOCATOR_DISABLE_TCP); | |
| 406 session_->StartGettingPorts(); | |
| 407 EXPECT_TRUE_WAIT(candidate_allocation_done_, kDefaultAllocationTimeout); | |
| 408 EXPECT_EQ(1U, candidates_.size()); | |
| 409 } | |
| 410 | |
| 411 // Tests that we can get all the desired addresses successfully. | 386 // Tests that we can get all the desired addresses successfully. |
| 412 TEST_F(PortAllocatorTest, TestGetAllPortsWithMinimumStepDelay) { | 387 TEST_F(PortAllocatorTest, TestGetAllPortsWithMinimumStepDelay) { |
| 413 AddInterface(kClientAddr); | 388 AddInterface(kClientAddr); |
| 414 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); | 389 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
| 415 session_->StartGettingPorts(); | 390 session_->StartGettingPorts(); |
| 416 ASSERT_EQ_WAIT(7U, candidates_.size(), kDefaultAllocationTimeout); | 391 ASSERT_EQ_WAIT(7U, candidates_.size(), kDefaultAllocationTimeout); |
| 417 EXPECT_EQ(4U, ports_.size()); | 392 EXPECT_EQ(4U, ports_.size()); |
| 418 EXPECT_PRED5(CheckCandidate, candidates_[0], | 393 EXPECT_PRED5(CheckCandidate, candidates_[0], |
| 419 cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp", kClientAddr); | 394 cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp", kClientAddr); |
| 420 EXPECT_PRED5(CheckCandidate, candidates_[1], | 395 EXPECT_PRED5(CheckCandidate, candidates_[1], |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 502 |
| 528 // Test that we should only get STUN and TURN candidates when adapter | 503 // Test that we should only get STUN and TURN candidates when adapter |
| 529 // enumeration is disabled. | 504 // enumeration is disabled. |
| 530 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationBehindNat) { | 505 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationBehindNat) { |
| 531 AddInterface(kClientAddr); | 506 AddInterface(kClientAddr); |
| 532 // GTURN is not configured here. | 507 // GTURN is not configured here. |
| 533 ResetWithStunServerAndNat(kStunAddr); | 508 ResetWithStunServerAndNat(kStunAddr); |
| 534 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); | 509 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); |
| 535 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, and both STUN and | 510 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, and both STUN and |
| 536 // TURN/UDP candidates. | 511 // TURN/UDP candidates. |
| 537 CheckDisableAdapterEnumeration(3U, rtc::IPAddress(), kNatUdpAddr.ipaddr(), | 512 CheckDisableAdapterEnumeration(3U, kNatUdpAddr.ipaddr(), |
| 538 kTurnUdpExtAddr.ipaddr(), rtc::IPAddress()); | 513 kTurnUdpExtAddr.ipaddr(), rtc::IPAddress()); |
| 539 } | 514 } |
| 540 | 515 |
| 541 // Test that even with multiple interfaces, the result should still be one STUN | 516 // Test that even with multiple interfaces, the result should still be one STUN |
| 542 // and one TURN candidate since we bind to any address (i.e. all 0s). | 517 // and one TURN candidate since we bind to any address (i.e. all 0s). |
| 543 TEST_F(PortAllocatorTest, | 518 TEST_F(PortAllocatorTest, |
| 544 TestDisableAdapterEnumerationBehindNatMultipleInterfaces) { | 519 TestDisableAdapterEnumerationBehindNatMultipleInterfaces) { |
| 545 AddInterface(kPrivateAddr); | 520 AddInterface(kPrivateAddr); |
| 546 AddInterface(kPrivateAddr2); | 521 AddInterface(kPrivateAddr2); |
| 547 ResetWithStunServerAndNat(kStunAddr); | 522 ResetWithStunServerAndNat(kStunAddr); |
| 548 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); | 523 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); |
| 549 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, and both STUN and | 524 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, and both STUN and |
| 550 // TURN/UDP candidates. | 525 // TURN/UDP candidates. |
| 551 CheckDisableAdapterEnumeration(3U, rtc::IPAddress(), kNatUdpAddr.ipaddr(), | 526 CheckDisableAdapterEnumeration(3U, kNatUdpAddr.ipaddr(), |
| 552 kTurnUdpExtAddr.ipaddr(), rtc::IPAddress()); | 527 kTurnUdpExtAddr.ipaddr(), rtc::IPAddress()); |
| 553 } | 528 } |
| 554 | 529 |
| 555 // Test that we should get STUN, TURN/UDP and TURN/TCP candidates when a | 530 // Test that we should get STUN, TURN/UDP and TURN/TCP candidates when a |
| 556 // TURN/TCP server is specified. | 531 // TURN/TCP server is specified. |
| 557 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationBehindNatWithTcp) { | 532 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationBehindNatWithTcp) { |
| 558 turn_server_.AddInternalSocket(kTurnTcpIntAddr, cricket::PROTO_TCP); | 533 turn_server_.AddInternalSocket(kTurnTcpIntAddr, cricket::PROTO_TCP); |
| 559 AddInterface(kClientAddr); | 534 AddInterface(kClientAddr); |
| 560 // GTURN is not configured here. | 535 // GTURN is not configured here. |
| 561 ResetWithStunServerAndNat(kStunAddr); | 536 ResetWithStunServerAndNat(kStunAddr); |
| 562 AddTurnServers(kTurnUdpIntAddr, kTurnTcpIntAddr); | 537 AddTurnServers(kTurnUdpIntAddr, kTurnTcpIntAddr); |
| 563 // Expect to see 4 ports - STUN, TURN/UDP, TURN/TCP and TCP port. STUN, | 538 // Expect to see 4 ports - STUN, TURN/UDP, TURN/TCP and TCP port. STUN, |
| 564 // TURN/UDP, and TURN/TCP candidates. | 539 // TURN/UDP, and TURN/TCP candidates. |
| 565 CheckDisableAdapterEnumeration(4U, rtc::IPAddress(), kNatUdpAddr.ipaddr(), | 540 CheckDisableAdapterEnumeration(4U, kNatUdpAddr.ipaddr(), |
| 566 kTurnUdpExtAddr.ipaddr(), | 541 kTurnUdpExtAddr.ipaddr(), |
| 567 kTurnUdpExtAddr.ipaddr()); | 542 kTurnUdpExtAddr.ipaddr()); |
| 568 } | 543 } |
| 569 | 544 |
| 570 // Test that we should only get STUN and TURN candidates when adapter | 545 // Test that we should only get STUN and TURN candidates when adapter |
| 571 // enumeration is disabled. Since the endpoint is not behind NAT, the srflx | 546 // enumeration is disabled. Since the endpoint is not behind NAT, the srflx |
| 572 // address should be the public client interface. | 547 // address should be the public client interface. |
| 573 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationWithoutNat) { | 548 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationWithoutNat) { |
| 574 AddInterfaceAsDefaultRoute(kClientAddr); | 549 AddInterfaceAsDefaultRoute(kClientAddr); |
| 575 ResetWithStunServerNoNat(kStunAddr); | 550 ResetWithStunServerNoNat(kStunAddr); |
| 576 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); | 551 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); |
| 577 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, but only both STUN and | 552 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, but only both STUN and |
| 578 // TURN candidates. The STUN candidate should have kClientAddr as srflx | 553 // TURN candidates. The STUN candidate should have kClientAddr as srflx |
| 579 // address, and TURN candidate with kClientAddr as the related address. | 554 // address, and TURN candidate with kClientAddr as the related address. |
| 580 CheckDisableAdapterEnumeration(3U, rtc::IPAddress(), kClientAddr.ipaddr(), | 555 CheckDisableAdapterEnumeration(3U, kClientAddr.ipaddr(), |
| 581 kTurnUdpExtAddr.ipaddr(), rtc::IPAddress()); | 556 kTurnUdpExtAddr.ipaddr(), rtc::IPAddress()); |
| 582 } | 557 } |
| 583 | 558 |
| 584 // Test that when adapter enumeration is disabled, for endpoints without | 559 // Test that when adapter enumeration is disabled, for endpoints without |
| 585 // STUN/TURN specified, no candidate is generated. | 560 // STUN/TURN specified, no candidate is generated. |
| 586 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationWithoutNatOrServers) { | 561 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationWithoutNatOrServers) { |
| 587 AddInterfaceAsDefaultRoute(kClientAddr); | 562 AddInterfaceAsDefaultRoute(kClientAddr); |
| 588 ResetWithNoServersOrNat(); | 563 ResetWithNoServersOrNat(); |
| 589 // Expect to see 2 ports: STUN and TCP ports, but no candidate. | 564 // Expect to see 2 ports: STUN and TCP ports, but no candidate. |
| 590 CheckDisableAdapterEnumeration(2U, rtc::IPAddress(), rtc::IPAddress(), | 565 CheckDisableAdapterEnumeration(2U, rtc::IPAddress(), rtc::IPAddress(), |
| 591 rtc::IPAddress(), rtc::IPAddress()); | |
| 592 } | |
| 593 | |
| 594 // Test that when adapter enumeration is disabled, with | |
| 595 // PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE specified, for endpoints not behind | |
| 596 // a NAT, there are a localhost candidate in addition to a STUN candidate. | |
| 597 TEST_F(PortAllocatorTest, | |
| 598 TestDisableAdapterEnumerationWithoutNatLocalhostCandidateRequested) { | |
| 599 AddInterfaceAsDefaultRoute(kClientAddr); | |
| 600 ResetWithStunServerNoNat(kStunAddr); | |
| 601 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); | |
| 602 session_->set_flags(cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE); | |
| 603 // Expect to see 2 ports: STUN and TCP ports, localhost candidate and STUN | |
| 604 // candidate. | |
| 605 CheckDisableAdapterEnumeration(2U, rtc::GetLoopbackIP(AF_INET), | |
| 606 kClientAddr.ipaddr(), rtc::IPAddress(), | |
| 607 rtc::IPAddress()); | 566 rtc::IPAddress()); |
| 608 } | 567 } |
| 609 | 568 |
| 610 // Disable for asan, see | 569 // Disable for asan, see |
| 611 // https://code.google.com/p/webrtc/issues/detail?id=4743 for details. | 570 // https://code.google.com/p/webrtc/issues/detail?id=4743 for details. |
| 612 #if !defined(ADDRESS_SANITIZER) | 571 #if !defined(ADDRESS_SANITIZER) |
| 613 | 572 |
| 614 // Test that we can get OnCandidatesAllocationDone callback when all the ports | 573 // Test that we can get OnCandidatesAllocationDone callback when all the ports |
| 615 // are disabled. | 574 // are disabled. |
| 616 TEST_F(PortAllocatorTest, TestDisableAllPorts) { | 575 TEST_F(PortAllocatorTest, TestDisableAllPorts) { |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 AllocationSequenceForTest alloc_sequence( | 1275 AllocationSequenceForTest alloc_sequence( |
| 1317 static_cast<cricket::BasicPortAllocatorSession*>(session_.get()), | 1276 static_cast<cricket::BasicPortAllocatorSession*>(session_.get()), |
| 1318 &network1, &config, flag); | 1277 &network1, &config, flag); |
| 1319 // This simply tests it will not crash if udp_socket_ in the | 1278 // This simply tests it will not crash if udp_socket_ in the |
| 1320 // AllocationSequence is null, which is chosen in the constructor. | 1279 // AllocationSequence is null, which is chosen in the constructor. |
| 1321 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); | 1280 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); |
| 1322 relay_server.ports.push_back( | 1281 relay_server.ports.push_back( |
| 1323 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP, false)); | 1282 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP, false)); |
| 1324 alloc_sequence.CreateTurnPort(relay_server); | 1283 alloc_sequence.CreateTurnPort(relay_server); |
| 1325 } | 1284 } |
| OLD | NEW |