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

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

Issue 1990803004: Turned AudioDecoderFactory into a RefCounted thing to use with scoped_refptr. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed AudioDecoderFactory destructor declaration. Created 4 years, 7 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 91ca606d65bbeb0acf9eabd01ff7d0f044b47318..9efc2fc7a0ec2f228b5444a7117c8acbc716acd9 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
@@ -25,15 +25,13 @@
namespace webrtc {
TEST(DecoderDatabase, CreateAndDestroy) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
EXPECT_EQ(0, db.Size());
EXPECT_TRUE(db.Empty());
}
TEST(DecoderDatabase, InsertAndRemove) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
const uint8_t kPayloadType = 0;
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
EXPECT_EQ(
@@ -47,8 +45,7 @@ TEST(DecoderDatabase, InsertAndRemove) {
}
TEST(DecoderDatabase, GetDecoderInfo) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
const uint8_t kPayloadType = 0;
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
EXPECT_EQ(
@@ -66,8 +63,7 @@ TEST(DecoderDatabase, GetDecoderInfo) {
}
TEST(DecoderDatabase, GetRtpPayloadType) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
const uint8_t kPayloadType = 0;
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
EXPECT_EQ(
@@ -92,8 +88,7 @@ TEST(DecoderDatabase, GetDecoder) {
}
TEST(DecoderDatabase, TypeTests) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
const uint8_t kPayloadTypePcmU = 0;
const uint8_t kPayloadTypeCng = 13;
const uint8_t kPayloadTypeDtmf = 100;
@@ -128,8 +123,7 @@ TEST(DecoderDatabase, TypeTests) {
}
TEST(DecoderDatabase, ExternalDecoder) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
const uint8_t kPayloadType = 0;
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
MockAudioDecoder decoder;
@@ -158,8 +152,7 @@ TEST(DecoderDatabase, ExternalDecoder) {
}
TEST(DecoderDatabase, CheckPayloadTypes) {
- std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
- DecoderDatabase db(std::move(factory));
+ DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
// Load a number of payloads into the database. Payload types are 0, 1, ...,
// while the decoder type is the same for all payload types (this does not
// matter for the test).
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decoder_database.cc ('k') | webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698