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

Unified Diff: webrtc/pc/channelmanager_unittest.cc

Issue 1903393004: Added network thread to rtc::BaseChannel (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix flakiness of WebRtcSessionTest.TestPacketOptionsAndOnPacketSent Created 4 years, 7 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/pc/channelmanager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channelmanager_unittest.cc
diff --git a/webrtc/pc/channelmanager_unittest.cc b/webrtc/pc/channelmanager_unittest.cc
index 8cb066b25df3eb61db5c6b3cf03745863017e7d1..0cedd8b4bc176d666ade372fcff6c43722115de5 100644
--- a/webrtc/pc/channelmanager_unittest.cc
+++ b/webrtc/pc/channelmanager_unittest.cc
@@ -56,6 +56,7 @@ class ChannelManagerTest : public testing::Test {
fme_ = NULL;
}
+ rtc::Thread network_;
rtc::Thread worker_;
cricket::FakeMediaEngine* fme_;
cricket::FakeDataEngine* fdme_;
@@ -77,14 +78,18 @@ TEST_F(ChannelManagerTest, StartupShutdown) {
// Test that we startup/shutdown properly with a worker thread.
TEST_F(ChannelManagerTest, StartupShutdownOnThread) {
+ network_.Start();
worker_.Start();
EXPECT_FALSE(cm_->initialized());
EXPECT_EQ(rtc::Thread::Current(), cm_->worker_thread());
+ EXPECT_TRUE(cm_->set_network_thread(&network_));
+ EXPECT_EQ(&network_, cm_->network_thread());
EXPECT_TRUE(cm_->set_worker_thread(&worker_));
EXPECT_EQ(&worker_, cm_->worker_thread());
EXPECT_TRUE(cm_->Init());
EXPECT_TRUE(cm_->initialized());
- // Setting the worker thread while initialized should fail.
+ // Setting the network or worker thread while initialized should fail.
+ EXPECT_FALSE(cm_->set_network_thread(rtc::Thread::Current()));
EXPECT_FALSE(cm_->set_worker_thread(rtc::Thread::Current()));
cm_->Terminate();
EXPECT_FALSE(cm_->initialized());
@@ -112,12 +117,14 @@ TEST_F(ChannelManagerTest, CreateDestroyChannels) {
// Test that we can create and destroy a voice and video channel with a worker.
TEST_F(ChannelManagerTest, CreateDestroyChannelsOnThread) {
+ network_.Start();
worker_.Start();
EXPECT_TRUE(cm_->set_worker_thread(&worker_));
+ EXPECT_TRUE(cm_->set_network_thread(&network_));
EXPECT_TRUE(cm_->Init());
delete transport_controller_;
transport_controller_ =
- new cricket::FakeTransportController(&worker_, ICEROLE_CONTROLLING);
+ new cricket::FakeTransportController(&network_, ICEROLE_CONTROLLING);
cricket::VoiceChannel* voice_channel =
cm_->CreateVoiceChannel(&fake_mc_, transport_controller_,
cricket::CN_AUDIO, false, AudioOptions());
« no previous file with comments | « webrtc/pc/channelmanager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698