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

Unified Diff: webrtc/call/call_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: Rebased onto master 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
Index: webrtc/call/call_unittest.cc
diff --git a/webrtc/call/call_unittest.cc b/webrtc/call/call_unittest.cc
index 0da91a9bf739ee0fbe0174286d9b84e278b1c411..de3da6bfb591e1a42efe58cfd773ee9567e1d942 100644
--- a/webrtc/call/call_unittest.cc
+++ b/webrtc/call/call_unittest.cc
@@ -15,12 +15,15 @@
#include "webrtc/audio_state.h"
#include "webrtc/call.h"
+#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h"
#include "webrtc/test/mock_voice_engine.h"
namespace {
struct CallHelper {
- CallHelper() {
+ CallHelper(
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory = nullptr)
+ : voice_engine_(decoder_factory) {
kwiberg-webrtc 2016/06/13 13:06:00 Since this constructor accepts one argument, it sh
ossu 2016/06/13 13:28:39 It's only used in this test, but you're technicall
webrtc::AudioState::Config audio_state_config;
audio_state_config.voice_engine = &voice_engine_;
webrtc::Call::Config config;
@@ -53,10 +56,13 @@ TEST(CallTest, CreateDestroy_AudioSendStream) {
}
TEST(CallTest, CreateDestroy_AudioReceiveStream) {
- CallHelper call;
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory(
+ new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>);
+ CallHelper call(decoder_factory);
AudioReceiveStream::Config config;
config.rtp.remote_ssrc = 42;
config.voe_channel_id = 123;
+ config.decoder_factory = decoder_factory;
AudioReceiveStream* stream = call->CreateAudioReceiveStream(config);
EXPECT_NE(stream, nullptr);
call->DestroyAudioReceiveStream(stream);
@@ -86,9 +92,12 @@ TEST(CallTest, CreateDestroy_AudioSendStreams) {
}
TEST(CallTest, CreateDestroy_AudioReceiveStreams) {
- CallHelper call;
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory(
+ new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>);
+ CallHelper call(decoder_factory);
AudioReceiveStream::Config config;
config.voe_channel_id = 123;
+ config.decoder_factory = decoder_factory;
std::list<AudioReceiveStream*> streams;
for (int i = 0; i < 2; ++i) {
for (uint32_t ssrc = 0; ssrc < 1234567; ssrc += 34567) {

Powered by Google App Engine
This is Rietveld 408576698