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

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

Issue 1530003004: Cleanup use of "do { ... } while (0)". (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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/modules/video_capture/test/video_capture_unittest.cc ('k') | no next file » | 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 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « webrtc/modules/video_capture/test/video_capture_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698