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

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

Issue 171233007: Don't process pending prefetch events if we fail to create video decoder job (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 c07210be432eda55c6b2edcf118daeae1dcbb8ef..9983628f147e3fce35637b125226bd34a9c70369 100644
--- a/media/base/android/media_source_player_unittest.cc
+++ b/media/base/android/media_source_player_unittest.cc
@@ -886,6 +886,32 @@ TEST_F(MediaSourcePlayerTest, ChangeMultipleSurfaceWhileDecoding) {
EXPECT_EQ(1, demuxer_->num_seek_requests());
}
+TEST_F(MediaSourcePlayerTest, SetEmptySurfaceWhileDecoding) {
+ SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE();
+
+ // Test player pauses if an empty surface is passed.
+ CreateNextTextureAndSetVideoSurface();
+ StartVideoDecoderJob(true);
+
+ // Send the first input chunk.
+ player_.OnDemuxerDataAvailable(CreateReadFromDemuxerAckForVideo());
+
+ // While the decoder is decoding, pass an empty surface.
+ gfx::ScopedJavaSurface empty_surface;
+ player_.SetVideoSurface(empty_surface.Pass());
wolenetz 2014/02/20 20:52:11 Is this where the NPE previously occurred prior to
qinmin 2014/02/20 22:36:05 Added a TriggerPlayerStarvation() call to let the
+
+ // Wait for the decoder job to finish decoding and be reset.
+ while (GetMediaDecoderJob(false))
+ message_loop_.RunUntilIdle();
+
+ // No seek request should have been received since the surface is empty.
+ EXPECT_EQ(0, demuxer_->num_browser_seek_requests());
+
+ // Playback resumes once a non-empty surface is passed.
+ CreateNextTextureAndSetVideoSurface();
+ EXPECT_EQ(1, demuxer_->num_browser_seek_requests());
+}
+
TEST_F(MediaSourcePlayerTest, AudioOnlyStartAfterSeekFinish) {
SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE();
« 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