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

Unified Diff: webrtc/audio/audio_receive_stream_unittest.cc

Issue 1991233004: Moved creation of AudioDecoderFactory to inside PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-3
Patch Set: Parental Advisory: Explicit Content Created 4 years, 6 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/audio/audio_receive_stream.cc ('k') | webrtc/audio_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_receive_stream_unittest.cc
diff --git a/webrtc/audio/audio_receive_stream_unittest.cc b/webrtc/audio/audio_receive_stream_unittest.cc
index fd913dbf87ecb33965f0767fc5f8238e3fb1eb37..7380649648a6e5740fb2c8e3d1151200e7441934 100644
--- a/webrtc/audio/audio_receive_stream_unittest.cc
+++ b/webrtc/audio/audio_receive_stream_unittest.cc
@@ -15,6 +15,7 @@
#include "webrtc/audio/audio_receive_stream.h"
#include "webrtc/audio/conversion.h"
+#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h"
#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h"
#include "webrtc/modules/pacing/packet_router.h"
@@ -30,6 +31,7 @@ namespace {
using testing::_;
using testing::Return;
+using testing::ReturnRef;
AudioDecodingCallStats MakeAudioDecodeStatsForTest() {
AudioDecodingCallStats audio_decode_stats;
@@ -64,6 +66,7 @@ const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest();
struct ConfigHelper {
ConfigHelper()
: simulated_clock_(123456),
+ decoder_factory_(new rtc::RefCountedObject<MockAudioDecoderFactory>),
congestion_controller_(&simulated_clock_,
&bitrate_observer_,
&remote_bitrate_observer_) {
@@ -102,6 +105,8 @@ struct ConfigHelper {
.Times(1);
EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport())
.Times(1);
+ EXPECT_CALL(*channel_proxy_, GetAudioDecoderFactory())
+ .WillOnce(ReturnRef(decoder_factory_));
return channel_proxy_;
}));
stream_config_.voe_channel_id = kChannelId;
@@ -113,6 +118,7 @@ struct ConfigHelper {
RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
stream_config_.rtp.extensions.push_back(RtpExtension(
RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
+ stream_config_.decoder_factory = decoder_factory_;
}
MockCongestionController* congestion_controller() {
@@ -159,6 +165,7 @@ struct ConfigHelper {
PacketRouter packet_router_;
testing::NiceMock<MockCongestionObserver> bitrate_observer_;
testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_;
+ rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
MockCongestionController congestion_controller_;
MockRemoteBitrateEstimator remote_bitrate_estimator_;
testing::StrictMock<MockVoiceEngine> voice_engine_;
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/audio_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698