| 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 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 EXPECT_EQ(500, ch.receiving_timeout()); | 1921 EXPECT_EQ(500, ch.receiving_timeout()); |
| 1922 EXPECT_EQ(50, ch.check_receiving_delay()); | 1922 EXPECT_EQ(50, ch.check_receiving_delay()); |
| 1923 ch.Connect(); | 1923 ch.Connect(); |
| 1924 ch.MaybeStartGathering(); | 1924 ch.MaybeStartGathering(); |
| 1925 ch.AddRemoteCandidate(CreateCandidate("1.1.1.1", 1, 1)); | 1925 ch.AddRemoteCandidate(CreateCandidate("1.1.1.1", 1, 1)); |
| 1926 cricket::Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1); | 1926 cricket::Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1); |
| 1927 ASSERT_TRUE(conn1 != nullptr); | 1927 ASSERT_TRUE(conn1 != nullptr); |
| 1928 | 1928 |
| 1929 conn1->ReceivedPing(); | 1929 conn1->ReceivedPing(); |
| 1930 conn1->OnReadPacket("ABC", 3, rtc::CreatePacketTime(0)); | 1930 conn1->OnReadPacket("ABC", 3, rtc::CreatePacketTime(0)); |
| 1931 EXPECT_TRUE_WAIT(ch.best_connection() != nullptr, 1000) | 1931 EXPECT_TRUE_WAIT(ch.best_connection() != nullptr, 1000); |
| 1932 EXPECT_TRUE_WAIT(ch.receiving(), 1000); | 1932 EXPECT_TRUE_WAIT(ch.receiving(), 1000); |
| 1933 EXPECT_TRUE_WAIT(!ch.receiving(), 1000); | 1933 EXPECT_TRUE_WAIT(!ch.receiving(), 1000); |
| 1934 } | 1934 } |
| 1935 | 1935 |
| 1936 // The controlled side will select a connection as the "best connection" based | 1936 // The controlled side will select a connection as the "best connection" based |
| 1937 // on priority until the controlling side nominates a connection, at which | 1937 // on priority until the controlling side nominates a connection, at which |
| 1938 // point the controlled side will select that connection as the | 1938 // point the controlled side will select that connection as the |
| 1939 // "best connection". | 1939 // "best connection". |
| 1940 TEST_F(P2PTransportChannelPingTest, TestSelectConnectionBeforeNomination) { | 1940 TEST_F(P2PTransportChannelPingTest, TestSelectConnectionBeforeNomination) { |
| 1941 cricket::FakePortAllocator pa(rtc::Thread::Current(), nullptr); | 1941 cricket::FakePortAllocator pa(rtc::Thread::Current(), nullptr); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2279 // It should stop getting ports after a new connection becomes strongly | 2279 // It should stop getting ports after a new connection becomes strongly |
| 2280 // connected. | 2280 // connected. |
| 2281 ch.SetIceCredentials(kIceUfrag[1], kIcePwd[1]); | 2281 ch.SetIceCredentials(kIceUfrag[1], kIcePwd[1]); |
| 2282 ch.MaybeStartGathering(); | 2282 ch.MaybeStartGathering(); |
| 2283 ch.AddRemoteCandidate(CreateCandidate("2.2.2.2", 2, 100)); | 2283 ch.AddRemoteCandidate(CreateCandidate("2.2.2.2", 2, 100)); |
| 2284 cricket::Connection* conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2); | 2284 cricket::Connection* conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2); |
| 2285 ASSERT_TRUE(conn2 != nullptr); | 2285 ASSERT_TRUE(conn2 != nullptr); |
| 2286 conn2->ReceivedPingResponse(); // Becomes writable and receiving | 2286 conn2->ReceivedPingResponse(); // Becomes writable and receiving |
| 2287 EXPECT_TRUE(!ch.allocator_session()->IsGettingPorts()); | 2287 EXPECT_TRUE(!ch.allocator_session()->IsGettingPorts()); |
| 2288 } | 2288 } |
| OLD | NEW |