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

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: 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/call/call_perf_tests.cc ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call_unittest.cc
diff --git a/webrtc/call/call_unittest.cc b/webrtc/call/call_unittest.cc
index 0da91a9bf739ee0fbe0174286d9b84e278b1c411..fb6cac11bcf529dcb095b1964aea6af759f337b0 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() {
+ explicit CallHelper(
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory = nullptr)
+ : voice_engine_(decoder_factory) {
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) {
« no previous file with comments | « webrtc/call/call_perf_tests.cc ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698