OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cdm/aes_decryptor.h" | 5 #include "media/cdm/aes_decryptor.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/debug/leak_annotations.h" | 13 #include "base/debug/leak_annotations.h" |
14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/test/scoped_task_environment.h" |
17 #include "base/values.h" | 18 #include "base/values.h" |
18 #include "media/base/cdm_callback_promise.h" | 19 #include "media/base/cdm_callback_promise.h" |
19 #include "media/base/cdm_config.h" | 20 #include "media/base/cdm_config.h" |
20 #include "media/base/cdm_key_information.h" | 21 #include "media/base/cdm_key_information.h" |
21 #include "media/base/decoder_buffer.h" | 22 #include "media/base/decoder_buffer.h" |
22 #include "media/base/decrypt_config.h" | 23 #include "media/base/decrypt_config.h" |
23 #include "media/base/decryptor.h" | 24 #include "media/base/decryptor.h" |
24 #include "media/base/mock_filters.h" | 25 #include "media/base/mock_filters.h" |
25 #include "media/cdm/api/content_decryption_module.h" | 26 #include "media/cdm/api/content_decryption_module.h" |
26 #include "media/cdm/cdm_adapter.h" | 27 #include "media/cdm/cdm_adapter.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 459 |
459 StrictMock<MockCdmClient> cdm_client_; | 460 StrictMock<MockCdmClient> cdm_client_; |
460 scoped_refptr<ContentDecryptionModule> cdm_; | 461 scoped_refptr<ContentDecryptionModule> cdm_; |
461 Decryptor* decryptor_; | 462 Decryptor* decryptor_; |
462 Decryptor::DecryptCB decrypt_cb_; | 463 Decryptor::DecryptCB decrypt_cb_; |
463 std::string session_id_; | 464 std::string session_id_; |
464 | 465 |
465 // Helper class to load/unload External Clear Key Library, if necessary. | 466 // Helper class to load/unload External Clear Key Library, if necessary. |
466 std::unique_ptr<ExternalClearKeyTestHelper> helper_; | 467 std::unique_ptr<ExternalClearKeyTestHelper> helper_; |
467 | 468 |
468 base::MessageLoop message_loop_; | 469 base::test::ScopedTaskEnvironment scoped_task_environment_; |
469 | 470 |
470 // Constants for testing. | 471 // Constants for testing. |
471 const std::vector<uint8_t> original_data_; | 472 const std::vector<uint8_t> original_data_; |
472 const std::vector<uint8_t> encrypted_data_; | 473 const std::vector<uint8_t> encrypted_data_; |
473 const std::vector<uint8_t> subsample_encrypted_data_; | 474 const std::vector<uint8_t> subsample_encrypted_data_; |
474 const std::vector<uint8_t> key_id_; | 475 const std::vector<uint8_t> key_id_; |
475 const std::vector<uint8_t> iv_; | 476 const std::vector<uint8_t> iv_; |
476 const std::vector<SubsampleEntry> normal_subsample_entries_; | 477 const std::vector<SubsampleEntry> normal_subsample_entries_; |
477 const std::vector<SubsampleEntry> no_subsample_entries_; | 478 const std::vector<SubsampleEntry> no_subsample_entries_; |
478 }; | 479 }; |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 INSTANTIATE_TEST_CASE_P(CdmAdapter, | 1024 INSTANTIATE_TEST_CASE_P(CdmAdapter, |
1024 AesDecryptorTest, | 1025 AesDecryptorTest, |
1025 testing::Values("CdmAdapter")); | 1026 testing::Values("CdmAdapter")); |
1026 #endif | 1027 #endif |
1027 | 1028 |
1028 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ | 1029 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ |
1029 // MojoDecryptorService are implemented, add a third version that tests the | 1030 // MojoDecryptorService are implemented, add a third version that tests the |
1030 // CDM via mojo. | 1031 // CDM via mojo. |
1031 | 1032 |
1032 } // namespace media | 1033 } // namespace media |
OLD | NEW |