| 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 IsSupportedAudioConfig(const media::AudioConfig& config) final; |
| 183 bool IsSupportedVideoConfig(const media::VideoConfig& config) final; | 184 bool IsSupportedVideoConfig(const media::VideoConfig& config) final; |
| 184 | 185 |
| 185 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true | 186 // Helper function to test the case where IsKeySystemsUpdateNeeded() is true |
| 186 // after AddSupportedKeySystems() is called. | 187 // after AddSupportedKeySystems() is called. |
| 187 void SetKeySystemsUpdateNeeded(); | 188 void SetKeySystemsUpdateNeeded(); |
| 188 | 189 |
| 189 // 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 |
| 190 // test the key system update case. | 191 // test the key system update case. |
| 191 void DisableExternalKeySystemSupport(); | 192 void DisableExternalKeySystemSupport(); |
| 192 | 193 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 key_systems->emplace_back(new ExternalKeySystemProperties()); | 225 key_systems->emplace_back(new ExternalKeySystemProperties()); |
| 225 | 226 |
| 226 is_update_needed_ = false; | 227 is_update_needed_ = false; |
| 227 } | 228 } |
| 228 | 229 |
| 229 void TestMediaClient::RecordRapporURL(const std::string& /* metric */, | 230 void TestMediaClient::RecordRapporURL(const std::string& /* metric */, |
| 230 const GURL& /* url */) { | 231 const GURL& /* url */) { |
| 231 NOTIMPLEMENTED(); | 232 NOTIMPLEMENTED(); |
| 232 } | 233 } |
| 233 | 234 |
| 235 bool TestMediaClient::IsSupportedAudioConfig(const media::AudioConfig& config) { |
| 236 return true; |
| 237 } |
| 238 |
| 234 bool TestMediaClient::IsSupportedVideoConfig(const media::VideoConfig& config) { | 239 bool TestMediaClient::IsSupportedVideoConfig(const media::VideoConfig& config) { |
| 235 return true; | 240 return true; |
| 236 } | 241 } |
| 237 | 242 |
| 238 void TestMediaClient::SetKeySystemsUpdateNeeded() { | 243 void TestMediaClient::SetKeySystemsUpdateNeeded() { |
| 239 is_update_needed_ = true; | 244 is_update_needed_ = true; |
| 240 } | 245 } |
| 241 | 246 |
| 242 void TestMediaClient::DisableExternalKeySystemSupport() { | 247 void TestMediaClient::DisableExternalKeySystemSupport() { |
| 243 supports_external_key_system_ = false; | 248 supports_external_key_system_ = false; |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); | 774 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); |
| 770 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); | 775 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); |
| 771 | 776 |
| 772 EXPECT_FALSE(IsSupportedKeySystem("x-")); | 777 EXPECT_FALSE(IsSupportedKeySystem("x-")); |
| 773 EXPECT_TRUE(IsSupportedKeySystem("x-something")); | 778 EXPECT_TRUE(IsSupportedKeySystem("x-something")); |
| 774 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); | 779 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); |
| 775 EXPECT_FALSE(IsSupportedKeySystem("x-other")); | 780 EXPECT_FALSE(IsSupportedKeySystem("x-other")); |
| 776 } | 781 } |
| 777 | 782 |
| 778 } // namespace media | 783 } // namespace media |
| OLD | NEW |