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/values.h" | 17 #include "base/values.h" |
18 #include "media/base/cdm_callback_promise.h" | 18 #include "media/base/cdm_callback_promise.h" |
19 #include "media/base/cdm_config.h" | 19 #include "media/base/cdm_config.h" |
20 #include "media/base/cdm_key_information.h" | 20 #include "media/base/cdm_key_information.h" |
21 #include "media/base/decoder_buffer.h" | 21 #include "media/base/decoder_buffer.h" |
22 #include "media/base/decrypt_config.h" | 22 #include "media/base/decrypt_config.h" |
23 #include "media/base/decryptor.h" | 23 #include "media/base/decryptor.h" |
24 #include "media/base/mock_filters.h" | 24 #include "media/base/mock_filters.h" |
25 #include "media/cdm/api/content_decryption_module.h" | 25 #include "media/cdm/api/content_decryption_module.h" |
26 #include "media/cdm/cdm_adapter.h" | 26 #include "media/cdm/cdm_adapter.h" |
27 #include "media/cdm/cdm_file_io.h" | 27 #include "media/cdm/cdm_file_io.h" |
28 #include "media/cdm/external_clear_key_test_helper.h" | 28 #include "media/cdm/external_clear_key_test_helper.h" |
29 #include "media/cdm/simple_cdm_allocator.h" | 29 #include "media/cdm/simple_cdm_allocator.h" |
30 #include "media/media_features.h" | |
31 #include "ppapi/features/features.h" | 30 #include "ppapi/features/features.h" |
32 #include "testing/gmock/include/gmock/gmock.h" | 31 #include "testing/gmock/include/gmock/gmock.h" |
33 #include "testing/gtest/include/gtest/gtest-param-test.h" | 32 #include "testing/gtest/include/gtest/gtest-param-test.h" |
34 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
35 #include "url/gurl.h" | 34 #include "url/gurl.h" |
36 | 35 |
37 using ::testing::_; | 36 using ::testing::_; |
38 using ::testing::Gt; | 37 using ::testing::Gt; |
39 using ::testing::IsNull; | 38 using ::testing::IsNull; |
40 using ::testing::NotNull; | 39 using ::testing::NotNull; |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // SystemID | 530 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // SystemID |
532 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B, | 531 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B, |
533 0x00, 0x00, 0x00, 0x02, // key count | 532 0x00, 0x00, 0x00, 0x02, // key count |
534 0x7E, 0x57, 0x1D, 0x03, 0x7E, 0x57, 0x1D, 0x03, // key1 | 533 0x7E, 0x57, 0x1D, 0x03, 0x7E, 0x57, 0x1D, 0x03, // key1 |
535 0x7E, 0x57, 0x1D, 0x03, 0x7E, 0x57, 0x1D, 0x03, | 534 0x7E, 0x57, 0x1D, 0x03, 0x7E, 0x57, 0x1D, 0x03, |
536 0x7E, 0x57, 0x1D, 0x04, 0x7E, 0x57, 0x1D, 0x04, // key2 | 535 0x7E, 0x57, 0x1D, 0x04, 0x7E, 0x57, 0x1D, 0x04, // key2 |
537 0x7E, 0x57, 0x1D, 0x04, 0x7E, 0x57, 0x1D, 0x04, | 536 0x7E, 0x57, 0x1D, 0x04, 0x7E, 0x57, 0x1D, 0x04, |
538 0x00, 0x00, 0x00, 0x00 // datasize | 537 0x00, 0x00, 0x00, 0x00 // datasize |
539 }; | 538 }; |
540 | 539 |
541 #if BUILDFLAG(USE_PROPRIETARY_CODECS) | 540 #if defined(USE_PROPRIETARY_CODECS) |
542 EXPECT_CALL(cdm_client_, OnSessionMessage(NotEmpty(), _, IsJSONDictionary())); | 541 EXPECT_CALL(cdm_client_, OnSessionMessage(NotEmpty(), _, IsJSONDictionary())); |
543 cdm_->CreateSessionAndGenerateRequest( | 542 cdm_->CreateSessionAndGenerateRequest( |
544 ContentDecryptionModule::TEMPORARY_SESSION, EmeInitDataType::CENC, | 543 ContentDecryptionModule::TEMPORARY_SESSION, EmeInitDataType::CENC, |
545 std::vector<uint8_t>(init_data, init_data + arraysize(init_data)), | 544 std::vector<uint8_t>(init_data, init_data + arraysize(init_data)), |
546 CreateSessionPromise(RESOLVED)); | 545 CreateSessionPromise(RESOLVED)); |
547 #else | 546 #else |
548 cdm_->CreateSessionAndGenerateRequest( | 547 cdm_->CreateSessionAndGenerateRequest( |
549 ContentDecryptionModule::TEMPORARY_SESSION, EmeInitDataType::CENC, | 548 ContentDecryptionModule::TEMPORARY_SESSION, EmeInitDataType::CENC, |
550 std::vector<uint8_t>(init_data, init_data + arraysize(init_data)), | 549 std::vector<uint8_t>(init_data, init_data + arraysize(init_data)), |
551 CreateSessionPromise(REJECTED)); | 550 CreateSessionPromise(REJECTED)); |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 INSTANTIATE_TEST_CASE_P(CdmAdapter, | 1012 INSTANTIATE_TEST_CASE_P(CdmAdapter, |
1014 AesDecryptorTest, | 1013 AesDecryptorTest, |
1015 testing::Values("CdmAdapter")); | 1014 testing::Values("CdmAdapter")); |
1016 #endif | 1015 #endif |
1017 | 1016 |
1018 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ | 1017 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ |
1019 // MojoDecryptorService are implemented, add a third version that tests the | 1018 // MojoDecryptorService are implemented, add a third version that tests the |
1020 // CDM via mojo. | 1019 // CDM via mojo. |
1021 | 1020 |
1022 } // namespace media | 1021 } // namespace media |
OLD | NEW |