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

Unified Diff: webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc

Issue 2951873002: Expose ILBC codec in webrtc/api/audio_codecs/ (Closed)
Patch Set: fuzzer test updated Created 3 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/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
diff --git a/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc b/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
index c05fcd6e2f6078ce6334b86a482d3e78dfc7e1fc..283a5f5e67bac1bfcf3e72f83d61ce34615e415a 100644
--- a/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
+++ b/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
@@ -10,6 +10,7 @@
#include "webrtc/api/audio_codecs/audio_decoder_factory_template.h"
#include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h"
+#include "webrtc/api/audio_codecs/ilbc/audio_decoder_ilbc.h"
#include "webrtc/base/ptr_util.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
@@ -131,4 +132,17 @@ TEST(AudioDecoderFactoryTemplateTest, G722) {
ASSERT_EQ(nullptr, dec3);
}
+TEST(AudioDecoderFactoryTemplateTest, Ilbc) {
+ auto factory = CreateAudioDecoderFactory<AudioDecoderIlbc>();
+ EXPECT_THAT(factory->GetSupportedDecoders(),
+ testing::ElementsAre(
+ AudioCodecSpec{{"ILBC", 8000, 1}, {8000, 1, 13300}}));
+ EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1}));
+ EXPECT_TRUE(factory->IsSupportedDecoder({"ilbc", 8000, 1}));
+ EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 8000, 1}));
+ auto dec = factory->MakeAudioDecoder({"ilbc", 8000, 1});
+ ASSERT_NE(nullptr, dec);
+ EXPECT_EQ(8000, dec->SampleRateHz());
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/api/audio_codecs/test/BUILD.gn ('k') | webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698