OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |