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

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

Issue 2597423003: RTCIceCandidatePairStats.[state/priority] added, ConnectionInfo updated. (Closed)
Patch Set: Rebase with master Created 3 years, 11 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/port.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 3999 matching lines...) Expand 10 before | Expand all | Expand 10 after
4010 4010
4011 // Add a low-priority connection |conn2|, which will be pruned, but it will 4011 // Add a low-priority connection |conn2|, which will be pruned, but it will
4012 // not be deleted right away. Once the current selected connection becomes not 4012 // not be deleted right away. Once the current selected connection becomes not
4013 // receiving, |conn2| will start to ping and upon receiving the ping response, 4013 // receiving, |conn2| will start to ping and upon receiving the ping response,
4014 // it will become the selected connection. 4014 // it will become the selected connection.
4015 ch.AddRemoteCandidate(CreateUdpCandidate(LOCAL_PORT_TYPE, "2.2.2.2", 2, 1)); 4015 ch.AddRemoteCandidate(CreateUdpCandidate(LOCAL_PORT_TYPE, "2.2.2.2", 2, 1));
4016 Connection* conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2, &clock); 4016 Connection* conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2, &clock);
4017 ASSERT_TRUE(conn2 != nullptr); 4017 ASSERT_TRUE(conn2 != nullptr);
4018 EXPECT_TRUE_SIMULATED_WAIT(!conn2->active(), kDefaultTimeout, clock); 4018 EXPECT_TRUE_SIMULATED_WAIT(!conn2->active(), kDefaultTimeout, clock);
4019 // |conn2| should not send a ping yet. 4019 // |conn2| should not send a ping yet.
4020 EXPECT_EQ(Connection::STATE_WAITING, conn2->state()); 4020 EXPECT_EQ(IceCandidatePairState::WAITING, conn2->state());
4021 EXPECT_EQ(TransportChannelState::STATE_COMPLETED, ch.GetState()); 4021 EXPECT_EQ(TransportChannelState::STATE_COMPLETED, ch.GetState());
4022 // Wait for |conn1| becoming not receiving. 4022 // Wait for |conn1| becoming not receiving.
4023 EXPECT_TRUE_SIMULATED_WAIT(!conn1->receiving(), kMediumTimeout, clock); 4023 EXPECT_TRUE_SIMULATED_WAIT(!conn1->receiving(), kMediumTimeout, clock);
4024 // Make sure conn2 is not deleted. 4024 // Make sure conn2 is not deleted.
4025 conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2, &clock); 4025 conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2, &clock);
4026 ASSERT_TRUE(conn2 != nullptr); 4026 ASSERT_TRUE(conn2 != nullptr);
4027 EXPECT_EQ_SIMULATED_WAIT(Connection::STATE_INPROGRESS, conn2->state(), 4027 EXPECT_EQ_SIMULATED_WAIT(IceCandidatePairState::IN_PROGRESS, conn2->state(),
4028 kDefaultTimeout, clock); 4028 kDefaultTimeout, clock);
4029 conn2->ReceivedPingResponse(LOW_RTT, "id"); 4029 conn2->ReceivedPingResponse(LOW_RTT, "id");
4030 EXPECT_EQ_SIMULATED_WAIT(conn2, ch.selected_connection(), kDefaultTimeout, 4030 EXPECT_EQ_SIMULATED_WAIT(conn2, ch.selected_connection(), kDefaultTimeout,
4031 clock); 4031 clock);
4032 EXPECT_EQ(TransportChannelState::STATE_CONNECTING, ch.GetState()); 4032 EXPECT_EQ(TransportChannelState::STATE_CONNECTING, ch.GetState());
4033 4033
4034 // When |conn1| comes back again, |conn2| will be pruned again. 4034 // When |conn1| comes back again, |conn2| will be pruned again.
4035 conn1->ReceivedPingResponse(LOW_RTT, "id"); 4035 conn1->ReceivedPingResponse(LOW_RTT, "id");
4036 EXPECT_EQ_SIMULATED_WAIT(conn1, ch.selected_connection(), kDefaultTimeout, 4036 EXPECT_EQ_SIMULATED_WAIT(conn1, ch.selected_connection(), kDefaultTimeout,
4037 clock); 4037 clock);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
4384 4384
4385 // TCP Relay/Relay is the next. 4385 // TCP Relay/Relay is the next.
4386 VerifyNextPingableConnection(RELAY_PORT_TYPE, RELAY_PORT_TYPE, 4386 VerifyNextPingableConnection(RELAY_PORT_TYPE, RELAY_PORT_TYPE,
4387 TCP_PROTOCOL_NAME); 4387 TCP_PROTOCOL_NAME);
4388 4388
4389 // Finally, Local/Relay will be pinged. 4389 // Finally, Local/Relay will be pinged.
4390 VerifyNextPingableConnection(LOCAL_PORT_TYPE, RELAY_PORT_TYPE); 4390 VerifyNextPingableConnection(LOCAL_PORT_TYPE, RELAY_PORT_TYPE);
4391 } 4391 }
4392 4392
4393 } // namespace cricket { 4393 } // namespace cricket {
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.cc ('k') | webrtc/p2p/base/port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698