| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 public: | 221 public: |
| 222 TestMediaClient(); | 222 TestMediaClient(); |
| 223 ~TestMediaClient() override; | 223 ~TestMediaClient() override; |
| 224 | 224 |
| 225 // MediaClient implementation. | 225 // MediaClient implementation. |
| 226 bool IsKeySystemsUpdateNeeded() final; | 226 bool IsKeySystemsUpdateNeeded() final; |
| 227 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* | 227 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* |
| 228 key_systems_properties) override; | 228 key_systems_properties) override; |
| 229 bool IsSupportedAudioConfig(const media::AudioConfig& config) final; | 229 bool IsSupportedAudioConfig(const media::AudioConfig& config) final; |
| 230 bool IsSupportedVideoConfig(const media::VideoConfig& config) final; | 230 bool IsSupportedVideoConfig(const media::VideoConfig& config) final; |
| 231 bool IsSupportedBitstreamAudioCodec(AudioCodec codec) final; |
| 231 | 232 |
| 232 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true | 233 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true |
| 233 // after AddSupportedKeySystems() is called. | 234 // after AddSupportedKeySystems() is called. |
| 234 void SetKeySystemsUpdateNeeded(); | 235 void SetKeySystemsUpdateNeeded(); |
| 235 | 236 |
| 236 // Helper function to disable "kExternal" key system support so that we can | 237 // Helper function to disable "kExternal" key system support so that we can |
| 237 // test the key system update case. | 238 // test the key system update case. |
| 238 void DisableExternalKeySystemSupport(); | 239 void DisableExternalKeySystemSupport(); |
| 239 | 240 |
| 240 private: | 241 private: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 266 } | 267 } |
| 267 | 268 |
| 268 bool TestMediaClient::IsSupportedAudioConfig(const media::AudioConfig& config) { | 269 bool TestMediaClient::IsSupportedAudioConfig(const media::AudioConfig& config) { |
| 269 return true; | 270 return true; |
| 270 } | 271 } |
| 271 | 272 |
| 272 bool TestMediaClient::IsSupportedVideoConfig(const media::VideoConfig& config) { | 273 bool TestMediaClient::IsSupportedVideoConfig(const media::VideoConfig& config) { |
| 273 return true; | 274 return true; |
| 274 } | 275 } |
| 275 | 276 |
| 277 bool TestMediaClient::IsSupportedBitstreamAudioCodec(AudioCodec codec) { |
| 278 return false; |
| 279 } |
| 280 |
| 276 void TestMediaClient::SetKeySystemsUpdateNeeded() { | 281 void TestMediaClient::SetKeySystemsUpdateNeeded() { |
| 277 is_update_needed_ = true; | 282 is_update_needed_ = true; |
| 278 } | 283 } |
| 279 | 284 |
| 280 void TestMediaClient::DisableExternalKeySystemSupport() { | 285 void TestMediaClient::DisableExternalKeySystemSupport() { |
| 281 supports_external_key_system_ = false; | 286 supports_external_key_system_ = false; |
| 282 } | 287 } |
| 283 | 288 |
| 284 class KeySystemsTest : public testing::Test { | 289 class KeySystemsTest : public testing::Test { |
| 285 protected: | 290 protected: |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 | 775 |
| 771 EXPECT_EQ(EmeConfigRule::HW_SECURE_CODECS_NOT_ALLOWED, | 776 EXPECT_EQ(EmeConfigRule::HW_SECURE_CODECS_NOT_ALLOWED, |
| 772 GetVideoContentTypeConfigRule(kVideoWebM, vp8_codec(), kExternal)); | 777 GetVideoContentTypeConfigRule(kVideoWebM, vp8_codec(), kExternal)); |
| 773 EXPECT_EQ( | 778 EXPECT_EQ( |
| 774 EmeConfigRule::SUPPORTED, | 779 EmeConfigRule::SUPPORTED, |
| 775 GetVideoContentTypeConfigRule(kVideoFoo, foovideo_codec(), kExternal)); | 780 GetVideoContentTypeConfigRule(kVideoFoo, foovideo_codec(), kExternal)); |
| 776 } | 781 } |
| 777 #endif | 782 #endif |
| 778 | 783 |
| 779 } // namespace media | 784 } // namespace media |
| OLD | NEW |