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

Unified Diff: media/base/audio_pull_fifo_unittest.cc

Issue 11410012: Collapse AudioRendererMixer and OnMoreDataResampler into AudioTransform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename. Comments. Created 8 years, 1 month 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 | « media/base/audio_pull_fifo.cc ('k') | media/base/audio_renderer_mixer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_pull_fifo_unittest.cc
diff --git a/media/base/audio_pull_fifo_unittest.cc b/media/base/audio_pull_fifo_unittest.cc
index e5c005d5200827d65ac7bf9eb1f7660d098bf9a2..cec4d35c7d20fa8a29d298fb45c76d115223a5a2 100644
--- a/media/base/audio_pull_fifo_unittest.cc
+++ b/media/base/audio_pull_fifo_unittest.cc
@@ -29,7 +29,8 @@ class AudioPullFifoTest
: pull_fifo_(kChannels, kMaxFramesInFifo, base::Bind(
&AudioPullFifoTest::ProvideInput, base::Unretained(this))),
audio_bus_(AudioBus::Create(kChannels, kMaxFramesInFifo)),
- fill_value_(0) {}
+ fill_value_(0),
+ last_frame_delay_(-1) {}
virtual ~AudioPullFifoTest() {}
void VerifyValue(const float data[], int size, float start_value) {
@@ -51,12 +52,16 @@ class AudioPullFifoTest
VerifyValue(audio_bus_->channel(j), frames_to_consume, start_value);
}
start_value += frames_to_consume;
+ EXPECT_LT(last_frame_delay_, audio_bus_->frames());
}
// AudioPullFifo::ReadCB implementation where we increase a value for each
// audio frame that we provide. Note that all channels are given the same
// value to simplify the verification.
- virtual void ProvideInput(AudioBus* audio_bus) {
+ virtual void ProvideInput(int frame_delay, AudioBus* audio_bus) {
+ ASSERT_GT(frame_delay, last_frame_delay_);
+ last_frame_delay_ = frame_delay;
+
EXPECT_EQ(audio_bus->channels(), audio_bus_->channels());
EXPECT_EQ(audio_bus->frames(), kMaxFramesInFifo);
for (int i = 0; i < audio_bus->frames(); ++i) {
@@ -72,6 +77,7 @@ class AudioPullFifoTest
AudioPullFifo pull_fifo_;
scoped_ptr<AudioBus> audio_bus_;
int fill_value_;
+ int last_frame_delay_;
DISALLOW_COPY_AND_ASSIGN(AudioPullFifoTest);
};
« no previous file with comments | « media/base/audio_pull_fifo.cc ('k') | media/base/audio_renderer_mixer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698