Index: talk/app/webrtc/statscollector_unittest.cc |
diff --git a/talk/app/webrtc/statscollector_unittest.cc b/talk/app/webrtc/statscollector_unittest.cc |
index 21f9df8e8f32e03cdbcab02d9ac3008b1742a4ba..2903ac55dfbde30757ed91c8ba4e22d7bf22a9e9 100644 |
--- a/talk/app/webrtc/statscollector_unittest.cc |
+++ b/talk/app/webrtc/statscollector_unittest.cc |
@@ -82,10 +82,12 @@ const uint32_t kSsrcOfTrack = 1234; |
class MockWebRtcSession : public webrtc::WebRtcSession { |
public: |
- explicit MockWebRtcSession(cricket::ChannelManager* channel_manager) |
- : WebRtcSession(channel_manager, rtc::Thread::Current(), |
- rtc::Thread::Current(), NULL, NULL) { |
- } |
+ explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller) |
+ : WebRtcSession(media_controller, |
+ rtc::Thread::Current(), |
+ rtc::Thread::Current(), |
+ NULL, |
+ NULL) {} |
MOCK_METHOD0(voice_channel, cricket::VoiceChannel*()); |
MOCK_METHOD0(video_channel, cricket::VideoChannel*()); |
MOCK_CONST_METHOD0(mediastream_signaling, const MediaStreamSignaling*()); |
@@ -487,11 +489,14 @@ class StatsCollectorForTest : public webrtc::StatsCollector { |
class StatsCollectorTest : public testing::Test { |
protected: |
StatsCollectorTest() |
- : media_engine_(new cricket::FakeMediaEngine()), |
- channel_manager_( |
- new cricket::ChannelManager(media_engine_, rtc::Thread::Current())), |
- session_(channel_manager_.get()), |
- signaling_(channel_manager_.get()) { |
+ : media_engine_(new cricket::FakeMediaEngine()), |
+ channel_manager_( |
+ new cricket::ChannelManager(media_engine_, rtc::Thread::Current())), |
+ media_controller_( |
+ webrtc::MediaControllerInterface::Create(rtc::Thread::Current(), |
+ channel_manager_.get())), |
+ session_(media_controller_.get()), |
+ signaling_(channel_manager_.get()) { |
// By default, we ignore session GetStats calls. |
EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Return(false)); |
EXPECT_CALL(session_, mediastream_signaling()).WillRepeatedly( |
@@ -733,6 +738,7 @@ class StatsCollectorTest : public testing::Test { |
cricket::FakeMediaEngine* media_engine_; |
rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
+ rtc::scoped_ptr<webrtc::MediaControllerInterface> media_controller_; |
MockWebRtcSession session_; |
FakeMediaStreamSignaling signaling_; |
FakeDataChannelProvider data_channel_provider_; |
@@ -803,8 +809,8 @@ TEST_F(StatsCollectorTest, BytesCounterHandles64Bits) { |
Return(true))); |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVideoChannelName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVideoChannelName, false); |
StatsReports reports; // returned values. |
cricket::VideoSenderInfo video_sender_info; |
cricket::VideoMediaInfo stats_read; |
@@ -849,8 +855,8 @@ TEST_F(StatsCollectorTest, BandwidthEstimationInfoIsReported) { |
Return(true))); |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVideoChannelName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVideoChannelName, false); |
StatsReports reports; // returned values. |
cricket::VideoSenderInfo video_sender_info; |
@@ -928,8 +934,8 @@ TEST_F(StatsCollectorTest, TrackObjectExistsWithoutUpdateStats) { |
StatsCollectorForTest stats(&session_); |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, "video", false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, "video", false); |
AddOutgoingVideoTrackStats(); |
stats.AddStream(stream_); |
@@ -964,8 +970,8 @@ TEST_F(StatsCollectorTest, TrackAndSsrcObjectExistAfterUpdateSsrcStats) { |
Return(true))); |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVideoChannelName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVideoChannelName, false); |
AddOutgoingVideoTrackStats(); |
stats.AddStream(stream_); |
@@ -1028,8 +1034,8 @@ TEST_F(StatsCollectorTest, TransportObjectLinkedFromSsrcObject) { |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
// The transport_name known by the video channel. |
const std::string kVcName("vcname"); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVcName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVcName, false); |
AddOutgoingVideoTrackStats(); |
stats.AddStream(stream_); |
@@ -1086,8 +1092,8 @@ TEST_F(StatsCollectorTest, RemoteSsrcInfoIsAbsent) { |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
// The transport_name known by the video channel. |
const std::string kVcName("vcname"); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVcName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVcName, false); |
AddOutgoingVideoTrackStats(); |
stats.AddStream(stream_); |
@@ -1115,8 +1121,8 @@ TEST_F(StatsCollectorTest, RemoteSsrcInfoIsPresent) { |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
// The transport_name known by the video channel. |
const std::string kVcName("vcname"); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVcName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVcName, false); |
AddOutgoingVideoTrackStats(); |
stats.AddStream(stream_); |
@@ -1170,8 +1176,8 @@ TEST_F(StatsCollectorTest, ReportsFromRemoteTrack) { |
Return(true))); |
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel(); |
- cricket::VideoChannel video_channel(rtc::Thread::Current(), |
- media_channel, NULL, kVideoChannelName, false); |
+ cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel, |
+ nullptr, kVideoChannelName, false); |
AddIncomingVideoTrackStats(); |
stats.AddStream(stream_); |
@@ -1485,8 +1491,8 @@ 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, NULL, kVcName, false); |
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_, |
+ media_channel, nullptr, kVcName, false); |
AddOutgoingAudioTrackStats(); |
stats.AddStream(stream_); |
stats.AddLocalAudioTrack(audio_track_, kSsrcOfTrack); |
@@ -1520,8 +1526,8 @@ 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, NULL, kVcName, false); |
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_, |
+ media_channel, nullptr, kVcName, false); |
AddIncomingAudioTrackStats(); |
stats.AddStream(stream_); |
@@ -1549,8 +1555,8 @@ 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, NULL, kVcName, false); |
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_, |
+ media_channel, nullptr, kVcName, false); |
AddOutgoingAudioTrackStats(); |
stats.AddStream(stream_); |
stats.AddLocalAudioTrack(audio_track_.get(), kSsrcOfTrack); |
@@ -1610,8 +1616,8 @@ 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, NULL, kVcName, false); |
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_, |
+ media_channel, nullptr, kVcName, false); |
// Create a local stream with a local audio track and adds it to the stats. |
AddOutgoingAudioTrackStats(); |
@@ -1697,8 +1703,8 @@ 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, NULL, kVcName, false); |
+ cricket::VoiceChannel voice_channel(rtc::Thread::Current(), media_engine_, |
+ media_channel, nullptr, kVcName, false); |
// Create a local stream with a local audio track and adds it to the stats. |
AddOutgoingAudioTrackStats(); |