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 2141 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 } |
2162 | |
2163 TEST_F(P2PTransportChannelPingTest, TestStopSessions) { | |
pthatcher1
2015/10/24 00:39:04
Can you leave a comment about what this is testing
honghaiz3
2015/10/26 16:47:46
Done. Not sure what do you mean by "make TestStopS
| |
2164 cricket::FakePortAllocator pa(rtc::Thread::Current(), nullptr); | |
2165 cricket::P2PTransportChannel ch("test channel", 1, nullptr, &pa); | |
2166 PrepareChannel(&ch); | |
2167 ch.SetIceConfig(CreateIceConfig(2000, false)); | |
2168 ch.Connect(); | |
2169 ch.MaybeStartGathering(); | |
2170 ch.AddRemoteCandidate(CreateCandidate("1.1.1.1", 1, 100)); | |
2171 cricket::Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1); | |
2172 ASSERT_TRUE(conn1 != nullptr); | |
2173 conn1->ReceivedPingResponse(); // Becomes writable and receiving | |
2174 EXPECT_TRUE(!ch.allocator_session()->IsGettingPorts()); | |
2175 | |
2176 ch.SetIceCredentials(kIceUfrag[1], kIcePwd[1]); | |
2177 ch.MaybeStartGathering(); | |
2178 ch.AddRemoteCandidate(CreateCandidate("2.2.2.2", 2, 100)); | |
2179 cricket::Connection* conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2); | |
2180 ASSERT_TRUE(conn2 != nullptr); | |
2181 conn2->ReceivedPingResponse(); // Becomes writable and receiving | |
2182 EXPECT_TRUE(!ch.allocator_session()->IsGettingPorts()); | |
2183 } | |
OLD | NEW |