| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 TestMediaClient(); | 172 TestMediaClient(); |
| 173 ~TestMediaClient() override; | 173 ~TestMediaClient() override; |
| 174 | 174 |
| 175 // MediaClient implementation. | 175 // MediaClient implementation. |
| 176 void AddKeySystemsInfoForUMA( | 176 void AddKeySystemsInfoForUMA( |
| 177 std::vector<KeySystemInfoForUMA>* key_systems_info_for_uma) final; | 177 std::vector<KeySystemInfoForUMA>* key_systems_info_for_uma) final; |
| 178 bool IsKeySystemsUpdateNeeded() final; | 178 bool IsKeySystemsUpdateNeeded() final; |
| 179 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* | 179 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* |
| 180 key_systems_properties) override; | 180 key_systems_properties) override; |
| 181 void RecordRapporURL(const std::string& metric, const GURL& url) final; | 181 void RecordRapporURL(const std::string& metric, const GURL& url) final; |
| 182 bool IsSupportedVideoConfig(media::VideoCodec codec, |
| 183 media::VideoCodecProfile profile, |
| 184 int level) final; |
| 182 | 185 |
| 183 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true | 186 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true |
| 184 // after AddSupportedKeySystems() is called. | 187 // after AddSupportedKeySystems() is called. |
| 185 void SetKeySystemsUpdateNeeded(); | 188 void SetKeySystemsUpdateNeeded(); |
| 186 | 189 |
| 187 // Helper function to disable "kExternal" key system support so that we can | 190 // Helper function to disable "kExternal" key system support so that we can |
| 188 // test the key system update case. | 191 // test the key system update case. |
| 189 void DisableExternalKeySystemSupport(); | 192 void DisableExternalKeySystemSupport(); |
| 190 | 193 |
| 191 private: | 194 private: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 222 key_systems->emplace_back(new ExternalKeySystemProperties()); | 225 key_systems->emplace_back(new ExternalKeySystemProperties()); |
| 223 | 226 |
| 224 is_update_needed_ = false; | 227 is_update_needed_ = false; |
| 225 } | 228 } |
| 226 | 229 |
| 227 void TestMediaClient::RecordRapporURL(const std::string& /* metric */, | 230 void TestMediaClient::RecordRapporURL(const std::string& /* metric */, |
| 228 const GURL& /* url */) { | 231 const GURL& /* url */) { |
| 229 NOTIMPLEMENTED(); | 232 NOTIMPLEMENTED(); |
| 230 } | 233 } |
| 231 | 234 |
| 235 bool TestMediaClient::IsSupportedVideoConfig(media::VideoCodec codec, |
| 236 media::VideoCodecProfile profile, |
| 237 int level) { |
| 238 return true; |
| 239 } |
| 240 |
| 232 void TestMediaClient::SetKeySystemsUpdateNeeded() { | 241 void TestMediaClient::SetKeySystemsUpdateNeeded() { |
| 233 is_update_needed_ = true; | 242 is_update_needed_ = true; |
| 234 } | 243 } |
| 235 | 244 |
| 236 void TestMediaClient::DisableExternalKeySystemSupport() { | 245 void TestMediaClient::DisableExternalKeySystemSupport() { |
| 237 supports_external_key_system_ = false; | 246 supports_external_key_system_ = false; |
| 238 } | 247 } |
| 239 | 248 |
| 240 class PotentiallySupportedNamesTestMediaClient : public TestMediaClient { | 249 class PotentiallySupportedNamesTestMediaClient : public TestMediaClient { |
| 241 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* | 250 void AddSupportedKeySystems(std::vector<std::unique_ptr<KeySystemProperties>>* |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); | 772 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); |
| 764 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); | 773 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); |
| 765 | 774 |
| 766 EXPECT_FALSE(IsSupportedKeySystem("x-")); | 775 EXPECT_FALSE(IsSupportedKeySystem("x-")); |
| 767 EXPECT_TRUE(IsSupportedKeySystem("x-something")); | 776 EXPECT_TRUE(IsSupportedKeySystem("x-something")); |
| 768 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); | 777 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); |
| 769 EXPECT_FALSE(IsSupportedKeySystem("x-other")); | 778 EXPECT_FALSE(IsSupportedKeySystem("x-other")); |
| 770 } | 779 } |
| 771 | 780 |
| 772 } // namespace media | 781 } // namespace media |
| OLD | NEW |