| Index: media/base/android/media_codec_decoder_unittest.cc
|
| diff --git a/media/base/android/media_codec_decoder_unittest.cc b/media/base/android/media_codec_decoder_unittest.cc
|
| index d32c8aea182f73102333eb43383a744baf07c909..2c6808d6b0eef65fd82a732712e0befee0733314 100644
|
| --- a/media/base/android/media_codec_decoder_unittest.cc
|
| +++ b/media/base/android/media_codec_decoder_unittest.cc
|
| @@ -149,6 +149,7 @@ class MediaCodecDecoderTest : public testing::Test {
|
| // Decoder callbacks.
|
| void OnDataRequested();
|
| void OnStarvation() { is_starved_ = true; }
|
| + void OnPrerollDone() { decoder_->ResumeAfterPreroll(); }
|
| void OnStopDone() { is_stopped_ = true; }
|
| void OnError() {}
|
| void OnUpdateCurrentTime(base::TimeDelta now_playing,
|
| @@ -231,6 +232,7 @@ void MediaCodecDecoderTest::CreateAudioDecoder() {
|
| task_runner_, base::Bind(&MediaCodecDecoderTest::OnDataRequested,
|
| base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnStarvation, base::Unretained(this)),
|
| + base::Bind(&MediaCodecDecoderTest::OnPrerollDone, base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnStopDone, base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnError, base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnUpdateCurrentTime,
|
| @@ -245,6 +247,7 @@ void MediaCodecDecoderTest::CreateVideoDecoder() {
|
| task_runner_, base::Bind(&MediaCodecDecoderTest::OnDataRequested,
|
| base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnStarvation, base::Unretained(this)),
|
| + base::Bind(&MediaCodecDecoderTest::OnPrerollDone, base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnStopDone, base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnError, base::Unretained(this)),
|
| base::Bind(&MediaCodecDecoderTest::OnUpdateCurrentTime,
|
| @@ -490,7 +493,10 @@ TEST_F(MediaCodecDecoderTest, AudioPlayTillCompletion) {
|
| EXPECT_TRUE(decoder_->IsCompleted());
|
|
|
| // Last buffered timestamp should be no less than PTS.
|
| - EXPECT_EQ(22, pts_stat_.num_values());
|
| + // The number of hits in pts_stat_ depends on the preroll implementation.
|
| + // We might not report the time for the first buffer after preroll that
|
| + // is written to the audio track. pts_stat_.num_values() is either 21 or 22.
|
| + EXPECT_LE(21, pts_stat_.num_values());
|
| EXPECT_LE(data_factory_->last_pts(), pts_stat_.max());
|
| }
|
|
|
|
|