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

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

Issue 2029543002: AudioDecoder: Remove the default implementation of SampleRateHz (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@samprate0
Patch Set: rebase Created 4 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
index cf413a4ca8d8733b0205b7b43fc9fbf8e8ade110..ca7c45967696627c1484922acae13b986f704d93 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
@@ -30,9 +30,10 @@ class MockAudioDecoder final : public AudioDecoder {
// http://crbug.com/428099.
static const int kPacketDuration = 960; // 48 kHz * 20 ms
- explicit MockAudioDecoder(size_t num_channels)
- : num_channels_(num_channels), fec_enabled_(false) {
- }
+ MockAudioDecoder(int sample_rate_hz, size_t num_channels)
+ : sample_rate_hz_(sample_rate_hz),
+ num_channels_(num_channels),
+ fec_enabled_(false) {}
~MockAudioDecoder() /* override */ { Die(); }
MOCK_METHOD0(Die, void());
@@ -53,6 +54,8 @@ class MockAudioDecoder final : public AudioDecoder {
return fec_enabled_;
}
+ int SampleRateHz() const /* override */ { return sample_rate_hz_; }
+
size_t Channels() const /* override */ { return num_channels_; }
void set_fec_enabled(bool enable_fec) { fec_enabled_ = enable_fec; }
@@ -81,6 +84,7 @@ class MockAudioDecoder final : public AudioDecoder {
}
private:
+ const int sample_rate_hz_;
const size_t num_channels_;
bool fec_enabled_;
};
@@ -278,21 +282,21 @@ NetEqNetworkStatsTest(NetEqDecoder codec,
};
TEST(NetEqNetworkStatsTest, DecodeFec) {
- MockAudioDecoder decoder(1);
+ MockAudioDecoder decoder(48000, 1);
NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder);
test.DecodeFecTest();
EXPECT_CALL(decoder, Die()).Times(1);
}
TEST(NetEqNetworkStatsTest, StereoDecodeFec) {
- MockAudioDecoder decoder(2);
+ MockAudioDecoder decoder(48000, 2);
NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder);
test.DecodeFecTest();
EXPECT_CALL(decoder, Die()).Times(1);
}
TEST(NetEqNetworkStatsTest, NoiseExpansionTest) {
- MockAudioDecoder decoder(1);
+ MockAudioDecoder decoder(48000, 1);
NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder);
test.NoiseExpansionTest();
EXPECT_CALL(decoder, Die()).Times(1);
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698