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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "media/base/eme_constants.h" | 9 #include "media/base/eme_constants.h" |
10 #include "media/base/key_system_info.h" | 10 #include "media/base/key_system_info.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void TestMediaClient::SetKeySystemsUpdateNeeded() { | 153 void TestMediaClient::SetKeySystemsUpdateNeeded() { |
154 is_update_needed_ = true; | 154 is_update_needed_ = true; |
155 } | 155 } |
156 | 156 |
157 void TestMediaClient::DisableExternalKeySystemSupport() { | 157 void TestMediaClient::DisableExternalKeySystemSupport() { |
158 supports_external_key_system_ = false; | 158 supports_external_key_system_ = false; |
159 } | 159 } |
160 | 160 |
161 void TestMediaClient::AddUsesAesKeySystem( | 161 void TestMediaClient::AddUsesAesKeySystem( |
162 std::vector<KeySystemInfo>* key_systems) { | 162 std::vector<KeySystemInfo>* key_systems) { |
163 KeySystemInfo aes(kUsesAes); | 163 KeySystemInfo aes; |
| 164 aes.key_system = kUsesAes; |
164 aes.supported_codecs = EME_CODEC_WEBM_ALL; | 165 aes.supported_codecs = EME_CODEC_WEBM_ALL; |
165 aes.supported_codecs |= TEST_CODEC_FOO_ALL; | 166 aes.supported_codecs |= TEST_CODEC_FOO_ALL; |
166 aes.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; | 167 aes.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; |
| 168 aes.persistent_license_support = EME_SESSION_TYPE_NOT_SUPPORTED; |
| 169 aes.persistent_release_message_support = EME_SESSION_TYPE_NOT_SUPPORTED; |
| 170 aes.persistent_state_support = EME_FEATURE_NOT_SUPPORTED; |
| 171 aes.distinctive_identifier_support = EME_FEATURE_NOT_SUPPORTED; |
167 aes.use_aes_decryptor = true; | 172 aes.use_aes_decryptor = true; |
168 key_systems->push_back(aes); | 173 key_systems->push_back(aes); |
169 } | 174 } |
170 | 175 |
171 void TestMediaClient::AddExternalKeySystem( | 176 void TestMediaClient::AddExternalKeySystem( |
172 std::vector<KeySystemInfo>* key_systems) { | 177 std::vector<KeySystemInfo>* key_systems) { |
173 KeySystemInfo ext(kExternal); | 178 KeySystemInfo ext; |
| 179 ext.key_system = kExternal; |
174 ext.supported_codecs = EME_CODEC_WEBM_ALL; | 180 ext.supported_codecs = EME_CODEC_WEBM_ALL; |
175 ext.supported_codecs |= TEST_CODEC_FOO_ALL; | 181 ext.supported_codecs |= TEST_CODEC_FOO_ALL; |
176 ext.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; | 182 ext.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; |
| 183 ext.persistent_license_support = EME_SESSION_TYPE_SUPPORTED; |
| 184 ext.persistent_release_message_support = EME_SESSION_TYPE_NOT_SUPPORTED; |
| 185 ext.persistent_state_support = EME_FEATURE_ALWAYS_ENABLED; |
| 186 ext.distinctive_identifier_support = EME_FEATURE_ALWAYS_ENABLED; |
177 ext.parent_key_system = kExternalParent; | 187 ext.parent_key_system = kExternalParent; |
178 #if defined(ENABLE_PEPPER_CDMS) | 188 #if defined(ENABLE_PEPPER_CDMS) |
179 ext.pepper_type = "application/x-ppapi-external-cdm"; | 189 ext.pepper_type = "application/x-ppapi-external-cdm"; |
180 #endif // defined(ENABLE_PEPPER_CDMS) | 190 #endif // defined(ENABLE_PEPPER_CDMS) |
181 key_systems->push_back(ext); | 191 key_systems->push_back(ext); |
182 } | 192 } |
183 | 193 |
184 // TODO(sandersd): Refactor. http://crbug.com/417444 | 194 // TODO(sandersd): Refactor. http://crbug.com/417444 |
185 class KeySystemsTest : public testing::Test { | 195 class KeySystemsTest : public testing::Test { |
186 protected: | 196 protected: |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 | 782 |
773 EXPECT_TRUE(IsSupportedKeySystem(kUsesAes)); | 783 EXPECT_TRUE(IsSupportedKeySystem(kUsesAes)); |
774 EXPECT_TRUE(PrefixedIsSupportedKeySystemWithMediaMimeType( | 784 EXPECT_TRUE(PrefixedIsSupportedKeySystemWithMediaMimeType( |
775 kVideoWebM, no_codecs(), kUsesAes)); | 785 kVideoWebM, no_codecs(), kUsesAes)); |
776 EXPECT_FALSE(IsSupportedKeySystem(kExternal)); | 786 EXPECT_FALSE(IsSupportedKeySystem(kExternal)); |
777 EXPECT_FALSE(PrefixedIsSupportedKeySystemWithMediaMimeType( | 787 EXPECT_FALSE(PrefixedIsSupportedKeySystemWithMediaMimeType( |
778 kVideoWebM, no_codecs(), kExternal)); | 788 kVideoWebM, no_codecs(), kExternal)); |
779 } | 789 } |
780 | 790 |
781 } // namespace media | 791 } // namespace media |
OLD | NEW |