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

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

Issue 1544003002: Delete a connection after it is pruned or becomes write_timeout (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@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 side-by-side diff with in-line comments
Download patch
« webrtc/p2p/base/port.cc ('K') | « webrtc/p2p/base/port.cc ('k') | no next file » | 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 4bff58adc7e176728800ca2a4fcffcc1c784d99b..2b2e4c6551992bca185d4abe12f4ba12662057b5 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -1255,16 +1255,16 @@ TEST_F(PortTest, TestConnectionDead) {
ASSERT_EQ_WAIT(1, ch1.complete_count(), kTimeout);
ASSERT_EQ_WAIT(1, ch2.complete_count(), kTimeout);
- uint32_t before_created = rtc::Time();
ch1.CreateConnection(GetCandidate(port2));
uint32_t after_created = rtc::Time();
Connection* conn = ch1.conn();
ASSERT(conn != nullptr);
// If the connection has never received anything, it will be dead after
- // MIN_CONNECTION_LIFETIME
- conn->UpdateState(before_created + MIN_CONNECTION_LIFETIME - 1);
- rtc::Thread::Current()->ProcessMessages(100);
+ // MIN_CONNECTION_LIFETIME AND inactive (write_timeout).
pthatcher1 2015/12/30 17:12:28 This is now testing the case that when we are afte
honghaiz3 2015/12/30 19:38:18 Done.
+ conn->UpdateState(after_created + MIN_CONNECTION_LIFETIME + 1);
+ rtc::Thread::Current()->ProcessMessages(0);
EXPECT_TRUE(ch1.conn() != nullptr);
+ conn->Prune();
conn->UpdateState(after_created + MIN_CONNECTION_LIFETIME + 1);
EXPECT_TRUE_WAIT(ch1.conn() == nullptr, kTimeout);
« webrtc/p2p/base/port.cc ('K') | « webrtc/p2p/base/port.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698