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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 ASSERT_TRUE(conn1 != nullptr); | 1854 ASSERT_TRUE(conn1 != nullptr); |
1855 EXPECT_EQ(conn1->remote_candidate().priority(), remote_priority); | 1855 EXPECT_EQ(conn1->remote_candidate().priority(), remote_priority); |
1856 | 1856 |
1857 // conn3, a real prflx connection, should have prflx priority. | 1857 // conn3, a real prflx connection, should have prflx priority. |
1858 port->SignalUnknownAddress(port, rtc::SocketAddress("3.3.3.3", 1), | 1858 port->SignalUnknownAddress(port, rtc::SocketAddress("3.3.3.3", 1), |
1859 cricket::PROTO_UDP, &request, kIceUfrag[1], false); | 1859 cricket::PROTO_UDP, &request, kIceUfrag[1], false); |
1860 cricket::Connection* conn3 = WaitForConnectionTo(&ch, "3.3.3.3", 1); | 1860 cricket::Connection* conn3 = WaitForConnectionTo(&ch, "3.3.3.3", 1); |
1861 ASSERT_TRUE(conn3 != nullptr); | 1861 ASSERT_TRUE(conn3 != nullptr); |
1862 EXPECT_EQ(conn3->remote_candidate().priority(), prflx_priority); | 1862 EXPECT_EQ(conn3->remote_candidate().priority(), prflx_priority); |
1863 } | 1863 } |
| 1864 |
| 1865 TEST_F(P2PTransportChannelPingTest, TestReceivingStateChange) { |
| 1866 cricket::FakePortAllocator pa(rtc::Thread::Current(), nullptr); |
| 1867 cricket::P2PTransportChannel ch("receiving state change", 1, nullptr, &pa); |
| 1868 PrepareChannel(&ch); |
| 1869 // Default receiving timeout and checking receiving delay should not be too |
| 1870 // small. |
| 1871 EXPECT_LE(1000, ch.receiving_timeout()); |
| 1872 EXPECT_LE(200, ch.check_receiving_delay()); |
| 1873 ch.set_receiving_timeout(500); |
| 1874 EXPECT_EQ(500, ch.receiving_timeout()); |
| 1875 EXPECT_EQ(50, ch.check_receiving_delay()); |
| 1876 ch.Connect(); |
| 1877 ch.OnCandidate(CreateCandidate("1.1.1.1", 1, 1)); |
| 1878 cricket::Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1); |
| 1879 ASSERT_TRUE(conn1 != nullptr); |
| 1880 |
| 1881 conn1->ReceivedPing(); |
| 1882 conn1->OnReadPacket("ABC", 3, rtc::CreatePacketTime(0)); |
| 1883 EXPECT_TRUE_WAIT(ch.best_connection() != nullptr, 1000) |
| 1884 EXPECT_TRUE_WAIT(ch.receiving(), 1000); |
| 1885 EXPECT_TRUE_WAIT(!ch.receiving(), 1000); |
| 1886 } |
OLD | NEW |