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

Unified Diff: media/filters/audio_renderer_impl_unittest.cc

Issue 256163005: Introduce AudioClock to improve playback delay calculations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: AudioClock Created 6 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
Index: media/filters/audio_renderer_impl_unittest.cc
diff --git a/media/filters/audio_renderer_impl_unittest.cc b/media/filters/audio_renderer_impl_unittest.cc
index 1ae27e35f48eb6b5b6d23fea5f2b65b53cdb1249..9190080b7d6872bb8375d55827eedb74195f9160 100644
--- a/media/filters/audio_renderer_impl_unittest.cc
+++ b/media/filters/audio_renderer_impl_unittest.cc
@@ -969,13 +969,14 @@ TEST_F(AudioRendererImplTest, TimeUpdatesOnFirstBuffer) {
EXPECT_TRUE(ConsumeBufferedData(kFramesToConsume, NULL));
WaitForPendingRead();
- // Ensure we received a time update for the first buffer and it's zero.
+ // ConsumeBufferedData() uses an audio delay of zero, so ensure we received
+ // a time update that's equal to |kFramesToConsume| from above.
timestamp_helper.SetBaseTimestamp(base::TimeDelta());
- EXPECT_EQ(timestamp_helper.base_timestamp(), last_time_update());
timestamp_helper.AddFrames(kFramesToConsume);
+ EXPECT_EQ(timestamp_helper.GetTimestamp(), last_time_update());
- // ConsumeBufferedData() uses an audio delay of zero, so the next buffer
- // should have a timestamp equal to the duration of |kFramesToConsume|.
+ // The next time update should match the remaining frames_buffered().
+ timestamp_helper.AddFrames(frames_buffered());
EXPECT_TRUE(ConsumeBufferedData(frames_buffered(), NULL));
EXPECT_EQ(timestamp_helper.GetTimestamp(), last_time_update());
}

Powered by Google App Engine
This is Rietveld 408576698