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

Unified Diff: webrtc/api/statscollector_unittest.cc

Issue 1713043002: Late initialize MediaController, for less resource i.e. ProcessThread, usage by PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Missed one comment Created 4 years, 10 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: webrtc/api/statscollector_unittest.cc
diff --git a/webrtc/api/statscollector_unittest.cc b/webrtc/api/statscollector_unittest.cc
index d4a59a1a6d5f360f32dc0a4606477dc8d4a2ce92..5585b5b5752ad22b9a7633bd7a82ca520c5ea17e 100644
--- a/webrtc/api/statscollector_unittest.cc
+++ b/webrtc/api/statscollector_unittest.cc
@@ -66,9 +66,8 @@ const uint32_t kSsrcOfTrack = 1234;
class MockWebRtcSession : public webrtc::WebRtcSession {
public:
- explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller)
- : WebRtcSession(media_controller,
- rtc::Thread::Current(),
+ explicit MockWebRtcSession()
+ : WebRtcSession(rtc::Thread::Current(),
rtc::Thread::Current(),
nullptr) {}
MOCK_METHOD0(voice_channel, cricket::VoiceChannel*());
@@ -486,13 +485,7 @@ class StatsCollectorTest : public testing::Test {
protected:
StatsCollectorTest()
: media_engine_(new cricket::FakeMediaEngine()),
- channel_manager_(
- new cricket::ChannelManager(media_engine_, rtc::Thread::Current())),
- media_controller_(
- webrtc::MediaControllerInterface::Create(cricket::MediaConfig(),
- rtc::Thread::Current(),
- channel_manager_.get())),
- session_(media_controller_.get()) {
+ session_() {
// By default, we ignore session GetStats calls.
EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Return(false));
// Add default returns for mock classes.
@@ -746,9 +739,7 @@ class StatsCollectorTest : public testing::Test {
srtp_crypto_suite);
}
- cricket::FakeMediaEngine* media_engine_;
- rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
- rtc::scoped_ptr<webrtc::MediaControllerInterface> media_controller_;
+ rtc::scoped_ptr<cricket::FakeMediaEngine> media_engine_;
MockWebRtcSession session_;
MockPeerConnection pc_;
FakeDataChannelProvider data_channel_provider_;
@@ -1485,8 +1476,9 @@ TEST_F(StatsCollectorTest, GetStatsFromLocalAudioTrack) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The transport_name known by the voice channel.
const std::string kVcName("vcname");
- cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_,
- media_channel, nullptr, kVcName, false);
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
+ media_engine_.get(), media_channel,
+ nullptr, kVcName, false);
AddOutgoingAudioTrackStats();
stats.AddStream(stream_);
stats.AddLocalAudioTrack(audio_track_, kSsrcOfTrack);
@@ -1520,8 +1512,9 @@ TEST_F(StatsCollectorTest, GetStatsFromRemoteStream) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The transport_name known by the voice channel.
const std::string kVcName("vcname");
- cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_,
- media_channel, nullptr, kVcName, false);
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
+ media_engine_.get(), media_channel,
+ nullptr, kVcName, false);
AddIncomingAudioTrackStats();
stats.AddStream(stream_);
@@ -1549,8 +1542,9 @@ TEST_F(StatsCollectorTest, GetStatsAfterRemoveAudioStream) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The transport_name known by the voice channel.
const std::string kVcName("vcname");
- cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_,
- media_channel, nullptr, kVcName, false);
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
+ media_engine_.get(), media_channel,
+ nullptr, kVcName, false);
AddOutgoingAudioTrackStats();
stats.AddStream(stream_);
stats.AddLocalAudioTrack(audio_track_.get(), kSsrcOfTrack);
@@ -1610,8 +1604,9 @@ TEST_F(StatsCollectorTest, LocalAndRemoteTracksWithSameSsrc) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The transport_name known by the voice channel.
const std::string kVcName("vcname");
- cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_,
- media_channel, nullptr, kVcName, false);
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
+ media_engine_.get(), media_channel,
+ nullptr, kVcName, false);
// Create a local stream with a local audio track and adds it to the stats.
AddOutgoingAudioTrackStats();
@@ -1697,8 +1692,9 @@ TEST_F(StatsCollectorTest, TwoLocalTracksWithSameSsrc) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The transport_name known by the voice channel.
const std::string kVcName("vcname");
- cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_,
- media_channel, nullptr, kVcName, false);
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
+ media_engine_.get(), media_channel,
+ nullptr, kVcName, false);
// Create a local stream with a local audio track and adds it to the stats.
AddOutgoingAudioTrackStats();

Powered by Google App Engine
This is Rietveld 408576698