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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 } | 1863 } |
1864 | 1864 |
1865 TEST_F(P2PTransportChannelPingTest, TestReceivingStateChange) { | 1865 TEST_F(P2PTransportChannelPingTest, TestReceivingStateChange) { |
1866 cricket::FakePortAllocator pa(rtc::Thread::Current(), nullptr); | 1866 cricket::FakePortAllocator pa(rtc::Thread::Current(), nullptr); |
1867 cricket::P2PTransportChannel ch("receiving state change", 1, nullptr, &pa); | 1867 cricket::P2PTransportChannel ch("receiving state change", 1, nullptr, &pa); |
1868 PrepareChannel(&ch); | 1868 PrepareChannel(&ch); |
1869 // Default receiving timeout and checking receiving delay should not be too | 1869 // Default receiving timeout and checking receiving delay should not be too |
1870 // small. | 1870 // small. |
1871 EXPECT_LE(1000, ch.receiving_timeout()); | 1871 EXPECT_LE(1000, ch.receiving_timeout()); |
1872 EXPECT_LE(200, ch.check_receiving_delay()); | 1872 EXPECT_LE(200, ch.check_receiving_delay()); |
1873 ch.set_receiving_timeout(500); | 1873 ch.SetReceivingTimeout(500); |
1874 EXPECT_EQ(500, ch.receiving_timeout()); | 1874 EXPECT_EQ(500, ch.receiving_timeout()); |
1875 EXPECT_EQ(50, ch.check_receiving_delay()); | 1875 EXPECT_EQ(50, ch.check_receiving_delay()); |
1876 ch.Connect(); | 1876 ch.Connect(); |
1877 ch.OnCandidate(CreateCandidate("1.1.1.1", 1, 1)); | 1877 ch.OnCandidate(CreateCandidate("1.1.1.1", 1, 1)); |
1878 cricket::Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1); | 1878 cricket::Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1); |
1879 ASSERT_TRUE(conn1 != nullptr); | 1879 ASSERT_TRUE(conn1 != nullptr); |
1880 | 1880 |
1881 conn1->ReceivedPing(); | 1881 conn1->ReceivedPing(); |
1882 conn1->OnReadPacket("ABC", 3, rtc::CreatePacketTime(0)); | 1882 conn1->OnReadPacket("ABC", 3, rtc::CreatePacketTime(0)); |
1883 EXPECT_TRUE_WAIT(ch.best_connection() != nullptr, 1000) | 1883 EXPECT_TRUE_WAIT(ch.best_connection() != nullptr, 1000) |
1884 EXPECT_TRUE_WAIT(ch.receiving(), 1000); | 1884 EXPECT_TRUE_WAIT(ch.receiving(), 1000); |
1885 EXPECT_TRUE_WAIT(!ch.receiving(), 1000); | 1885 EXPECT_TRUE_WAIT(!ch.receiving(), 1000); |
1886 } | 1886 } |
OLD | NEW |