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

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

Issue 2355503002: Stopped using the NetEqDecoder enum internally in NetEq. (Closed)
Patch Set: Clarified comments. Created 4 years, 3 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/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) {
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decoder_database.cc ('k') | webrtc/modules/audio_coding/neteq/delay_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698