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

Unified Diff: media/base/android/media_source_player_unittest.cc

Issue 53413004: Clear any pending surface change prior to checking media crypto in MSP::ConfigureVideoDecoderJob() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addresses comments and adds a narrow unit test Created 7 years, 2 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
« no previous file with comments | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a5426815d5c9497b2cdc41211b3ad1c11fe5121e 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
wolenetz 2013/10/31 20:34:25 From chat with qinmin@, MSP should be able to crea
wolenetz 2013/10/31 21:19:17 Actually, MSP::GetMediaCrypto() requires previous
+// 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.
+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()) {
« no previous file with comments | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698