Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Side by Side Diff: webrtc/p2p/client/portallocator_unittest.cc

Issue 1456663002: Test case for CL 1437933002 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: remove space. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 610
611 // Test that even with multiple interfaces, the result should still be a single 611 // Test that even with multiple interfaces, the result should still be a single
612 // default private, one STUN and one TURN candidate since we bind to any address 612 // default private, one STUN and one TURN candidate since we bind to any address
613 // (i.e. all 0s). 613 // (i.e. all 0s).
614 TEST_F(PortAllocatorTest, 614 TEST_F(PortAllocatorTest,
615 TestDisableAdapterEnumerationBehindNatMultipleInterfaces) { 615 TestDisableAdapterEnumerationBehindNatMultipleInterfaces) {
616 AddInterface(kPrivateAddr); 616 AddInterface(kPrivateAddr);
617 AddInterface(kPrivateAddr2); 617 AddInterface(kPrivateAddr2);
618 ResetWithStunServerAndNat(kStunAddr); 618 ResetWithStunServerAndNat(kStunAddr);
619 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); 619 AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress());
620 // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, and a default private, 620
621 // STUN and TURN/UDP candidates. 621 // Enable IPv6 here. Since the network_manager doesn't have IPv6 default
622 CheckDisableAdapterEnumeration(3U, kPrivateAddr.ipaddr(), 622 // address set and we have no IPv6 STUN server, there should be no IPv6
623 // candidates.
624 EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP));
625 session_->set_flags(cricket::PORTALLOCATOR_ENABLE_IPV6);
626
627 // Expect to see 3 ports for IPv4: HOST/STUN, TURN/UDP and TCP ports, 2 ports
628 // for IPv6: HOST, and TCP. Only IPv4 candidates: a default private, STUN and
629 // TURN/UDP candidates.
630 CheckDisableAdapterEnumeration(5U, kPrivateAddr.ipaddr(),
623 kNatUdpAddr.ipaddr(), kTurnUdpExtAddr.ipaddr(), 631 kNatUdpAddr.ipaddr(), kTurnUdpExtAddr.ipaddr(),
624 rtc::IPAddress()); 632 rtc::IPAddress());
625 } 633 }
626 634
627 // Test that we should get a default private, STUN, TURN/UDP and TURN/TCP 635 // Test that we should get a default private, STUN, TURN/UDP and TURN/TCP
628 // candidates when both TURN/UDP and TURN/TCP servers are specified. 636 // candidates when both TURN/UDP and TURN/TCP servers are specified.
629 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationBehindNatWithTcp) { 637 TEST_F(PortAllocatorTest, TestDisableAdapterEnumerationBehindNatWithTcp) {
630 turn_server_.AddInternalSocket(kTurnTcpIntAddr, cricket::PROTO_TCP); 638 turn_server_.AddInternalSocket(kTurnTcpIntAddr, cricket::PROTO_TCP);
631 AddInterface(kPrivateAddr); 639 AddInterface(kPrivateAddr);
632 ResetWithStunServerAndNat(kStunAddr); 640 ResetWithStunServerAndNat(kStunAddr);
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 1350
1343 // After clearing getting ports, adding a new interface will start getting 1351 // After clearing getting ports, adding a new interface will start getting
1344 // ports again. 1352 // ports again.
1345 candidates_.clear(); 1353 candidates_.clear();
1346 ports_.clear(); 1354 ports_.clear();
1347 candidate_allocation_done_ = false; 1355 candidate_allocation_done_ = false;
1348 network_manager_.AddInterface(kClientAddr2); 1356 network_manager_.AddInterface(kClientAddr2);
1349 ASSERT_EQ_WAIT(2U, candidates_.size(), 1000); 1357 ASSERT_EQ_WAIT(2U, candidates_.size(), 1000);
1350 EXPECT_EQ(2U, ports_.size()); 1358 EXPECT_EQ(2U, ports_.size());
1351 } 1359 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698