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}
diff --git a/webrtc/p2p/client/portallocator_unittest.cc b/webrtc/p2p/client/portallocator_unittest.cc
index b8fbf18..baa4807 100644
--- a/webrtc/p2p/client/portallocator_unittest.cc
+++ b/webrtc/p2p/client/portallocator_unittest.cc
@@ -617,9 +617,17 @@
   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());
 }