| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(media::VideoCodec codec, |
| 184 media::VideoCodecProfile profile, | 184 media::VideoCodecProfile profile, |
| 185 int level) final; | 185 int level) final; |
| 186 bool IsSupportedPassthroughAudio(media::AudioCodec codec) final; |
| 186 | 187 |
| 187 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true | 188 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true |
| 188 // after AddSupportedKeySystems() is called. | 189 // after AddSupportedKeySystems() is called. |
| 189 void SetKeySystemsUpdateNeeded(); | 190 void SetKeySystemsUpdateNeeded(); |
| 190 | 191 |
| 191 // Helper function to disable "kExternal" key system support so that we can | 192 // Helper function to disable "kExternal" key system support so that we can |
| 192 // test the key system update case. | 193 // test the key system update case. |
| 193 void DisableExternalKeySystemSupport(); | 194 void DisableExternalKeySystemSupport(); |
| 194 | 195 |
| 195 private: | 196 private: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 const GURL& /* url */) { | 233 const GURL& /* url */) { |
| 233 NOTIMPLEMENTED(); | 234 NOTIMPLEMENTED(); |
| 234 } | 235 } |
| 235 | 236 |
| 236 bool TestMediaClient::IsSupportedVideoConfig(media::VideoCodec codec, | 237 bool TestMediaClient::IsSupportedVideoConfig(media::VideoCodec codec, |
| 237 media::VideoCodecProfile profile, | 238 media::VideoCodecProfile profile, |
| 238 int level) { | 239 int level) { |
| 239 return true; | 240 return true; |
| 240 } | 241 } |
| 241 | 242 |
| 243 bool TestMediaClient::IsSupportedPassthroughAudio(media::AudioCodec codec) { |
| 244 return false; |
| 245 } |
| 246 |
| 242 void TestMediaClient::SetKeySystemsUpdateNeeded() { | 247 void TestMediaClient::SetKeySystemsUpdateNeeded() { |
| 243 is_update_needed_ = true; | 248 is_update_needed_ = true; |
| 244 } | 249 } |
| 245 | 250 |
| 246 void TestMediaClient::DisableExternalKeySystemSupport() { | 251 void TestMediaClient::DisableExternalKeySystemSupport() { |
| 247 supports_external_key_system_ = false; | 252 supports_external_key_system_ = false; |
| 248 } | 253 } |
| 249 | 254 |
| 250 class PotentiallySupportedNamesTestMediaClient : public TestMediaClient { | 255 class PotentiallySupportedNamesTestMediaClient : public TestMediaClient { |
| 251 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* | 256 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); | 778 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); |
| 774 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); | 779 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); |
| 775 | 780 |
| 776 EXPECT_FALSE(IsSupportedKeySystem("x-")); | 781 EXPECT_FALSE(IsSupportedKeySystem("x-")); |
| 777 EXPECT_TRUE(IsSupportedKeySystem("x-something")); | 782 EXPECT_TRUE(IsSupportedKeySystem("x-something")); |
| 778 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); | 783 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); |
| 779 EXPECT_FALSE(IsSupportedKeySystem("x-other")); | 784 EXPECT_FALSE(IsSupportedKeySystem("x-other")); |
| 780 } | 785 } |
| 781 | 786 |
| 782 } // namespace media | 787 } // namespace media |
| OLD | NEW |