Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: media/base/key_systems_unittest.cc

Issue 1005903003: Implement robustness strings in requestMediaKeySystemAccess(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ConvertRobustness() into KeySystems. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 160
161 void TestMediaClient::AddUsesAesKeySystem( 161 void TestMediaClient::AddUsesAesKeySystem(
162 const std::string& name, 162 const std::string& name,
163 std::vector<KeySystemInfo>* key_systems) { 163 std::vector<KeySystemInfo>* key_systems) {
164 KeySystemInfo system; 164 KeySystemInfo system;
165 system.key_system = name; 165 system.key_system = name;
166 system.supported_codecs = EME_CODEC_WEBM_ALL; 166 system.supported_codecs = EME_CODEC_WEBM_ALL;
167 system.supported_codecs |= TEST_CODEC_FOO_ALL; 167 system.supported_codecs |= TEST_CODEC_FOO_ALL;
168 system.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; 168 system.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM;
169 system.max_audio_robustness = EmeRobustness::EMPTY;
170 system.max_video_robustness = EmeRobustness::EMPTY;
169 system.persistent_license_support = EME_SESSION_TYPE_NOT_SUPPORTED; 171 system.persistent_license_support = EME_SESSION_TYPE_NOT_SUPPORTED;
170 system.persistent_release_message_support = EME_SESSION_TYPE_NOT_SUPPORTED; 172 system.persistent_release_message_support = EME_SESSION_TYPE_NOT_SUPPORTED;
171 system.persistent_state_support = EME_FEATURE_NOT_SUPPORTED; 173 system.persistent_state_support = EME_FEATURE_NOT_SUPPORTED;
172 system.distinctive_identifier_support = EME_FEATURE_NOT_SUPPORTED; 174 system.distinctive_identifier_support = EME_FEATURE_NOT_SUPPORTED;
173 system.use_aes_decryptor = true; 175 system.use_aes_decryptor = true;
174 key_systems->push_back(system); 176 key_systems->push_back(system);
175 } 177 }
176 178
177 void TestMediaClient::AddExternalKeySystem( 179 void TestMediaClient::AddExternalKeySystem(
178 std::vector<KeySystemInfo>* key_systems) { 180 std::vector<KeySystemInfo>* key_systems) {
179 KeySystemInfo ext; 181 KeySystemInfo ext;
180 ext.key_system = kExternal; 182 ext.key_system = kExternal;
181 ext.supported_codecs = EME_CODEC_WEBM_ALL; 183 ext.supported_codecs = EME_CODEC_WEBM_ALL;
182 ext.supported_codecs |= TEST_CODEC_FOO_ALL; 184 ext.supported_codecs |= TEST_CODEC_FOO_ALL;
183 ext.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; 185 ext.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM;
186 ext.max_audio_robustness = EmeRobustness::EMPTY;
187 ext.max_video_robustness = EmeRobustness::EMPTY;
184 ext.persistent_license_support = EME_SESSION_TYPE_SUPPORTED; 188 ext.persistent_license_support = EME_SESSION_TYPE_SUPPORTED;
185 ext.persistent_release_message_support = EME_SESSION_TYPE_NOT_SUPPORTED; 189 ext.persistent_release_message_support = EME_SESSION_TYPE_NOT_SUPPORTED;
186 ext.persistent_state_support = EME_FEATURE_ALWAYS_ENABLED; 190 ext.persistent_state_support = EME_FEATURE_ALWAYS_ENABLED;
187 ext.distinctive_identifier_support = EME_FEATURE_ALWAYS_ENABLED; 191 ext.distinctive_identifier_support = EME_FEATURE_ALWAYS_ENABLED;
188 ext.parent_key_system = kExternalParent; 192 ext.parent_key_system = kExternalParent;
189 #if defined(ENABLE_PEPPER_CDMS) 193 #if defined(ENABLE_PEPPER_CDMS)
190 ext.pepper_type = "application/x-ppapi-external-cdm"; 194 ext.pepper_type = "application/x-ppapi-external-cdm";
191 #endif // defined(ENABLE_PEPPER_CDMS) 195 #endif // defined(ENABLE_PEPPER_CDMS)
192 key_systems->push_back(ext); 196 key_systems->push_back(ext);
193 } 197 }
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); 860 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else"));
857 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); 861 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other"));
858 862
859 EXPECT_FALSE(IsSupportedKeySystem("x-")); 863 EXPECT_FALSE(IsSupportedKeySystem("x-"));
860 EXPECT_TRUE(IsSupportedKeySystem("x-something")); 864 EXPECT_TRUE(IsSupportedKeySystem("x-something"));
861 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); 865 EXPECT_FALSE(IsSupportedKeySystem("x-something.else"));
862 EXPECT_FALSE(IsSupportedKeySystem("x-other")); 866 EXPECT_FALSE(IsSupportedKeySystem("x-other"));
863 } 867 }
864 868
865 } // namespace media 869 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698