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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 10165010: Add a media pipeline status error code for decryption error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 ec89665f2e0fe7a8090c7cc557f8f0ce3075b54e..c318a7398573aeecf0e468f494ca7d5061d24ac8 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -384,14 +384,12 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_Normal) {
TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_NoKey) {
Initialize();
+ encrypted_i_frame_buffer_->SetDecryptConfig(scoped_ptr<DecryptConfig>(
+ new DecryptConfig(kKeyId, arraysize(kKeyId) - 1)));
+
xhwang 2012/04/20 19:08:28 This is to fix a bug in the test. If we don't SetD
ddorwin 2012/04/20 19:18:50 Should we copy the comment "// Simulate decoding a
xhwang 2012/04/20 19:51:01 Done.
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
-
- // The error is only raised on the second decode attempt, so we expect at
- // least one successful decode but we don't expect FrameReady() to be
- // executed as an error is raised instead.
- EXPECT_CALL(statistics_cb_, OnStatistics(_));
- EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECRYPT));
// Our read should still get satisfied with end of stream frame during an
// error.
@@ -409,21 +407,20 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_WrongKey) {
decoder_->decryptor()->AddKey(kKeyId, arraysize(kKeyId) - 1,
kWrongKey, arraysize(kWrongKey) - 1);
-#if defined(OS_LINUX)
- // Using the wrong key on linux doesn't cause an decryption error but actually
- // attempts to decode the content, however we're unable to distinguish between
- // the two.
- //
- // TODO(xhwang): Add a decryption error code, see http://crbug.com/121177
- EXPECT_CALL(statistics_cb_, OnStatistics(_));
-#endif
-
encrypted_i_frame_buffer_->SetDecryptConfig(scoped_ptr<DecryptConfig>(
new DecryptConfig(kKeyId, arraysize(kKeyId) - 1)));
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
+#if defined(OS_LINUX)
+ // Using the wrong key on linux doesn't cause an decryption error but actually
+ // attempts to decode the content, however we're unable to distinguish between
+ // the two. See: crbug.com/124434.
+ EXPECT_CALL(statistics_cb_, OnStatistics(_));
EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
+#else
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECRYPT));
+#endif
// Our read should still get satisfied with end of stream frame during an
// error.

Powered by Google App Engine
This is Rietveld 408576698