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

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

Issue 15772012: Separate MediaKeys interface from Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 7 years, 7 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
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 "media/base/decoder_buffer.h" 10 #include "media/base/decoder_buffer.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 EXPECT_NE(0, memcmp(plain_text, decrypted->GetData(), plain_text_size)); 307 EXPECT_NE(0, memcmp(plain_text, decrypted->GetData(), plain_text_size));
308 } 308 }
309 309
310 void DecryptAndExpectToFail(const scoped_refptr<DecoderBuffer>& encrypted) { 310 void DecryptAndExpectToFail(const scoped_refptr<DecoderBuffer>& encrypted) {
311 EXPECT_CALL(*this, BufferDecrypted(AesDecryptor::kError, IsNull())); 311 EXPECT_CALL(*this, BufferDecrypted(AesDecryptor::kError, IsNull()));
312 decryptor_.Decrypt(Decryptor::kVideo, encrypted, decrypt_cb_); 312 decryptor_.Decrypt(Decryptor::kVideo, encrypted, decrypt_cb_);
313 } 313 }
314 314
315 MOCK_METHOD2(KeyAdded, void(const std::string&, const std::string&)); 315 MOCK_METHOD2(KeyAdded, void(const std::string&, const std::string&));
316 MOCK_METHOD4(KeyError, void(const std::string&, const std::string&, 316 MOCK_METHOD4(KeyError, void(const std::string&, const std::string&,
317 Decryptor::KeyError, int)); 317 MediaKeys::KeyError, int));
318 MOCK_METHOD4(KeyMessage, void(const std::string& key_system, 318 MOCK_METHOD4(KeyMessage, void(const std::string& key_system,
319 const std::string& session_id, 319 const std::string& session_id,
320 const std::string& message, 320 const std::string& message,
321 const std::string& default_url)); 321 const std::string& default_url));
322 322
323 AesDecryptor decryptor_; 323 AesDecryptor decryptor_;
324 std::string session_id_string_; 324 std::string session_id_string_;
325 AesDecryptor::DecryptCB decrypt_cb_; 325 AesDecryptor::DecryptCB decrypt_cb_;
326 std::vector<SubsampleEntry> subsample_entries_; 326 std::vector<SubsampleEntry> subsample_entries_;
327 }; 327 };
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 scoped_refptr<DecoderBuffer> encrypted_data = CreateSubsampleEncryptedBuffer( 599 scoped_refptr<DecoderBuffer> encrypted_data = CreateSubsampleEncryptedBuffer(
600 kSubsampleData, arraysize(kSubsampleData), 600 kSubsampleData, arraysize(kSubsampleData),
601 kSubsampleKeyId, arraysize(kSubsampleKeyId), 601 kSubsampleKeyId, arraysize(kSubsampleKeyId),
602 kSubsampleIv, arraysize(kSubsampleIv), 602 kSubsampleIv, arraysize(kSubsampleIv),
603 0, 603 0,
604 entries); 604 entries);
605 ASSERT_NO_FATAL_FAILURE(DecryptAndExpectToFail(encrypted_data)); 605 ASSERT_NO_FATAL_FAILURE(DecryptAndExpectToFail(encrypted_data));
606 } 606 }
607 607
608 } // namespace media 608 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698