Index: webrtc/p2p/client/portallocator_unittest.cc |
diff --git a/webrtc/p2p/client/portallocator_unittest.cc b/webrtc/p2p/client/portallocator_unittest.cc |
index 7dc25140cccf91a91194af75af8f8b4c18f33993..129ff6095d48834e20d055f1a3f04edd913e1e55 100644 |
--- a/webrtc/p2p/client/portallocator_unittest.cc |
+++ b/webrtc/p2p/client/portallocator_unittest.cc |
@@ -645,8 +645,7 @@ TEST_F(PortAllocatorTest, TestCandidateFilterWithRelayOnly) { |
TEST_F(PortAllocatorTest, TestCandidateFilterWithHostOnly) { |
AddInterface(kClientAddr); |
- allocator().set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
+ allocator().set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
allocator().set_candidate_filter(cricket::CF_HOST); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
session_->StartGettingPorts(); |
@@ -663,8 +662,7 @@ TEST_F(PortAllocatorTest, TestCandidateFilterWithReflexiveOnly) { |
AddInterface(kPrivateAddr); |
ResetWithNatServer(kStunAddr); |
- allocator().set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
+ allocator().set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
allocator().set_candidate_filter(cricket::CF_REFLEXIVE); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
session_->StartGettingPorts(); |
@@ -684,8 +682,7 @@ TEST_F(PortAllocatorTest, TestCandidateFilterWithReflexiveOnly) { |
// Host is not behind the NAT. |
TEST_F(PortAllocatorTest, TestCandidateFilterWithReflexiveOnlyAndNoNAT) { |
AddInterface(kClientAddr); |
- allocator().set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
+ allocator().set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
allocator().set_candidate_filter(cricket::CF_REFLEXIVE); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
session_->StartGettingPorts(); |
@@ -698,11 +695,8 @@ TEST_F(PortAllocatorTest, TestCandidateFilterWithReflexiveOnlyAndNoNAT) { |
} |
} |
-// Test that when the PORTALLOCATOR_ENABLE_SHARED_UFRAG is enabled we got same |
-// ufrag and pwd for the collected candidates. |
+// Test that we get the same ufrag and pwd for all candidates. |
TEST_F(PortAllocatorTest, TestEnableSharedUfrag) { |
- allocator().set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); |
AddInterface(kClientAddr); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
session_->StartGettingPorts(); |
@@ -722,30 +716,6 @@ TEST_F(PortAllocatorTest, TestEnableSharedUfrag) { |
EXPECT_TRUE(candidate_allocation_done_); |
} |
-// Test that when the PORTALLOCATOR_ENABLE_SHARED_UFRAG isn't enabled we got |
-// different ufrag and pwd for the collected candidates. |
-TEST_F(PortAllocatorTest, TestDisableSharedUfrag) { |
- allocator().set_flags(allocator().flags() & |
- ~cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); |
- AddInterface(kClientAddr); |
- EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
- session_->StartGettingPorts(); |
- ASSERT_EQ_WAIT(7U, candidates_.size(), kDefaultAllocationTimeout); |
- EXPECT_PRED5(CheckCandidate, candidates_[0], |
- cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp", kClientAddr); |
- EXPECT_PRED5(CheckCandidate, candidates_[1], |
- cricket::ICE_CANDIDATE_COMPONENT_RTP, "stun", "udp", kClientAddr); |
- EXPECT_EQ(4U, ports_.size()); |
- // Port should generate random ufrag and pwd. |
- EXPECT_NE(kIceUfrag0, candidates_[0].username()); |
- EXPECT_NE(kIceUfrag0, candidates_[1].username()); |
- EXPECT_NE(candidates_[0].username(), candidates_[1].username()); |
- EXPECT_NE(kIcePwd0, candidates_[0].password()); |
- EXPECT_NE(kIcePwd0, candidates_[1].password()); |
- EXPECT_NE(candidates_[0].password(), candidates_[1].password()); |
- EXPECT_TRUE(candidate_allocation_done_); |
-} |
- |
// Test that when PORTALLOCATOR_ENABLE_SHARED_SOCKET is enabled only one port |
// is allocated for udp and stun. Also verify there is only one candidate |
// (local) if stun candidate is same as local candidate, which will be the case |
@@ -753,7 +723,6 @@ TEST_F(PortAllocatorTest, TestDisableSharedUfrag) { |
TEST_F(PortAllocatorTest, TestSharedSocketWithoutNat) { |
AddInterface(kClientAddr); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
session_->StartGettingPorts(); |
@@ -772,7 +741,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithNat) { |
ResetWithNatServer(kStunAddr); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
session_->StartGettingPorts(); |
@@ -797,7 +765,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithoutNatUsingTurn) { |
allocator_->set_step_delay(cricket::kMinimumStepDelay); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
@@ -835,7 +802,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithServerAddressResolve) { |
allocator_->set_step_delay(cricket::kMinimumStepDelay); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
@@ -855,7 +821,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithNatUsingTurn) { |
AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
@@ -894,7 +859,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithNatUsingTurnAsStun) { |
// webrtc issue 3537. |
allocator_->set_step_delay(0); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
@@ -929,7 +893,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithNatUsingTurnTcpOnly) { |
AddTurnServers(rtc::SocketAddress(), kTurnTcpIntAddr); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
@@ -962,7 +925,6 @@ TEST_F(PortAllocatorTest, TestNonSharedSocketWithNatUsingTurnAsStun) { |
AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); |
@@ -1001,7 +963,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithNatUsingTurnAndStun) { |
AddTurnServers(kTurnUdpIntAddr, rtc::SocketAddress()); |
allocator_->set_flags(allocator().flags() | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
cricket::PORTALLOCATOR_DISABLE_TCP); |
@@ -1031,7 +992,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketNoUdpAllowed) { |
allocator().set_flags(allocator().flags() | |
cricket::PORTALLOCATOR_DISABLE_RELAY | |
cricket::PORTALLOCATOR_DISABLE_TCP | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
fss_->AddRule(false, rtc::FP_UDP, rtc::FD_ANY, kClientAddr); |
AddInterface(kClientAddr); |
@@ -1051,7 +1011,6 @@ TEST_F(PortAllocatorTest, TestEnableIPv6Addresses) { |
allocator().set_flags(allocator().flags() | |
cricket::PORTALLOCATOR_DISABLE_RELAY | |
cricket::PORTALLOCATOR_ENABLE_IPV6 | |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET); |
AddInterface(kClientIPv6Addr); |
AddInterface(kClientAddr); |
@@ -1110,22 +1069,12 @@ TEST(HttpPortAllocatorTest, TestSessionRequestUrl) { |
rtc::FakeNetworkManager network_manager; |
cricket::HttpPortAllocator alloc(&network_manager, "unit test agent"); |
- // Disable PORTALLOCATOR_ENABLE_SHARED_UFRAG. |
- alloc.set_flags(alloc.flags() & ~cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); |
rtc::scoped_ptr<cricket::HttpPortAllocatorSessionBase> session( |
static_cast<cricket::HttpPortAllocatorSession*>( |
alloc.CreateSessionInternal( |
"test content", 0, kIceUfrag0, kIcePwd0))); |
std::string url = session->GetSessionRequestUrl(); |
LOG(LS_INFO) << "url: " << url; |
- EXPECT_EQ(std::string(cricket::HttpPortAllocator::kCreateSessionURL), url); |
- |
- // Enable PORTALLOCATOR_ENABLE_SHARED_UFRAG. |
- alloc.set_flags(alloc.flags() | cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); |
- session.reset(static_cast<cricket::HttpPortAllocatorSession*>( |
- alloc.CreateSessionInternal("test content", 0, kIceUfrag0, kIcePwd0))); |
- url = session->GetSessionRequestUrl(); |
- LOG(LS_INFO) << "url: " << url; |
std::vector<std::string> parts; |
rtc::split(url, '?', &parts); |
ASSERT_EQ(2U, parts.size()); |