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> |
(...skipping 28 matching lines...) Expand all Loading... |
39 using ::testing::NotNull; | 39 using ::testing::NotNull; |
40 using ::testing::SaveArg; | 40 using ::testing::SaveArg; |
41 using ::testing::StrNe; | 41 using ::testing::StrNe; |
42 using ::testing::Unused; | 42 using ::testing::Unused; |
43 | 43 |
44 MATCHER(IsEmpty, "") { return arg.empty(); } | 44 MATCHER(IsEmpty, "") { return arg.empty(); } |
45 MATCHER(IsNotEmpty, "") { return !arg.empty(); } | 45 MATCHER(IsNotEmpty, "") { return !arg.empty(); } |
46 MATCHER(IsJSONDictionary, "") { | 46 MATCHER(IsJSONDictionary, "") { |
47 std::string result(arg.begin(), arg.end()); | 47 std::string result(arg.begin(), arg.end()); |
48 std::unique_ptr<base::Value> root(base::JSONReader().ReadToValue(result)); | 48 std::unique_ptr<base::Value> root(base::JSONReader().ReadToValue(result)); |
49 return (root.get() && root->GetType() == base::Value::TYPE_DICTIONARY); | 49 return (root.get() && root->GetType() == base::Value::Type::DICTIONARY); |
50 } | 50 } |
51 | 51 |
52 namespace media { | 52 namespace media { |
53 | 53 |
54 const uint8_t kOriginalData[] = "Original subsample data."; | 54 const uint8_t kOriginalData[] = "Original subsample data."; |
55 const int kOriginalDataSize = 24; | 55 const int kOriginalDataSize = 24; |
56 | 56 |
57 // In the examples below, 'k'(key) has to be 16 bytes, and will always require | 57 // In the examples below, 'k'(key) has to be 16 bytes, and will always require |
58 // 2 bytes of padding. 'kid'(keyid) is variable length, and may require 0, 1, | 58 // 2 bytes of padding. 'kid'(keyid) is variable length, and may require 0, 1, |
59 // or 2 bytes of padding. | 59 // or 2 bytes of padding. |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 INSTANTIATE_TEST_CASE_P(CdmAdapter, | 1025 INSTANTIATE_TEST_CASE_P(CdmAdapter, |
1026 AesDecryptorTest, | 1026 AesDecryptorTest, |
1027 testing::Values("CdmAdapter")); | 1027 testing::Values("CdmAdapter")); |
1028 #endif | 1028 #endif |
1029 | 1029 |
1030 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ | 1030 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ |
1031 // MojoDecryptorService are implemented, add a third version that tests the | 1031 // MojoDecryptorService are implemented, add a third version that tests the |
1032 // CDM via mojo. | 1032 // CDM via mojo. |
1033 | 1033 |
1034 } // namespace media | 1034 } // namespace media |
OLD | NEW |