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

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

Issue 1242913004: MediaCodecPlayer implementation (stage 3 - browser seek and surface change) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-seek
Patch Set: Fixed SeekTo() followed by Release() and added uunit tests for this case Created 5 years, 5 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
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 39e6661f9373836fd0e454908f483038fda225a1..7ad70c4455682a56930b891e3af60baed440cce1 100644
--- a/media/base/android/media_codec_decoder_unittest.cc
+++ b/media/base/android/media_codec_decoder_unittest.cc
@@ -277,7 +277,7 @@ void MediaCodecDecoderTest::SetVideoSurface() {
ASSERT_NE(nullptr, decoder_.get());
MediaCodecVideoDecoder* video_decoder =
static_cast<MediaCodecVideoDecoder*>(decoder_.get());
- video_decoder->SetPendingSurface(surface.Pass());
+ video_decoder->SetVideoSurface(surface.Pass());
}
TEST_F(MediaCodecDecoderTest, AudioPrefetch) {
@@ -332,6 +332,20 @@ TEST_F(MediaCodecDecoderTest, VideoConfigureNoParams) {
CreateVideoDecoder();
+ // decoder_->Configure() searches back for the key frame.
+ // We have to prefetch decoder.
+
+ base::TimeDelta duration = base::TimeDelta::FromMilliseconds(500);
+ SetDataFactory(scoped_ptr<VideoFactory>(new VideoFactory(duration)));
+
+ decoder_->Prefetch(base::Bind(&MediaCodecDecoderTest::SetPrefetched,
+ base::Unretained(this), true));
+
+ EXPECT_TRUE(WaitForCondition(base::Bind(&MediaCodecDecoderTest::is_prefetched,
+ base::Unretained(this))));
+
+ SetVideoSurface();
+
// Cannot configure without config parameters.
EXPECT_EQ(MediaCodecDecoder::CONFIG_FAILURE, decoder_->Configure());
}
@@ -389,7 +403,7 @@ TEST_F(MediaCodecDecoderTest, VideoConfigureInvalidSurface) {
MediaCodecVideoDecoder* video_decoder =
static_cast<MediaCodecVideoDecoder*>(decoder_.get());
- video_decoder->SetPendingSurface(surface.Pass());
+ video_decoder->SetVideoSurface(surface.Pass());
EXPECT_EQ(MediaCodecDecoder::CONFIG_FAILURE, decoder_->Configure());
}

Powered by Google App Engine
This is Rietveld 408576698