Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: media/base/key_systems_unittest.cc

Issue 2853123003: EME contentType checks for AC3/EAC3 (Closed)
Patch Set: int32 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698