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

Unified Diff: webrtc/p2p/client/portallocator_unittest.cc

Issue 1353713002: Remove GICE (again). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Undo .gclient Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/client/fakeportallocator.h ('k') | webrtc/p2p/p2p.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/portallocator_unittest.cc
diff --git a/webrtc/p2p/client/portallocator_unittest.cc b/webrtc/p2p/client/portallocator_unittest.cc
index 26b66e68aa1a742b62965eb0047216c5ab6bab54..9ea22dd189487192cb56152c5117f102939454b0 100644
--- a/webrtc/p2p/client/portallocator_unittest.cc
+++ b/webrtc/p2p/client/portallocator_unittest.cc
@@ -253,7 +253,6 @@ class PortAllocatorTest : public testing::Test, public sigslot::has_slots<> {
}
session_->set_flags(session_->flags() |
cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET);
allocator().set_allow_tcp_listen(false);
session_->StartGettingPorts();
@@ -618,7 +617,6 @@ TEST_F(PortAllocatorTest, TestDisableUdpTurn) {
session_->set_flags(cricket::PORTALLOCATOR_DISABLE_UDP_RELAY |
cricket::PORTALLOCATOR_DISABLE_UDP |
cricket::PORTALLOCATOR_DISABLE_STUN |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET);
session_->StartGettingPorts();
@@ -808,8 +806,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();
@@ -826,8 +823,7 @@ TEST_F(PortAllocatorTest, TestCandidateFilterWithReflexiveOnly) {
AddInterface(kPrivateAddr);
ResetWithStunServerAndNat(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();
@@ -847,8 +843,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();
@@ -861,11 +856,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();
@@ -885,30 +877,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
@@ -916,7 +884,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();
@@ -935,7 +902,6 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithNat) {
ResetWithStunServerAndNat(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();
@@ -960,7 +926,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);
@@ -998,7 +963,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);
@@ -1018,7 +982,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);
@@ -1057,7 +1020,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);
@@ -1092,7 +1054,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);
@@ -1125,7 +1086,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));
@@ -1164,7 +1124,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);
@@ -1194,7 +1153,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);
@@ -1219,7 +1177,6 @@ TEST_F(PortAllocatorTest, TestNetworkPermissionBlocked) {
allocator().set_flags(allocator().flags() |
cricket::PORTALLOCATOR_DISABLE_RELAY |
cricket::PORTALLOCATOR_DISABLE_TCP |
- cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET);
EXPECT_EQ(0U, allocator_->flags() &
cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION);
@@ -1238,7 +1195,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);
« no previous file with comments | « webrtc/p2p/client/fakeportallocator.h ('k') | webrtc/p2p/p2p.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698