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

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

Issue 1903153005: Add a TickTimer object to NetEqImpl (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-tick-timer
Patch Set: Rebase Created 4 years, 8 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.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_impl_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
index e9291d1815fe4fc9786368bcb10c879c8d10db78..4c6f0eb2c79a608ffcab960711f368313e52265f 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
@@ -57,6 +57,7 @@ class NetEqImplTest : public ::testing::Test {
NetEqImplTest()
: neteq_(NULL),
config_(),
+ tick_timer_(new TickTimer),
mock_buffer_level_filter_(NULL),
buffer_level_filter_(NULL),
use_mock_buffer_level_filter_(true),
@@ -146,19 +147,12 @@ class NetEqImplTest : public ::testing::Test {
PreemptiveExpandFactory* preemptive_expand_factory =
new PreemptiveExpandFactory;
- neteq_ = new NetEqImpl(config_,
- buffer_level_filter_,
- decoder_database_,
- delay_manager_,
- delay_peak_detector_,
- dtmf_buffer_,
- dtmf_tone_generator_,
- packet_buffer_,
- payload_splitter_,
- timestamp_scaler_,
- accelerate_factory,
- expand_factory,
- preemptive_expand_factory);
+ neteq_ = new NetEqImpl(
+ config_, std::unique_ptr<TickTimer>(tick_timer_), buffer_level_filter_,
+ decoder_database_, delay_manager_, delay_peak_detector_, dtmf_buffer_,
+ dtmf_tone_generator_, packet_buffer_, payload_splitter_,
+ timestamp_scaler_, accelerate_factory, expand_factory,
+ preemptive_expand_factory);
ASSERT_TRUE(neteq_ != NULL);
}
@@ -201,6 +195,7 @@ class NetEqImplTest : public ::testing::Test {
NetEqImpl* neteq_;
NetEq::Config config_;
+ TickTimer* tick_timer_;
MockBufferLevelFilter* mock_buffer_level_filter_;
BufferLevelFilter* buffer_level_filter_;
bool use_mock_buffer_level_filter_;
@@ -1198,4 +1193,14 @@ TEST_F(NetEqImplTest, InitialLastOutputSampleRate) {
EXPECT_EQ(48000, neteq_->last_output_sample_rate_hz());
}
+TEST_F(NetEqImplTest, TickTimerIncrement) {
+ UseNoMocks();
+ CreateInstance();
+ ASSERT_TRUE(tick_timer_);
+ EXPECT_EQ(0u, tick_timer_->ticks());
+ AudioFrame output;
+ EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output));
+ EXPECT_EQ(1u, tick_timer_->ticks());
+}
+
}// namespace webrtc
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698