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

Side by Side Diff: media/crypto/aes_decryptor_unittest.cc

Issue 10825194: Change Deryptor::DecryptStatus and VideoDecoder::DecoderStatus to *::Status. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/video_decoder.h ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 268
269 void AddKeyAndExpectToFail(const uint8* key_id, int key_id_size, 269 void AddKeyAndExpectToFail(const uint8* key_id, int key_id_size,
270 const uint8* key, int key_size) { 270 const uint8* key, int key_size) {
271 EXPECT_CALL(client_, KeyError(kClearKeySystem, session_id_string_, 271 EXPECT_CALL(client_, KeyError(kClearKeySystem, session_id_string_,
272 Decryptor::kUnknownError, 0)); 272 Decryptor::kUnknownError, 0));
273 decryptor_.AddKey(kClearKeySystem, key, key_size, key_id, key_id_size, 273 decryptor_.AddKey(kClearKeySystem, key, key_size, key_id, key_id_size,
274 session_id_string_); 274 session_id_string_);
275 } 275 }
276 276
277 MOCK_METHOD2(BufferDecrypted, void(Decryptor::DecryptStatus, 277 MOCK_METHOD2(BufferDecrypted, void(Decryptor::Status,
278 const scoped_refptr<DecoderBuffer>&)); 278 const scoped_refptr<DecoderBuffer>&));
279 279
280 void DecryptAndExpectToSucceed(const scoped_refptr<DecoderBuffer>& encrypted, 280 void DecryptAndExpectToSucceed(const scoped_refptr<DecoderBuffer>& encrypted,
281 const uint8* plain_text, int plain_text_size) { 281 const uint8* plain_text, int plain_text_size) {
282 scoped_refptr<DecoderBuffer> decrypted; 282 scoped_refptr<DecoderBuffer> decrypted;
283 EXPECT_CALL(*this, BufferDecrypted(AesDecryptor::kSuccess, NotNull())) 283 EXPECT_CALL(*this, BufferDecrypted(AesDecryptor::kSuccess, NotNull()))
284 .WillOnce(SaveArg<1>(&decrypted)); 284 .WillOnce(SaveArg<1>(&decrypted));
285 285
286 decryptor_.Decrypt(encrypted, decrypt_cb_); 286 decryptor_.Decrypt(encrypted, decrypt_cb_);
287 ASSERT_TRUE(decrypted); 287 ASSERT_TRUE(decrypted);
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 scoped_refptr<DecoderBuffer> encrypted_data = CreateSubsampleEncryptedBuffer( 573 scoped_refptr<DecoderBuffer> encrypted_data = CreateSubsampleEncryptedBuffer(
574 kSubsampleData, arraysize(kSubsampleData), 574 kSubsampleData, arraysize(kSubsampleData),
575 kSubsampleKeyId, arraysize(kSubsampleKeyId), 575 kSubsampleKeyId, arraysize(kSubsampleKeyId),
576 kSubsampleIv, arraysize(kSubsampleIv), 576 kSubsampleIv, arraysize(kSubsampleIv),
577 0, 577 0,
578 entries); 578 entries);
579 ASSERT_NO_FATAL_FAILURE(DecryptAndExpectToFail(encrypted_data)); 579 ASSERT_NO_FATAL_FAILURE(DecryptAndExpectToFail(encrypted_data));
580 } 580 }
581 581
582 } // namespace media 582 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_decoder.h ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698