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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 11144036: Update Decryptor interface to support audio decoding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove leftover unretained Created 8 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/filters/ffmpeg_video_decoder.cc ('k') | webkit/media/crypto/ppapi/clear_key_cdm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder_unittest.cc
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index f2b049d1686039a8b1431d2e878091386d581b49..1ec73db6b51767b42e1cc95cb8a069e92a0a8f1a 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -63,7 +63,7 @@ ACTION_P(ReturnBuffer, buffer) {
}
ACTION_P2(RunDecryptCB, status, buffer) {
- arg1.Run(status, buffer);
+ arg2.Run(status, buffer);
}
class FFmpegVideoDecoderTest : public testing::Test {
@@ -123,7 +123,7 @@ class FFmpegVideoDecoderTest : public testing::Test {
InitializeWithConfigAndStatus(config, PIPELINE_OK);
}
- void CancelDecrypt() {
+ void CancelDecrypt(Decryptor::StreamType stream_type) {
if (!decrypt_cb_.is_null()) {
base::ResetAndReturn(&decrypt_cb_).Run(
Decryptor::kError, scoped_refptr<DecoderBuffer>(NULL));
@@ -131,7 +131,7 @@ class FFmpegVideoDecoderTest : public testing::Test {
}
void Reset() {
- EXPECT_CALL(*decryptor_, CancelDecrypt())
+ EXPECT_CALL(*decryptor_, CancelDecrypt(Decryptor::kVideo))
.WillOnce(Invoke(this, &FFmpegVideoDecoderTest::CancelDecrypt));
decoder_->Reset(NewExpectedClosure());
message_loop_.RunAllPending();
@@ -141,7 +141,7 @@ class FFmpegVideoDecoderTest : public testing::Test {
// Use AtMost(1) here because CancelDecrypt() will be called once if the
// decoder was initialized and has not been stopped, and will not be
// called otherwise.
- EXPECT_CALL(*decryptor_, CancelDecrypt())
+ EXPECT_CALL(*decryptor_, CancelDecrypt(Decryptor::kVideo))
.Times(AtMost(1))
.WillRepeatedly(Invoke(this, &FFmpegVideoDecoderTest::CancelDecrypt));
decoder_->Stop(NewExpectedClosure());
@@ -467,7 +467,8 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_Normal) {
InitializeWithEncryptedConfig();
// Simulate decoding a single encrypted frame.
- EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
+ EXPECT_CALL(*decryptor_,
+ Decrypt(Decryptor::kVideo, encrypted_i_frame_buffer_, _))
.WillRepeatedly(RunDecryptCB(Decryptor::kSuccess, i_frame_buffer_));
VideoDecoder::Status status;
@@ -486,7 +487,8 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_DecryptError) {
// Simulate decoding a single encrypted frame.
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
- EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
+ EXPECT_CALL(*decryptor_,
+ Decrypt(Decryptor::kVideo, encrypted_i_frame_buffer_, _))
.WillRepeatedly(RunDecryptCB(Decryptor::kError,
scoped_refptr<media::DecoderBuffer>()));
@@ -508,7 +510,8 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_NoDecryptionKey) {
// Simulate decoding a single encrypted frame.
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
- EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
+ EXPECT_CALL(*decryptor_,
+ Decrypt(Decryptor::kVideo, encrypted_i_frame_buffer_, _))
.WillRepeatedly(RunDecryptCB(Decryptor::kNoKey,
scoped_refptr<media::DecoderBuffer>()));
@@ -531,7 +534,8 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_CorruptedBufferReturned) {
// Simulate decoding a single encrypted frame.
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
- EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
+ EXPECT_CALL(*decryptor_,
+ Decrypt(Decryptor::kVideo, encrypted_i_frame_buffer_, _))
.WillRepeatedly(RunDecryptCB(Decryptor::kSuccess,
corrupt_i_frame_buffer_));
// The decoder only detects the error at the second decoding call. So
@@ -600,8 +604,9 @@ TEST_F(FFmpegVideoDecoderTest, Reset_DuringPendingDecrypt) {
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
- EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
- .WillOnce(SaveArg<1>(&decrypt_cb_));
+ EXPECT_CALL(*decryptor_,
+ Decrypt(Decryptor::kVideo, encrypted_i_frame_buffer_, _))
+ .WillOnce(SaveArg<2>(&decrypt_cb_));
decoder_->Read(read_cb_);
message_loop_.RunAllPending();
@@ -662,8 +667,9 @@ TEST_F(FFmpegVideoDecoderTest, Stop_DuringPendingDecrypt) {
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
- EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
- .WillOnce(SaveArg<1>(&decrypt_cb_));
+ EXPECT_CALL(*decryptor_,
+ Decrypt(Decryptor::kVideo, encrypted_i_frame_buffer_, _))
+ .WillOnce(SaveArg<2>(&decrypt_cb_));
decoder_->Read(read_cb_);
message_loop_.RunAllPending();
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | webkit/media/crypto/ppapi/clear_key_cdm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698