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

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

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address more comments Created 5 years, 5 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/transport.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/transport_unittest.cc
diff --git a/webrtc/p2p/base/transport_unittest.cc b/webrtc/p2p/base/transport_unittest.cc
index ba11678ece35e0d4704808cf640823c2434b65ce..7b8df64eabb57883e78e283381f0bd8867f30b73 100644
--- a/webrtc/p2p/base/transport_unittest.cc
+++ b/webrtc/p2p/base/transport_unittest.cc
@@ -321,3 +321,24 @@ TEST_F(TransportTest, TestGetStats) {
ASSERT_EQ(1U, stats.channel_stats.size());
EXPECT_EQ(1, stats.channel_stats[0].component);
}
+
+TEST_F(TransportTest, TestReceivingStateChange) {
+ ASSERT_TRUE(SetupChannel());
+ channel_->SetConnectionCount(1);
+ transport_->ConnectChannels();
+ EXPECT_FALSE(transport_->any_channel_receiving());
+
+ channel_->SetReceiving(true);
+ EXPECT_TRUE_WAIT(transport_->any_channel_receiving(), 100);
+ FakeTransportChannel* channel2 = CreateChannel(2);
+ channel2->SetReceiving(true);
+ EXPECT_TRUE_WAIT(transport_->any_channel_receiving(), 100);
+
+ channel2->SetReceiving(false);
+ EXPECT_TRUE_WAIT(transport_->any_channel_receiving(), 100);
+
+ // After both channels become not receiving, the transport receiving state
+ // becomes TRANSPORT_STATE_NONE.
+ channel_->SetReceiving(false);
+ EXPECT_TRUE_WAIT(!transport_->any_channel_receiving(), 100);
+}
« no previous file with comments | « webrtc/p2p/base/transport.cc ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698