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

Unified Diff: webrtc/api/statscollector_unittest.cc

Issue 1903393004: Added network thread to rtc::BaseChannel (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 4 years, 8 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 760db0f23112ff824c0789bcfc13a3b968120e8a..f0ddfdd6e529ea02cf62914d77153e0c24d59c62 100644
--- a/webrtc/api/statscollector_unittest.cc
+++ b/webrtc/api/statscollector_unittest.cc
@@ -492,12 +492,15 @@ 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())),
+ : worker_thread_(rtc::Thread::Current()),
+ network_thread_(rtc::Thread::Current()),
+ media_engine_(new cricket::FakeMediaEngine()),
+ channel_manager_(new cricket::ChannelManager(media_engine_,
+ worker_thread_,
+ network_thread_)),
media_controller_(
webrtc::MediaControllerInterface::Create(cricket::MediaConfig(),
- rtc::Thread::Current(),
+ worker_thread_,
channel_manager_.get())),
session_(media_controller_.get()) {
// By default, we ignore session GetStats calls.
@@ -756,6 +759,8 @@ class StatsCollectorTest : public testing::Test {
srtp_crypto_suite);
}
+ rtc::Thread* const worker_thread_;
+ rtc::Thread* const network_thread_;
cricket::FakeMediaEngine* media_engine_;
std::unique_ptr<cricket::ChannelManager> channel_manager_;
std::unique_ptr<webrtc::MediaControllerInterface> media_controller_;
@@ -824,8 +829,9 @@ TEST_F(StatsCollectorTest, BytesCounterHandles64Bits) {
Return(true)));
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
- cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel,
- nullptr, kVideoChannelName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVideoChannelName,
+ false);
StatsReports reports; // returned values.
cricket::VideoSenderInfo video_sender_info;
cricket::VideoMediaInfo stats_read;
@@ -870,8 +876,9 @@ TEST_F(StatsCollectorTest, BandwidthEstimationInfoIsReported) {
Return(true)));
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
- cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel,
- nullptr, kVideoChannelName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVideoChannelName,
+ false);
StatsReports reports; // returned values.
cricket::VideoSenderInfo video_sender_info;
@@ -945,8 +952,8 @@ TEST_F(StatsCollectorTest, TrackObjectExistsWithoutUpdateStats) {
StatsCollectorForTest stats(&pc_);
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
- cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel,
- nullptr, "video", false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, "video", false);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@@ -981,8 +988,9 @@ TEST_F(StatsCollectorTest, TrackAndSsrcObjectExistAfterUpdateSsrcStats) {
Return(true)));
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
- cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel,
- nullptr, kVideoChannelName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVideoChannelName,
+ false);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@@ -1049,8 +1057,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,
- nullptr, kVcName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVcName, false);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@@ -1107,8 +1115,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,
- nullptr, kVcName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVcName, false);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@@ -1133,8 +1141,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,
- nullptr, kVcName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVcName, false);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@@ -1188,8 +1196,9 @@ TEST_F(StatsCollectorTest, ReportsFromRemoteTrack) {
Return(true)));
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
- cricket::VideoChannel video_channel(rtc::Thread::Current(), media_channel,
- nullptr, kVideoChannelName, false);
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVideoChannelName,
+ false);
AddIncomingVideoTrackStats();
stats.AddStream(stream_);
@@ -1500,8 +1509,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(worker_thread_, network_thread_,
+ media_engine_, media_channel, nullptr,
+ kVcName, false);
AddOutgoingAudioTrackStats();
stats.AddStream(stream_);
stats.AddLocalAudioTrack(audio_track_, kSsrcOfTrack);
@@ -1535,8 +1545,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(worker_thread_, network_thread_,
+ media_engine_, media_channel, nullptr,
+ kVcName, false);
AddIncomingAudioTrackStats();
stats.AddStream(stream_);
@@ -1564,8 +1575,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(worker_thread_, network_thread_,
+ media_engine_, media_channel, nullptr,
+ kVcName, false);
AddOutgoingAudioTrackStats();
stats.AddStream(stream_);
stats.AddLocalAudioTrack(audio_track_.get(), kSsrcOfTrack);
@@ -1625,8 +1637,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(worker_thread_, network_thread_,
+ media_engine_, media_channel, nullptr,
+ kVcName, false);
// Create a local stream with a local audio track and adds it to the stats.
AddOutgoingAudioTrackStats();
@@ -1712,8 +1725,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(worker_thread_, network_thread_,
+ media_engine_, media_channel, nullptr,
+ kVcName, false);
// Create a local stream with a local audio track and adds it to the stats.
AddOutgoingAudioTrackStats();
« no previous file with comments | « webrtc/api/peerconnectionfactory.cc ('k') | webrtc/pc/channel.h » ('j') | webrtc/pc/channel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698