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

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: Created 8 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/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 6a7fb4f3e0a6b1103d2274965f21c2c60bb21bf4..c84eddac932f52a49d4b3ce2c1243e6e7c9bf5b1 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -427,6 +427,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) {

Powered by Google App Engine
This is Rietveld 408576698