OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 new cricket::BasicPortAllocator(&(GetEndpoint(0)->network_manager_), | 818 new cricket::BasicPortAllocator(&(GetEndpoint(0)->network_manager_), |
819 stun_servers, | 819 stun_servers, |
820 rtc::SocketAddress(), rtc::SocketAddress(), | 820 rtc::SocketAddress(), rtc::SocketAddress(), |
821 rtc::SocketAddress())); | 821 rtc::SocketAddress())); |
822 GetEndpoint(1)->allocator_.reset( | 822 GetEndpoint(1)->allocator_.reset( |
823 new cricket::BasicPortAllocator(&(GetEndpoint(1)->network_manager_), | 823 new cricket::BasicPortAllocator(&(GetEndpoint(1)->network_manager_), |
824 stun_servers, | 824 stun_servers, |
825 rtc::SocketAddress(), rtc::SocketAddress(), | 825 rtc::SocketAddress(), rtc::SocketAddress(), |
826 rtc::SocketAddress())); | 826 rtc::SocketAddress())); |
827 | 827 |
828 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); | 828 cricket::RelayServerConfig turn_server(cricket::RELAY_TURN); |
829 relay_server.credentials = kRelayCredentials; | 829 turn_server.credentials = kRelayCredentials; |
830 relay_server.ports.push_back( | 830 turn_server.ports.push_back( |
831 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP, false)); | 831 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP, false)); |
832 GetEndpoint(0)->allocator_->AddRelay(relay_server); | 832 GetEndpoint(0)->allocator_->AddTurnServer(turn_server); |
833 GetEndpoint(1)->allocator_->AddRelay(relay_server); | 833 GetEndpoint(1)->allocator_->AddTurnServer(turn_server); |
834 | 834 |
835 int delay = kMinimumStepDelay; | 835 int delay = kMinimumStepDelay; |
836 ConfigureEndpoint(0, config1); | 836 ConfigureEndpoint(0, config1); |
837 SetAllocatorFlags(0, allocator_flags1); | 837 SetAllocatorFlags(0, allocator_flags1); |
838 SetAllocationStepDelay(0, delay); | 838 SetAllocationStepDelay(0, delay); |
839 ConfigureEndpoint(1, config2); | 839 ConfigureEndpoint(1, config2); |
840 SetAllocatorFlags(1, allocator_flags2); | 840 SetAllocatorFlags(1, allocator_flags2); |
841 SetAllocationStepDelay(1, delay); | 841 SetAllocationStepDelay(1, delay); |
842 | 842 |
843 set_clear_remote_candidates_ufrag_pwd(true); | 843 set_clear_remote_candidates_ufrag_pwd(true); |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 conn2->ReceivedPingResponse(); | 2152 conn2->ReceivedPingResponse(); |
2153 EXPECT_EQ_WAIT(conn2, ch.best_connection(), 1000); | 2153 EXPECT_EQ_WAIT(conn2, ch.best_connection(), 1000); |
2154 EXPECT_EQ(cricket::TransportChannelState::STATE_CONNECTING, ch.GetState()); | 2154 EXPECT_EQ(cricket::TransportChannelState::STATE_CONNECTING, ch.GetState()); |
2155 | 2155 |
2156 // When |conn1| comes back again, |conn2| will be pruned again. | 2156 // When |conn1| comes back again, |conn2| will be pruned again. |
2157 conn1->ReceivedPingResponse(); | 2157 conn1->ReceivedPingResponse(); |
2158 EXPECT_EQ_WAIT(conn1, ch.best_connection(), 1000); | 2158 EXPECT_EQ_WAIT(conn1, ch.best_connection(), 1000); |
2159 EXPECT_TRUE_WAIT(!conn2->active(), 1000); | 2159 EXPECT_TRUE_WAIT(!conn2->active(), 1000); |
2160 EXPECT_EQ(cricket::TransportChannelState::STATE_COMPLETED, ch.GetState()); | 2160 EXPECT_EQ(cricket::TransportChannelState::STATE_COMPLETED, ch.GetState()); |
2161 } | 2161 } |
OLD | NEW |