| 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 e329ac6eee6dc529fc3f4f6f46c40146036f6f21..930cdd9ad79d216b170013ece3a12cb81d984d4e 100644
|
| --- a/media/base/android/media_source_player_unittest.cc
|
| +++ b/media/base/android/media_source_player_unittest.cc
|
| @@ -167,6 +167,12 @@ class MediaSourcePlayerTest : public testing::Test {
|
| return player_.preroll_timestamp_;
|
| }
|
|
|
| + // Inspect internal pending_event_ state of |player_|. This is for infrequent
|
| + // use by tests, only where required.
|
| + bool IsPendingSurfaceChange() {
|
| + return player_.IsEventPending(player_.SURFACE_CHANGE_EVENT_PENDING);
|
| + }
|
| +
|
| DemuxerConfigs CreateAudioDemuxerConfigs() {
|
| DemuxerConfigs configs;
|
| configs.audio_codec = kCodecVorbis;
|
| @@ -1379,6 +1385,26 @@ TEST_F(MediaSourcePlayerTest, NewSurfaceWhileChangingConfigs) {
|
| EXPECT_EQ(0, demuxer_->num_seek_requests());
|
| }
|
|
|
| +// TODO(xhwang): Once we add tests to cover DrmBridge, update this test to
|
| +// also verify that the job is successfully created if SetDrmBridge(), Start()
|
| +// and eventually OnMediaCrypto() occur. This would increase test coverage of
|
| +// http://crbug.com/313470 and allow us to remove inspection of internal player
|
| +// pending event state. See http://crbug.com/313860.
|
| +TEST_F(MediaSourcePlayerTest, SurfaceChangeClearedEvenIfMediaCryptoAbsent) {
|
| + SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE();
|
| +
|
| + // Test that |SURFACE_CHANGE_EVENT_PENDING| is not pending after
|
| + // SetVideoSurface() for a player configured for encrypted video, when the
|
| + // player has not yet received media crypto.
|
| + DemuxerConfigs configs = CreateVideoDemuxerConfigs();
|
| + configs.is_video_encrypted = true;
|
| +
|
| + player_.OnDemuxerConfigsAvailable(configs);
|
| + CreateNextTextureAndSetVideoSurface();
|
| + EXPECT_FALSE(IsPendingSurfaceChange());
|
| + EXPECT_FALSE(GetMediaDecoderJob(false));
|
| +}
|
| +
|
| // TODO(xhwang): Enable this test when the test devices are updated.
|
| TEST_F(MediaSourcePlayerTest, DISABLED_IsTypeSupported_Widevine) {
|
| if (!MediaCodecBridge::IsAvailable() || !MediaDrmBridge::IsAvailable()) {
|
|
|