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 // TODO(sandersd): Refactor to remove recomputed codec arrays, and generally | 5 // TODO(sandersd): Refactor to remove recomputed codec arrays, and generally |
6 // shorten and improve coverage. | 6 // shorten and improve coverage. |
7 // - http://crbug.com/417444 | 7 // - http://crbug.com/417444 |
8 // - http://crbug.com/457438 | 8 // - http://crbug.com/457438 |
9 // TODO(sandersd): Add tests to cover codec vectors with empty items. | 9 // TODO(sandersd): Add tests to cover codec vectors with empty items. |
10 // http://crbug.com/417461 | 10 // http://crbug.com/417461 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 TestMediaClient(); | 173 TestMediaClient(); |
174 ~TestMediaClient() override; | 174 ~TestMediaClient() override; |
175 | 175 |
176 // MediaClient implementation. | 176 // MediaClient implementation. |
177 void AddKeySystemsInfoForUMA( | 177 void AddKeySystemsInfoForUMA( |
178 std::vector<KeySystemInfoForUMA>* key_systems_info_for_uma) final; | 178 std::vector<KeySystemInfoForUMA>* key_systems_info_for_uma) final; |
179 bool IsKeySystemsUpdateNeeded() final; | 179 bool IsKeySystemsUpdateNeeded() final; |
180 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* | 180 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* |
181 key_systems_properties) override; | 181 key_systems_properties) override; |
182 void RecordRapporURL(const std::string& metric, const GURL& url) final; | 182 void RecordRapporURL(const std::string& metric, const GURL& url) final; |
183 bool IsSupportedVideoConfig(media::VideoCodec codec, | 183 bool IsSupportedVideoConfig(const media::VideoConfig& config) final; |
184 media::VideoCodecProfile profile, | |
185 int level) final; | |
186 | 184 |
187 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true | 185 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true |
188 // after AddSupportedKeySystems() is called. | 186 // after AddSupportedKeySystems() is called. |
189 void SetKeySystemsUpdateNeeded(); | 187 void SetKeySystemsUpdateNeeded(); |
190 | 188 |
191 // Helper function to disable "kExternal" key system support so that we can | 189 // Helper function to disable "kExternal" key system support so that we can |
192 // test the key system update case. | 190 // test the key system update case. |
193 void DisableExternalKeySystemSupport(); | 191 void DisableExternalKeySystemSupport(); |
194 | 192 |
195 private: | 193 private: |
(...skipping 30 matching lines...) Expand all Loading... |
226 key_systems->emplace_back(new ExternalKeySystemProperties()); | 224 key_systems->emplace_back(new ExternalKeySystemProperties()); |
227 | 225 |
228 is_update_needed_ = false; | 226 is_update_needed_ = false; |
229 } | 227 } |
230 | 228 |
231 void TestMediaClient::RecordRapporURL(const std::string& /* metric */, | 229 void TestMediaClient::RecordRapporURL(const std::string& /* metric */, |
232 const GURL& /* url */) { | 230 const GURL& /* url */) { |
233 NOTIMPLEMENTED(); | 231 NOTIMPLEMENTED(); |
234 } | 232 } |
235 | 233 |
236 bool TestMediaClient::IsSupportedVideoConfig(media::VideoCodec codec, | 234 bool TestMediaClient::IsSupportedVideoConfig(const media::VideoConfig& config) { |
237 media::VideoCodecProfile profile, | |
238 int level) { | |
239 return true; | 235 return true; |
240 } | 236 } |
241 | 237 |
242 void TestMediaClient::SetKeySystemsUpdateNeeded() { | 238 void TestMediaClient::SetKeySystemsUpdateNeeded() { |
243 is_update_needed_ = true; | 239 is_update_needed_ = true; |
244 } | 240 } |
245 | 241 |
246 void TestMediaClient::DisableExternalKeySystemSupport() { | 242 void TestMediaClient::DisableExternalKeySystemSupport() { |
247 supports_external_key_system_ = false; | 243 supports_external_key_system_ = false; |
248 } | 244 } |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); | 769 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); |
774 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); | 770 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); |
775 | 771 |
776 EXPECT_FALSE(IsSupportedKeySystem("x-")); | 772 EXPECT_FALSE(IsSupportedKeySystem("x-")); |
777 EXPECT_TRUE(IsSupportedKeySystem("x-something")); | 773 EXPECT_TRUE(IsSupportedKeySystem("x-something")); |
778 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); | 774 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); |
779 EXPECT_FALSE(IsSupportedKeySystem("x-other")); | 775 EXPECT_FALSE(IsSupportedKeySystem("x-other")); |
780 } | 776 } |
781 | 777 |
782 } // namespace media | 778 } // namespace media |
OLD | NEW |