From 255d6f6fb28f78a5b77f4b4ee0da24524e4371c6 Mon Sep 17 00:00:00 2001 From: guoweis Date: Mon, 23 Nov 2015 14:12:38 -0800 Subject: 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} --- webrtc/p2p/client/portallocator_unittest.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'webrtc') 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()); } -- cgit v1.2.3