Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel_unittest.cc

Issue 1231913003: Add methods to set the ICE connection receiving_timeout values. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.cc ('k') | webrtc/p2p/base/rawtransportchannel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.cc ('k') | webrtc/p2p/base/rawtransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698