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

Unified Diff: webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc

Issue 1484343003: NetEq: Add codec name and RTP timestamp rate to DecoderInfo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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/modules/audio_coding/neteq/decoder_database_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
index e85d8d32fb8da439a3aa2b1a48041553486181f9..92995aed3919e379dce1501a15ec13533ce2f301 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
@@ -112,11 +112,12 @@ TEST(DecoderDatabase, TypeTests) {
TEST(DecoderDatabase, ExternalDecoder) {
DecoderDatabase db;
const uint8_t kPayloadType = 0;
+ const std::string kCodecName = "Robert\'); DROP TABLE Students;";
kwiberg-webrtc 2015/12/02 13:41:37 Note that it's allowed but not necessary to escape
hlundin-webrtc 2015/12/02 16:19:24 Acknowledged.
MockAudioDecoder decoder;
// Load into database.
EXPECT_EQ(DecoderDatabase::kOK,
- db.InsertExternal(kPayloadType, NetEqDecoder::kDecoderPCMu, 8000,
- &decoder));
+ db.InsertExternal(kPayloadType, NetEqDecoder::kDecoderPCMu,
+ kCodecName, 8000, &decoder));
EXPECT_EQ(1, db.Size());
// Get decoder and make sure we get the external one.
EXPECT_EQ(&decoder, db.GetDecoder(kPayloadType));
@@ -125,6 +126,7 @@ TEST(DecoderDatabase, ExternalDecoder) {
info = db.GetDecoderInfo(kPayloadType);
ASSERT_TRUE(info != NULL);
EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type);
+ EXPECT_EQ(kCodecName, info->name);
EXPECT_EQ(&decoder, info->decoder);
EXPECT_EQ(8000, info->fs_hz);
EXPECT_TRUE(info->external);

Powered by Google App Engine
This is Rietveld 408576698