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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 10822026: Implement "Key Presence" step in "Encrypted Block Encounted" algorithm in EME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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_decryptor.h » ('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 9d97c82f8f90d0572845b6b80224b7abd9b26e40..56be3e5bd48b640c9e56ebf378b0a75314355803 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -479,6 +479,28 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_DecryptError) {
message_loop_.RunAllPending();
}
+// Test the case that the decryptor has no key to decrypt the encrypted buffer.
+TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_NoDecryptionKey) {
+ Initialize();
+
+ // Simulate decoding a single encrypted frame.
+ EXPECT_CALL(*demuxer_, Read(_))
+ .WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
+ EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
+ .WillRepeatedly(RunDecryptCB(Decryptor::kNoKey,
+ scoped_refptr<media::DecoderBuffer>()));
+
+ // Our read should still get satisfied with end of stream frame during an
+ // error.
+ VideoDecoder::DecoderStatus status;
+ scoped_refptr<VideoFrame> video_frame;
+ Read(&status, &video_frame);
+ EXPECT_EQ(VideoDecoder::kDecryptError, status);
+ EXPECT_FALSE(video_frame);
+
+ message_loop_.RunAllPending();
+}
+
// Test the case that the decryptor fails to decrypt the encrypted buffer but
// cannot detect the decryption error and returns a corrupted buffer.
TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_CorruptedBufferReturned) {
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | webkit/media/crypto/ppapi_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698