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 39c000c05eecd19ffa32802104cfb401f67ba465..6ddad14f1278978cf727309e1f3e1b29e5f620cc 100644 |
--- a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc |
+++ b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc |
@@ -81,27 +81,13 @@ TEST(DecoderDatabase, GetDecoderInfo) { |
const DecoderDatabase::DecoderInfo* info; |
info = db.GetDecoderInfo(kPayloadType); |
ASSERT_TRUE(info != NULL); |
- EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type); |
+ EXPECT_TRUE(info->IsType("pcmu")); |
EXPECT_EQ(kCodecName, info->name); |
EXPECT_EQ(decoder, db.GetDecoder(kPayloadType)); |
info = db.GetDecoderInfo(kPayloadType + 1); // Other payload type. |
EXPECT_TRUE(info == NULL); // Should not be found. |
} |
-TEST(DecoderDatabase, GetRtpPayloadType) { |
- DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>); |
- const uint8_t kPayloadType = 0; |
- const std::string kCodecName = "Robert\'); DROP TABLE Students;"; |
- EXPECT_EQ( |
- DecoderDatabase::kOK, |
- db.RegisterPayload(kPayloadType, NetEqDecoder::kDecoderPCMu, kCodecName)); |
- EXPECT_EQ(kPayloadType, db.GetRtpPayloadType(NetEqDecoder::kDecoderPCMu)); |
- const uint8_t expected_value = DecoderDatabase::kRtpPayloadTypeError; |
- EXPECT_EQ(expected_value, |
- db.GetRtpPayloadType( |
- NetEqDecoder::kDecoderISAC)); // iSAC is not registered. |
-} |
- |
TEST(DecoderDatabase, GetDecoder) { |
DecoderDatabase db(CreateBuiltinAudioDecoderFactory()); |
const uint8_t kPayloadType = 0; |
@@ -141,8 +127,8 @@ TEST(DecoderDatabase, TypeTests) { |
EXPECT_FALSE(db.IsComfortNoise(kPayloadTypePcmU)); |
EXPECT_FALSE(db.IsDtmf(kPayloadTypePcmU)); |
EXPECT_FALSE(db.IsRed(kPayloadTypePcmU)); |
- EXPECT_FALSE(db.IsType(kPayloadTypePcmU, NetEqDecoder::kDecoderISAC)); |
- EXPECT_TRUE(db.IsType(kPayloadTypePcmU, NetEqDecoder::kDecoderPCMu)); |
+ EXPECT_FALSE(db.IsType(kPayloadTypePcmU, "isac")); |
+ EXPECT_TRUE(db.IsType(kPayloadTypePcmU, "pcmu")); |
EXPECT_TRUE(db.IsComfortNoise(kPayloadTypeCng)); |
EXPECT_TRUE(db.IsDtmf(kPayloadTypeDtmf)); |
EXPECT_TRUE(db.IsRed(kPayloadTypeRed)); |
@@ -164,7 +150,8 @@ TEST(DecoderDatabase, ExternalDecoder) { |
const DecoderDatabase::DecoderInfo* info; |
info = db.GetDecoderInfo(kPayloadType); |
ASSERT_TRUE(info != NULL); |
- EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type); |
+ EXPECT_TRUE(info->IsType("pcmu")); |
+ EXPECT_EQ(info->name, kCodecName); |
EXPECT_EQ(kCodecName, info->name); |
// Expect not to delete the decoder when removing it from the database, since |
// it was declared externally. |
@@ -182,9 +169,8 @@ TEST(DecoderDatabase, CheckPayloadTypes) { |
// matter for the test). |
const int kNumPayloads = 10; |
for (uint8_t payload_type = 0; payload_type < kNumPayloads; ++payload_type) { |
- EXPECT_EQ( |
- DecoderDatabase::kOK, |
- db.RegisterPayload(payload_type, NetEqDecoder::kDecoderArbitrary, "")); |
+ EXPECT_EQ(DecoderDatabase::kOK, |
+ db.RegisterPayload(payload_type, NetEqDecoder::kDecoderPCMu, "")); |
} |
PacketList packet_list; |
for (int i = 0; i < kNumPayloads + 1; ++i) { |