| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 static_assert((TEST_CODEC_FOO_ALL & EME_CODEC_ALL) == EME_CODEC_NONE, | 71 static_assert((TEST_CODEC_FOO_ALL & EME_CODEC_ALL) == EME_CODEC_NONE, |
| 72 "test codec masks should only use invalid codec masks"); | 72 "test codec masks should only use invalid codec masks"); |
| 73 | 73 |
| 74 // Adapt IsSupportedKeySystemWithMediaMimeType() to the new API, | 74 // Adapt IsSupportedKeySystemWithMediaMimeType() to the new API, |
| 75 // IsSupportedCodecCombination(). | 75 // IsSupportedCodecCombination(). |
| 76 static bool IsSupportedKeySystemWithMediaMimeType( | 76 static bool IsSupportedKeySystemWithMediaMimeType( |
| 77 const std::string& mime_type, | 77 const std::string& mime_type, |
| 78 const std::vector<std::string>& codecs, | 78 const std::vector<std::string>& codecs, |
| 79 const std::string& key_system) { | 79 const std::string& key_system) { |
| 80 return KeySystems::GetInstance().IsSupportedCodecCombination( | 80 return KeySystems::GetInstance()->IsSupportedCodecCombination( |
| 81 key_system, EmeMediaType::VIDEO, mime_type, codecs); | 81 key_system, EmeMediaType::VIDEO, mime_type, codecs); |
| 82 } | 82 } |
| 83 | 83 |
| 84 static bool IsSupportedKeySystemWithAudioMimeType( | 84 static bool IsSupportedKeySystemWithAudioMimeType( |
| 85 const std::string& mime_type, | 85 const std::string& mime_type, |
| 86 const std::vector<std::string>& codecs, | 86 const std::vector<std::string>& codecs, |
| 87 const std::string& key_system) { | 87 const std::string& key_system) { |
| 88 return KeySystems::GetInstance().IsSupportedCodecCombination( | 88 return KeySystems::GetInstance()->IsSupportedCodecCombination( |
| 89 key_system, EmeMediaType::AUDIO, mime_type, codecs); | 89 key_system, EmeMediaType::AUDIO, mime_type, codecs); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Adds test container and codec masks. | 92 // Adds test container and codec masks. |
| 93 // This function must be called after SetMediaClient() if a MediaClient will be | 93 // This function must be called after SetMediaClient() if a MediaClient will be |
| 94 // provided. | 94 // provided. |
| 95 // More details: AddXxxMask() will create KeySystems if it hasn't been created. | 95 // More details: AddXxxMask() will create KeySystems if it hasn't been created. |
| 96 // During KeySystems's construction GetMediaClient() will be used to add key | 96 // During KeySystems's construction GetMediaClient() will be used to add key |
| 97 // systems. In test code, the MediaClient is set by SetMediaClient(). | 97 // systems. In test code, the MediaClient is set by SetMediaClient(). |
| 98 // Therefore, SetMediaClient() must be called before this function to make sure | 98 // Therefore, SetMediaClient() must be called before this function to make sure |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); | 837 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); |
| 838 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); | 838 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); |
| 839 | 839 |
| 840 EXPECT_FALSE(IsSupportedKeySystem("x-")); | 840 EXPECT_FALSE(IsSupportedKeySystem("x-")); |
| 841 EXPECT_TRUE(IsSupportedKeySystem("x-something")); | 841 EXPECT_TRUE(IsSupportedKeySystem("x-something")); |
| 842 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); | 842 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); |
| 843 EXPECT_FALSE(IsSupportedKeySystem("x-other")); | 843 EXPECT_FALSE(IsSupportedKeySystem("x-other")); |
| 844 } | 844 } |
| 845 | 845 |
| 846 } // namespace media | 846 } // namespace media |
| OLD | NEW |