Chromium Code Reviews| Index: media/base/android/media_source_player_unittest.cc |
| diff --git a/media/base/android/media_source_player_unittest.cc b/media/base/android/media_source_player_unittest.cc |
| index a3e69e5bd3f5f91e0b1bb50c73fb9d20b3a8811c..202b4951cbff44148df59f85cf43ce4e58acc405 100644 |
| --- a/media/base/android/media_source_player_unittest.cc |
| +++ b/media/base/android/media_source_player_unittest.cc |
| @@ -2064,4 +2064,25 @@ TEST_F(MediaSourcePlayerTest, SurfaceChangeClearedEvenIfMediaCryptoAbsent) { |
| EXPECT_FALSE(GetMediaDecoderJob(false)); |
| } |
| +TEST_F(MediaSourcePlayerTest, CurrentTimeUpdatedWhileDecoderStarved) { |
|
wolenetz
2014/04/03 18:14:40
Does this one test cover all 3 items in this CL's
qinmin
2014/04/03 21:59:45
This covers the first item in the description. I a
|
| + SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| + |
| + // Test that current time is updated while decoder is starved. |
| + StartAudioDecoderJob(true); |
| + for (int i = 0; i < 3; ++i) { |
| + player_.OnDemuxerDataAvailable(CreateReadFromDemuxerAckForAudio(i)); |
| + WaitForAudioDecodeDone(); |
| + } |
| + base::TimeDelta current_time = player_.GetCurrentTime(); |
| + |
| + // Trigger starvation while the decoder is decoding. |
| + player_.OnDemuxerDataAvailable(CreateReadFromDemuxerAckForAudio(3)); |
| + TriggerPlayerStarvation(); |
| + WaitForAudioDecodeDone(); |
| + |
| + // Current time should be updated. |
| + EXPECT_LT(current_time.InMillisecondsF(), |
| + player_.GetCurrentTime().InMillisecondsF()); |
| +} |
| + |
| } // namespace media |