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

Side by Side Diff: media/filters/pipeline_integration_test.cc

Issue 10896014: Add a bool return value to media::Decryptor::GenerateKeyRequest(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve comments. Created 8 years, 3 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/crypto/aes_decryptor_unittest.cc ('k') | webkit/media/crypto/ppapi_decryptor.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 "media/filters/pipeline_integration_test_base.h" 5 #include "media/filters/pipeline_integration_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "media/base/decoder_buffer.h" 9 #include "media/base/decoder_buffer.h"
10 #include "media/base/decryptor_client.h" 10 #include "media/base/decryptor_client.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 scoped_array<uint8> init_data, 173 scoped_array<uint8> init_data,
174 int init_data_length) { 174 int init_data_length) {
175 current_key_system_ = key_system; 175 current_key_system_ = key_system;
176 current_session_id_ = session_id; 176 current_session_id_ = session_id;
177 177
178 // When NeedKey is called from the demuxer, the |key_system| will be empty. 178 // When NeedKey is called from the demuxer, the |key_system| will be empty.
179 // In this case, we need to call GenerateKeyRequest() to initialize a 179 // In this case, we need to call GenerateKeyRequest() to initialize a
180 // session (which will call KeyMessage). 180 // session (which will call KeyMessage).
181 if (current_key_system_.empty()) { 181 if (current_key_system_.empty()) {
182 DCHECK(current_session_id_.empty()); 182 DCHECK(current_session_id_.empty());
183 decryptor_.GenerateKeyRequest(kClearKeySystem, 183 EXPECT_TRUE(decryptor_.GenerateKeyRequest(
184 kInitData, arraysize(kInitData)); 184 kClearKeySystem, kInitData, arraysize(kInitData)));
185 } 185 }
186 186
187 EXPECT_FALSE(current_key_system_.empty()); 187 EXPECT_FALSE(current_key_system_.empty());
188 EXPECT_FALSE(current_session_id_.empty()); 188 EXPECT_FALSE(current_session_id_.empty());
189 decryptor_.AddKey(current_key_system_, kSecretKey, arraysize(kSecretKey), 189 decryptor_.AddKey(current_key_system_, kSecretKey, arraysize(kSecretKey),
190 init_data.get(), init_data_length, current_session_id_); 190 init_data.get(), init_data_length, current_session_id_);
191 } 191 }
192 192
193 private: 193 private:
194 AesDecryptor decryptor_; 194 AesDecryptor decryptor_;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // Verify video decoder & renderer can handle aborted demuxer reads. 430 // Verify video decoder & renderer can handle aborted demuxer reads.
431 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { 431 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) {
432 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", kVideoOnlyWebM, 432 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", kVideoOnlyWebM,
433 32768, 433 32768,
434 base::TimeDelta::FromMilliseconds(200), 434 base::TimeDelta::FromMilliseconds(200),
435 base::TimeDelta::FromMilliseconds(1668), 435 base::TimeDelta::FromMilliseconds(1668),
436 0x1C896, 65536)); 436 0x1C896, 65536));
437 } 437 }
438 438
439 } // namespace media 439 } // namespace media
OLDNEW
« no previous file with comments | « media/crypto/aes_decryptor_unittest.cc ('k') | webkit/media/crypto/ppapi_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698