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

Unified Diff: webrtc/p2p/base/port_unittest.cc

Issue 1345913004: Replace readable with receiving where receiving means receiving anything (stun ping, response or da… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/p2p/base/transport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port_unittest.cc
diff --git a/webrtc/p2p/base/port_unittest.cc b/webrtc/p2p/base/port_unittest.cc
index 453b77c9029a3a3faaa8c82579f0efb12d014734..c4fa5f8331c877b2dc52e82ee318870b26b46708 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -821,7 +821,7 @@ void PortTest::TestConnectivity(const char* name1, Port* port1,
if (same_addr1 && same_addr2) {
// The new ping got back to the source.
- EXPECT_EQ(Connection::STATE_READABLE, ch1.conn()->read_state());
+ EXPECT_TRUE(ch1.conn()->receiving());
EXPECT_EQ(Connection::STATE_WRITABLE, ch2.conn()->write_state());
// First connection may not be writable if the first ping did not get
@@ -841,7 +841,7 @@ void PortTest::TestConnectivity(const char* name1, Port* port1,
// able to get a ping from it. This gives us the real source address.
ch1.Ping();
EXPECT_TRUE_WAIT(!ch2.remote_address().IsNil(), kTimeout);
- EXPECT_EQ(Connection::STATE_READ_INIT, ch2.conn()->read_state());
+ EXPECT_FALSE(ch2.conn()->receiving());
EXPECT_TRUE(ch1.remote_address().IsNil());
// Pick up the actual address and establish the connection.
@@ -854,7 +854,7 @@ void PortTest::TestConnectivity(const char* name1, Port* port1,
// The new ping came in, but from an unexpected address. This will happen
// when the destination NAT is symmetric.
EXPECT_FALSE(ch1.remote_address().IsNil());
- EXPECT_EQ(Connection::STATE_READ_INIT, ch1.conn()->read_state());
+ EXPECT_FALSE(ch1.conn()->receiving());
// Update our address and complete the connection.
ch1.AcceptConnection(GetCandidate(port2));
@@ -876,14 +876,14 @@ void PortTest::TestConnectivity(const char* name1, Port* port1,
ASSERT_TRUE(ch1.conn() != NULL);
ASSERT_TRUE(ch2.conn() != NULL);
if (possible) {
- EXPECT_EQ(Connection::STATE_READABLE, ch1.conn()->read_state());
+ EXPECT_TRUE(ch1.conn()->receiving());
EXPECT_EQ(Connection::STATE_WRITABLE, ch1.conn()->write_state());
- EXPECT_EQ(Connection::STATE_READABLE, ch2.conn()->read_state());
+ EXPECT_TRUE(ch2.conn()->receiving());
EXPECT_EQ(Connection::STATE_WRITABLE, ch2.conn()->write_state());
} else {
- EXPECT_NE(Connection::STATE_READABLE, ch1.conn()->read_state());
+ EXPECT_FALSE(ch1.conn()->receiving());
EXPECT_NE(Connection::STATE_WRITABLE, ch1.conn()->write_state());
- EXPECT_NE(Connection::STATE_READABLE, ch2.conn()->read_state());
+ EXPECT_FALSE(ch2.conn()->receiving());
EXPECT_NE(Connection::STATE_WRITABLE, ch2.conn()->write_state());
}
@@ -1273,7 +1273,7 @@ TEST_F(PortTest, TestLoopbackCal) {
// response.
lport->Reset();
lport->AddCandidateAddress(kLocalAddr2);
- // Creating a different connection as |conn| is in STATE_READABLE.
+ // Creating a different connection as |conn| is receiving.
Connection* conn1 = lport->CreateConnection(lport->Candidates()[1],
Port::ORIGIN_MESSAGE);
conn1->Ping(0);
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/p2p/base/transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698