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

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

Issue 11313016: Add "type" in GenerateKeyRequest() and OnNeedKey(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the DCHECK where init_data_type_ is set but NeedKey from decoder passes empty "type". Created 8 years, 1 month 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/crypto/aes_decryptor.cc ('k') | media/filters/chunk_demuxer.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 "media/base/decoder_buffer.h" 10 #include "media/base/decoder_buffer.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 AesDecryptorTest() 233 AesDecryptorTest()
234 : decryptor_(&client_), 234 : decryptor_(&client_),
235 decrypt_cb_(base::Bind(&AesDecryptorTest::BufferDecrypted, 235 decrypt_cb_(base::Bind(&AesDecryptorTest::BufferDecrypted,
236 base::Unretained(this))), 236 base::Unretained(this))),
237 subsample_entries_(kSubsampleEntries, 237 subsample_entries_(kSubsampleEntries,
238 kSubsampleEntries + arraysize(kSubsampleEntries)) { 238 kSubsampleEntries + arraysize(kSubsampleEntries)) {
239 } 239 }
240 240
241 protected: 241 protected:
242 void GenerateKeyRequest(const uint8* key_id, int key_id_size) { 242 void GenerateKeyRequest(const uint8* key_id, int key_id_size) {
243 EXPECT_CALL(client_, KeyMessageMock(kClearKeySystem, StrNe(std::string()), 243 EXPECT_CALL(client_, KeyMessageMock(kClearKeySystem, StrNe(""),
244 NotNull(), Gt(0), "")) 244 NotNull(), Gt(0), ""))
245 .WillOnce(SaveArg<1>(&session_id_string_)); 245 .WillOnce(SaveArg<1>(&session_id_string_));
246 EXPECT_TRUE(decryptor_.GenerateKeyRequest(kClearKeySystem, 246 EXPECT_TRUE(decryptor_.GenerateKeyRequest(kClearKeySystem, "",
247 key_id, key_id_size)); 247 key_id, key_id_size));
248 } 248 }
249 249
250 void AddKeyAndExpectToSucceed(const uint8* key_id, int key_id_size, 250 void AddKeyAndExpectToSucceed(const uint8* key_id, int key_id_size,
251 const uint8* key, int key_size) { 251 const uint8* key, int key_size) {
252 EXPECT_CALL(client_, KeyAdded(kClearKeySystem, session_id_string_)); 252 EXPECT_CALL(client_, KeyAdded(kClearKeySystem, session_id_string_));
253 decryptor_.AddKey(kClearKeySystem, key, key_size, key_id, key_id_size, 253 decryptor_.AddKey(kClearKeySystem, key, key_size, key_id, key_id_size,
254 session_id_string_); 254 session_id_string_);
255 } 255 }
256 256
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 scoped_refptr<DecoderBuffer> encrypted_data = CreateSubsampleEncryptedBuffer( 582 scoped_refptr<DecoderBuffer> encrypted_data = CreateSubsampleEncryptedBuffer(
583 kSubsampleData, arraysize(kSubsampleData), 583 kSubsampleData, arraysize(kSubsampleData),
584 kSubsampleKeyId, arraysize(kSubsampleKeyId), 584 kSubsampleKeyId, arraysize(kSubsampleKeyId),
585 kSubsampleIv, arraysize(kSubsampleIv), 585 kSubsampleIv, arraysize(kSubsampleIv),
586 0, 586 0,
587 entries); 587 entries);
588 ASSERT_NO_FATAL_FAILURE(DecryptAndExpectToFail(encrypted_data)); 588 ASSERT_NO_FATAL_FAILURE(DecryptAndExpectToFail(encrypted_data));
589 } 589 }
590 590
591 } // namespace media 591 } // namespace media
OLDNEW
« no previous file with comments | « media/crypto/aes_decryptor.cc ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698