Chromium Code Reviews| 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 be32dac8d8c92589d8ba47aa3679e6bf119ee155..b1f112146dc97cd0da99bdbeefe4e4d4b5f76149 100644 |
| --- a/media/filters/ffmpeg_video_decoder_unittest.cc |
| +++ b/media/filters/ffmpeg_video_decoder_unittest.cc |
| @@ -91,7 +91,7 @@ class FFmpegVideoDecoderTest : public testing::Test { |
| config_.Initialize(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, |
| kVideoFormat, kCodedSize, kVisibleRect, kNaturalSize, |
| - NULL, 0, true); |
| + NULL, 0, false, true); |
| } |
| virtual ~FFmpegVideoDecoderTest() {} |
| @@ -100,6 +100,11 @@ class FFmpegVideoDecoderTest : public testing::Test { |
| InitializeWithConfig(config_); |
| } |
| + void InitializeWithEncryptedConfig() { |
| + config_.set_is_encrypted(true); |
|
acolwell GONE FROM CHROMIUM
2012/09/17 17:41:17
Just copy the config_.Initialize() call from above
xhwang
2012/09/17 19:42:25
Done.
|
| + InitializeWithConfig(config_); |
| + } |
| + |
| void InitializeWithConfigAndStatus(const VideoDecoderConfig& config, |
| PipelineStatus status) { |
| EXPECT_CALL(*demuxer_, video_decoder_config()) |
| @@ -247,7 +252,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_UnsupportedDecoder) { |
| VideoDecoderConfig config(kUnknownVideoCodec, VIDEO_CODEC_PROFILE_UNKNOWN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, kNaturalSize, |
| - NULL, 0); |
| + NULL, false, false); |
|
acolwell GONE FROM CHROMIUM
2012/09/17 17:41:17
nit: I'm pretty sure this should be 0, false here
xhwang
2012/09/17 19:42:25
Oops, thanks for the catch. Done here and blow.
|
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -256,7 +261,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_UnsupportedPixelFormat) { |
| VideoDecoderConfig config(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, |
| VideoFrame::INVALID, |
| kCodedSize, kVisibleRect, kNaturalSize, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -265,7 +270,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_OpenDecoderFails) { |
| VideoDecoderConfig config(kCodecTheora, VIDEO_CODEC_PROFILE_UNKNOWN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, kNaturalSize, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -274,7 +279,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioNumeratorZero) { |
| VideoDecoderConfig config(kCodecVP8, VP8PROFILE_MAIN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, natural_size, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -283,7 +288,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioDenominatorZero) { |
| VideoDecoderConfig config(kCodecVP8, VP8PROFILE_MAIN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, natural_size, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -292,7 +297,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioNumeratorNegative) { |
| VideoDecoderConfig config(kCodecVP8, VP8PROFILE_MAIN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, natural_size, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -301,7 +306,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioDenominatorNegative) { |
| VideoDecoderConfig config(kCodecVP8, VP8PROFILE_MAIN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, natural_size, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -312,7 +317,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioNumeratorTooLarge) { |
| VideoDecoderConfig config(kCodecVP8, VP8PROFILE_MAIN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, natural_size, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -322,7 +327,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioDenominatorTooLarge) { |
| VideoDecoderConfig config(kCodecVP8, VP8PROFILE_MAIN, |
| kVideoFormat, |
| kCodedSize, kVisibleRect, natural_size, |
| - NULL, 0); |
| + NULL, false, false); |
| InitializeWithConfigAndStatus(config, PIPELINE_ERROR_DECODE); |
| } |
| @@ -444,7 +449,7 @@ TEST_F(FFmpegVideoDecoderTest, DecodeFrame_SmallerHeight) { |
| } |
| TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_Normal) { |
| - Initialize(); |
| + InitializeWithEncryptedConfig(); |
| // Simulate decoding a single encrypted frame. |
| EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _)) |
| @@ -461,7 +466,7 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_Normal) { |
| // Test the case that the decryptor fails to decrypt the encrypted buffer. |
| TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_DecryptError) { |
| - Initialize(); |
| + InitializeWithEncryptedConfig(); |
| // Simulate decoding a single encrypted frame. |
| EXPECT_CALL(*demuxer_, Read(_)) |
| @@ -483,7 +488,7 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_DecryptError) { |
| // Test the case that the decryptor has no key to decrypt the encrypted buffer. |
| TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_NoDecryptionKey) { |
| - Initialize(); |
| + InitializeWithEncryptedConfig(); |
| // Simulate decoding a single encrypted frame. |
| EXPECT_CALL(*demuxer_, Read(_)) |
| @@ -506,7 +511,7 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_NoDecryptionKey) { |
| // 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) { |
| - Initialize(); |
| + InitializeWithEncryptedConfig(); |
| // Simulate decoding a single encrypted frame. |
| EXPECT_CALL(*demuxer_, Read(_)) |