| 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 a21c3c84a6d63a92302e6f7b43be7c1f3073a01e..61accaecfa3efc68341f9e42c3f0fe120d6e6327 100644
|
| --- a/media/filters/ffmpeg_video_decoder_unittest.cc
|
| +++ b/media/filters/ffmpeg_video_decoder_unittest.cc
|
| @@ -213,9 +213,9 @@ class FFmpegVideoDecoderTest : public testing::Test {
|
|
|
| // Generates a 16 byte CTR counter block. The CTR counter block format is a
|
| // CTR IV appended with a CTR block counter. |iv| is an 8 byte CTR IV.
|
| - static scoped_array<uint8> GenerateCounterBlock(uint64 iv) {
|
| - scoped_array<uint8> counter_block_data(
|
| - new uint8[DecryptConfig::kDecryptionKeySize]);
|
| + static std::string GenerateCounterBlock(uint64 iv) {
|
| + scoped_array<char> counter_block_data(
|
| + new char[DecryptConfig::kDecryptionKeySize]);
|
|
|
| // Set the IV.
|
| memcpy(counter_block_data.get(), &iv, sizeof(iv));
|
| @@ -225,7 +225,8 @@ class FFmpegVideoDecoderTest : public testing::Test {
|
| 0,
|
| DecryptConfig::kDecryptionKeySize - sizeof(iv));
|
|
|
| - return counter_block_data.Pass();
|
| + return std::string(counter_block_data.get(),
|
| + DecryptConfig::kDecryptionKeySize);
|
| }
|
|
|
|
|
| @@ -415,13 +416,14 @@ TEST_F(FFmpegVideoDecoderTest, DISABLED_DecodeEncryptedFrame_Normal) {
|
| Initialize();
|
|
|
| // Simulate decoding a single encrypted frame.
|
| - scoped_array<uint8> counter_block(GenerateCounterBlock(kIv));
|
| + std::string counter_block(GenerateCounterBlock(kIv));
|
| encrypted_i_frame_buffer_->SetDecryptConfig(scoped_ptr<DecryptConfig>(
|
| new DecryptConfig(
|
| - kKeyId, arraysize(kKeyId),
|
| - counter_block.get(), DecryptConfig::kDecryptionKeySize,
|
| - kHmac, arraysize(kHmac),
|
| - sizeof(kIv))));
|
| + std::string(reinterpret_cast<const char*>(kKeyId), arraysize(kKeyId)),
|
| + counter_block,
|
| + std::string(reinterpret_cast<const char*>(kHmac), arraysize(kHmac)),
|
| + sizeof(kIv),
|
| + std::vector<SubsampleEntry>())));
|
|
|
| EXPECT_CALL(*decryptor_, Decrypt(encrypted_i_frame_buffer_, _))
|
| .WillRepeatedly(RunDecryptCB(Decryptor::kSuccess, i_frame_buffer_));
|
| @@ -440,13 +442,14 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_DecryptError) {
|
| Initialize();
|
|
|
| // Simulate decoding a single encrypted frame.
|
| - scoped_array<uint8> counter_block(GenerateCounterBlock(kIv));
|
| + std::string counter_block(GenerateCounterBlock(kIv));
|
| encrypted_i_frame_buffer_->SetDecryptConfig(scoped_ptr<DecryptConfig>(
|
| new DecryptConfig(
|
| - kKeyId, arraysize(kKeyId),
|
| - counter_block.get(), DecryptConfig::kDecryptionKeySize,
|
| - kHmac, arraysize(kHmac),
|
| - sizeof(kIv))));
|
| + std::string(reinterpret_cast<const char*>(kKeyId), arraysize(kKeyId)),
|
| + counter_block,
|
| + std::string(reinterpret_cast<const char*>(kHmac), arraysize(kHmac)),
|
| + sizeof(kIv),
|
| + std::vector<SubsampleEntry>())));
|
|
|
| EXPECT_CALL(*demuxer_, Read(_))
|
| .WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
|
| @@ -471,13 +474,14 @@ TEST_F(FFmpegVideoDecoderTest, DecodeEncryptedFrame_CorruptedBufferReturned) {
|
| Initialize();
|
|
|
| // Simulate decoding a single encrypted frame.
|
| - scoped_array<uint8> counter_block(GenerateCounterBlock(kIv));
|
| + std::string counter_block(GenerateCounterBlock(kIv));
|
| encrypted_i_frame_buffer_->SetDecryptConfig(scoped_ptr<DecryptConfig>(
|
| new DecryptConfig(
|
| - kKeyId, arraysize(kKeyId),
|
| - counter_block.get(), DecryptConfig::kDecryptionKeySize,
|
| - kHmac, arraysize(kHmac),
|
| - sizeof(kIv))));
|
| + std::string(reinterpret_cast<const char*>(kKeyId), arraysize(kKeyId)),
|
| + counter_block,
|
| + std::string(reinterpret_cast<const char*>(kHmac), arraysize(kHmac)),
|
| + sizeof(kIv),
|
| + std::vector<SubsampleEntry>())));
|
|
|
| EXPECT_CALL(*demuxer_, Read(_))
|
| .WillRepeatedly(ReturnBuffer(encrypted_i_frame_buffer_));
|
|
|