| 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 21 matching lines...) Expand all Loading... |
| 32 const char kClearKey[] = "org.w3.clearkey"; | 32 const char kClearKey[] = "org.w3.clearkey"; |
| 33 const char kExternalClearKey[] = "org.chromium.externalclearkey"; | 33 const char kExternalClearKey[] = "org.chromium.externalclearkey"; |
| 34 | 34 |
| 35 const char kAudioWebM[] = "audio/webm"; | 35 const char kAudioWebM[] = "audio/webm"; |
| 36 const char kVideoWebM[] = "video/webm"; | 36 const char kVideoWebM[] = "video/webm"; |
| 37 const char kAudioFoo[] = "audio/foo"; | 37 const char kAudioFoo[] = "audio/foo"; |
| 38 const char kVideoFoo[] = "video/foo"; | 38 const char kVideoFoo[] = "video/foo"; |
| 39 | 39 |
| 40 // Pick some arbitrary bit fields as long as they are not in conflict with the | 40 // Pick some arbitrary bit fields as long as they are not in conflict with the |
| 41 // real ones. | 41 // real ones. |
| 42 enum TestCodec { | 42 enum TestCodec : uint32_t { |
| 43 TEST_CODEC_FOO_AUDIO = 1 << 10, // An audio codec for foo container. | 43 TEST_CODEC_FOO_AUDIO = 1 << 29, // An audio codec for foo container. |
| 44 TEST_CODEC_FOO_AUDIO_ALL = TEST_CODEC_FOO_AUDIO, | 44 TEST_CODEC_FOO_AUDIO_ALL = TEST_CODEC_FOO_AUDIO, |
| 45 TEST_CODEC_FOO_VIDEO = 1 << 11, // A video codec for foo container. | 45 TEST_CODEC_FOO_VIDEO = 1 << 30, // A video codec for foo container. |
| 46 TEST_CODEC_FOO_VIDEO_ALL = TEST_CODEC_FOO_VIDEO, | 46 TEST_CODEC_FOO_VIDEO_ALL = TEST_CODEC_FOO_VIDEO, |
| 47 TEST_CODEC_FOO_ALL = TEST_CODEC_FOO_AUDIO_ALL | TEST_CODEC_FOO_VIDEO_ALL | 47 TEST_CODEC_FOO_ALL = TEST_CODEC_FOO_AUDIO_ALL | TEST_CODEC_FOO_VIDEO_ALL |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 static_assert((TEST_CODEC_FOO_ALL & EME_CODEC_ALL) == EME_CODEC_NONE, | 50 static_assert((TEST_CODEC_FOO_ALL & EME_CODEC_ALL) == EME_CODEC_NONE, |
| 51 "test codec masks should only use invalid codec masks"); | 51 "test codec masks should only use invalid codec masks"); |
| 52 | 52 |
| 53 class TestKeySystemProperties : public KeySystemProperties { | 53 class TestKeySystemProperties : public KeySystemProperties { |
| 54 public: | 54 public: |
| 55 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { | 55 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 UpdateClientKeySystems(); | 689 UpdateClientKeySystems(); |
| 690 | 690 |
| 691 EXPECT_TRUE(IsSupportedKeySystem(kUsesAes)); | 691 EXPECT_TRUE(IsSupportedKeySystem(kUsesAes)); |
| 692 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( | 692 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( |
| 693 kVideoWebM, no_codecs(), kUsesAes)); | 693 kVideoWebM, no_codecs(), kUsesAes)); |
| 694 if (CanRunExternalKeySystemTests()) | 694 if (CanRunExternalKeySystemTests()) |
| 695 EXPECT_FALSE(IsSupportedKeySystem(kExternal)); | 695 EXPECT_FALSE(IsSupportedKeySystem(kExternal)); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace media | 698 } // namespace media |
| OLD | NEW |