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

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

Issue 2099783002: Fixing bug where Connection drops packets when presumed writable. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master. Created 4 years, 6 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/transportchannel.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 a345e82b6133fc6c5eb7dfacecedb801e238a932..743cddacdb86da47a011c5347010e757c42d9ece 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -2424,11 +2424,11 @@ TEST_F(PortTest, TestWritableState) {
ch1.Ping();
WAIT(!ch2.remote_address().IsNil(), kTimeout);
- // Data should be unsendable until the connection is accepted.
+ // Data should be sendable before the connection is accepted.
char data[] = "abcd";
int data_size = arraysize(data);
rtc::PacketOptions options;
- EXPECT_EQ(SOCKET_ERROR, ch1.conn()->Send(data, data_size, options));
+ EXPECT_EQ(data_size, ch1.conn()->Send(data, data_size, options));
// Accept the connection to return the binding response, transition to
// writable, and allow data to be sent.
@@ -2464,8 +2464,9 @@ TEST_F(PortTest, TestWritableState) {
500u);
EXPECT_EQ(Connection::STATE_WRITE_TIMEOUT, ch1.conn()->write_state());
- // Now that the connection has completely timed out, data send should fail.
- EXPECT_EQ(SOCKET_ERROR, ch1.conn()->Send(data, data_size, options));
+ // Even if the connection has timed out, the Connection shouldn't block
+ // the sending of data.
+ EXPECT_EQ(data_size, ch1.conn()->Send(data, data_size, options));
ch1.Stop();
ch2.Stop();
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698