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

Unified Diff: talk/session/media/channelmanager_unittest.cc

Issue 1246913005: TransportController refactoring (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Set media engine on voice channel Created 5 years, 4 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
Index: talk/session/media/channelmanager_unittest.cc
diff --git a/talk/session/media/channelmanager_unittest.cc b/talk/session/media/channelmanager_unittest.cc
index 1ffdaf2836955e3938cc5da22fa560c6dbeaeeea..a44062f4ab8751f98eb29c97dede9b59b8ba220d 100644
--- a/talk/session/media/channelmanager_unittest.cc
+++ b/talk/session/media/channelmanager_unittest.cc
@@ -30,11 +30,11 @@
#include "talk/media/base/fakemediaprocessor.h"
#include "talk/media/base/testutils.h"
#include "talk/media/devices/fakedevicemanager.h"
-#include "webrtc/p2p/base/fakesession.h"
#include "talk/session/media/channelmanager.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/thread.h"
+#include "webrtc/p2p/base/faketransportcontroller.h"
namespace cricket {
@@ -63,7 +63,7 @@ class ChannelManagerTest : public testing::Test {
fcm_ = new cricket::FakeCaptureManager();
cm_ = new cricket::ChannelManager(
fme_, fdme_, fdm_, fcm_, rtc::Thread::Current());
- session_ = new cricket::FakeSession(true);
+ transport_controller_ = new cricket::FakeTransportController(true);
std::vector<std::string> in_device_list, out_device_list, vid_device_list;
in_device_list.push_back("audio-in1");
@@ -78,7 +78,7 @@ class ChannelManagerTest : public testing::Test {
}
virtual void TearDown() {
- delete session_;
+ delete transport_controller_;
delete cm_;
cm_ = NULL;
fdm_ = NULL;
@@ -93,7 +93,7 @@ class ChannelManagerTest : public testing::Test {
cricket::FakeDeviceManager* fdm_;
cricket::FakeCaptureManager* fcm_;
cricket::ChannelManager* cm_;
- cricket::FakeSession* session_;
+ cricket::FakeTransportController* transport_controller_;
};
// Test that we startup/shutdown properly.
@@ -125,14 +125,14 @@ TEST_F(ChannelManagerTest, StartupShutdownOnThread) {
TEST_F(ChannelManagerTest, CreateDestroyChannels) {
EXPECT_TRUE(cm_->Init());
cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel(
- session_, cricket::CN_AUDIO, false, AudioOptions());
+ transport_controller_, cricket::CN_AUDIO, false, AudioOptions());
EXPECT_TRUE(voice_channel != nullptr);
- cricket::VideoChannel* video_channel = cm_->CreateVideoChannel(
- session_, cricket::CN_VIDEO, false, VideoOptions(), voice_channel);
+ cricket::VideoChannel* video_channel =
+ cm_->CreateVideoChannel(transport_controller_, cricket::CN_VIDEO, false,
+ VideoOptions(), voice_channel);
EXPECT_TRUE(video_channel != nullptr);
- cricket::DataChannel* data_channel =
- cm_->CreateDataChannel(session_, cricket::CN_DATA,
- false, cricket::DCT_RTP);
+ cricket::DataChannel* data_channel = cm_->CreateDataChannel(
+ transport_controller_, cricket::CN_DATA, false, cricket::DCT_RTP);
EXPECT_TRUE(data_channel != nullptr);
cm_->DestroyVideoChannel(video_channel);
cm_->DestroyVoiceChannel(voice_channel, nullptr);
@@ -145,17 +145,17 @@ TEST_F(ChannelManagerTest, CreateDestroyChannelsOnThread) {
worker_.Start();
EXPECT_TRUE(cm_->set_worker_thread(&worker_));
EXPECT_TRUE(cm_->Init());
- delete session_;
- session_ = new cricket::FakeSession(&worker_, true);
+ delete transport_controller_;
+ transport_controller_ = new cricket::FakeTransportController(&worker_, true);
cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel(
- session_, cricket::CN_AUDIO, false, AudioOptions());
+ transport_controller_, cricket::CN_AUDIO, false, AudioOptions());
EXPECT_TRUE(voice_channel != nullptr);
- cricket::VideoChannel* video_channel = cm_->CreateVideoChannel(
- session_, cricket::CN_VIDEO, false, VideoOptions(), voice_channel);
+ cricket::VideoChannel* video_channel =
+ cm_->CreateVideoChannel(transport_controller_, cricket::CN_VIDEO, false,
+ VideoOptions(), voice_channel);
EXPECT_TRUE(video_channel != nullptr);
- cricket::DataChannel* data_channel =
- cm_->CreateDataChannel(session_, cricket::CN_DATA,
- false, cricket::DCT_RTP);
+ cricket::DataChannel* data_channel = cm_->CreateDataChannel(
+ transport_controller_, cricket::CN_DATA, false, cricket::DCT_RTP);
EXPECT_TRUE(data_channel != nullptr);
cm_->DestroyVideoChannel(video_channel);
cm_->DestroyVoiceChannel(voice_channel, nullptr);
@@ -167,21 +167,21 @@ TEST_F(ChannelManagerTest, CreateDestroyChannelsOnThread) {
// to create a cricket::TransportChannel
TEST_F(ChannelManagerTest, NoTransportChannelTest) {
EXPECT_TRUE(cm_->Init());
- session_->set_fail_channel_creation(true);
+ transport_controller_->set_fail_channel_creation(true);
// The test is useless unless the session does not fail creating
// cricket::TransportChannel.
- ASSERT_TRUE(session_->CreateChannel(
+ ASSERT_TRUE(transport_controller_->CreateTransportChannel_w(
"audio", cricket::ICE_CANDIDATE_COMPONENT_RTP) == nullptr);
cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel(
- session_, cricket::CN_AUDIO, false, AudioOptions());
+ transport_controller_, cricket::CN_AUDIO, false, AudioOptions());
EXPECT_TRUE(voice_channel == nullptr);
- cricket::VideoChannel* video_channel = cm_->CreateVideoChannel(
- session_, cricket::CN_VIDEO, false, VideoOptions(), voice_channel);
+ cricket::VideoChannel* video_channel =
+ cm_->CreateVideoChannel(transport_controller_, cricket::CN_VIDEO, false,
+ VideoOptions(), voice_channel);
EXPECT_TRUE(video_channel == nullptr);
- cricket::DataChannel* data_channel =
- cm_->CreateDataChannel(session_, cricket::CN_DATA,
- false, cricket::DCT_RTP);
+ cricket::DataChannel* data_channel = cm_->CreateDataChannel(
+ transport_controller_, cricket::CN_DATA, false, cricket::DCT_RTP);
EXPECT_TRUE(data_channel == nullptr);
cm_->Terminate();
}

Powered by Google App Engine
This is Rietveld 408576698