aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguoweis <guoweis@webrtc.org>2015-11-23 14:12:38 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-23 22:12:44 +0000
commit255d6f6fb28f78a5b77f4b4ee0da24524e4371c6 (patch)
tree0de47e40a3ac0d60c5c8b72092385aa5f0653ca8
parent9c80bbe46c8c9f2be38fd77e85d3a9aed2662e7b (diff)
downloadwebrtc-255d6f6fb28f78a5b77f4b4ee0da24524e4371c6.tar.gz
Test case for CL 1437933002.
This is to make sure that we don't have any assert failure when running with adapter enumeration disabled and we have no IPv6 default local address. BUG=webrtc:5061 Review URL: https://codereview.webrtc.org/1456663002 Cr-Commit-Position: refs/heads/master@{#10759}
-rw-r--r--webrtc/p2p/client/portallocator_unittest.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/webrtc/p2p/client/portallocator_unittest.cc b/webrtc/p2p/client/portallocator_unittest.cc
index b8fbf18f7f..baa4807ab2 100644
--- a/webrtc/p2p/client/portallocator_unittest.cc
+++ b/webrtc/p2p/client/portallocator_unittest.cc
@@ -617,9 +617,17 @@ TEST_F(PortAllocatorTest,
AddInterface(kPrivateAddr2);
ResetWithStunServerAndNat(kStunAddr);
AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress());
- // Expect to see 3 ports: STUN, TURN/UDP and TCP ports, and a default private,
- // STUN and TURN/UDP candidates.
- CheckDisableAdapterEnumeration(3U, kPrivateAddr.ipaddr(),
+
+ // Enable IPv6 here. Since the network_manager doesn't have IPv6 default
+ // address set and we have no IPv6 STUN server, there should be no IPv6
+ // candidates.
+ EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP));
+ session_->set_flags(cricket::PORTALLOCATOR_ENABLE_IPV6);
+
+ // Expect to see 3 ports for IPv4: HOST/STUN, TURN/UDP and TCP ports, 2 ports
+ // for IPv6: HOST, and TCP. Only IPv4 candidates: a default private, STUN and
+ // TURN/UDP candidates.
+ CheckDisableAdapterEnumeration(5U, kPrivateAddr.ipaddr(),
kNatUdpAddr.ipaddr(), kTurnUdpExtAddr.ipaddr(),
rtc::IPAddress());
}