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

Unified Diff: chrome/browser/media/encrypted_media_istypesupported_browsertest.cc

Issue 254983006: Fix: Adding list of supported codecs for MP4 containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding check for std::string::npos Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/media/media_canplaytype_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
diff --git a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
index 17f195ce844fb445b355f73a8866ab0438081d6e..fd684e22f3efb0f92681d1a83bcde55db83e6bc0 100644
--- a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
@@ -122,17 +122,24 @@ class EncryptedMediaIsTypeSupportedTest : public InProcessBrowserTest {
avc3_codec_.push_back("avc3");
- avc3_extended_codec_.push_back("avc3.64001f");
+ avc3_extended_codec_.push_back("avc3.64001F");
- aac_codec_.push_back("mp4a");
+ aac_codec_.push_back("mp4a.40.2");
+
+ mp4a_invalid_no_extension_.push_back("mp4a");
avc1_and_aac_codecs_.push_back("avc1");
- avc1_and_aac_codecs_.push_back("mp4a");
+ avc1_and_aac_codecs_.push_back("mp4a.40.2");
+
+ avc3_and_aac_codecs_.push_back("avc3");
+ avc3_and_aac_codecs_.push_back("mp4a.40.2");
unknown_codec_.push_back("foo");
mixed_codecs_.push_back("vorbis");
mixed_codecs_.push_back("avc1");
+
+ vp8_invalid_extension_codec_.push_back("vp8.1");
}
typedef std::vector<std::string> CodecVector;
@@ -160,11 +167,20 @@ class EncryptedMediaIsTypeSupportedTest : public InProcessBrowserTest {
return avc3_extended_codec_;
}
const CodecVector& aac_codec() const { return aac_codec_; }
+ const CodecVector& mp4a_invalid_no_extension() const {
+ return mp4a_invalid_no_extension_;
+ }
const CodecVector& avc1_and_aac_codecs() const {
return avc1_and_aac_codecs_;
}
+ const CodecVector& avc3_and_aac_codecs() const {
+ return avc3_and_aac_codecs_;
+ }
const CodecVector& unknown_codec() const { return unknown_codec_; }
const CodecVector& mixed_codecs() const { return mixed_codecs_; }
+ const CodecVector& vp8_invalid_extension_codec() const {
+ return vp8_invalid_extension_codec_;
+ }
// Update the command line to load |adapter_name| for
// |pepper_type_for_key_system|.
@@ -274,9 +290,12 @@ class EncryptedMediaIsTypeSupportedTest : public InProcessBrowserTest {
CodecVector avc3_codec_;
CodecVector avc3_extended_codec_;
CodecVector aac_codec_;
+ CodecVector mp4a_invalid_no_extension_;
CodecVector avc1_and_aac_codecs_;
+ CodecVector avc3_and_aac_codecs_;
CodecVector unknown_codec_;
CodecVector mixed_codecs_;
+ CodecVector vp8_invalid_extension_codec_;
bool is_test_page_loaded_;
bool is_pepper_cdm_registered_;
};
@@ -456,9 +475,13 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest,
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", avc1_codec(), kPrefixedClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/webm", avc3_codec(), kPrefixedClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", unknown_codec(), kPrefixedClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", mixed_codecs(), kPrefixedClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/webm", vp8_invalid_extension_codec(), kPrefixedClearKey));
// Valid audio types.
EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
@@ -496,6 +519,8 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest,
EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc3_codec(), kPrefixedClearKey));
EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", avc3_and_aac_codecs(), kPrefixedClearKey));
+ EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", aac_codec(), kPrefixedClearKey));
// Extended codecs.
@@ -504,19 +529,23 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest,
EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc3_extended_codec(), kPrefixedClearKey));
- // Invalid codec format, but canPlayType() strips away the period.
- EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
+ // Invalid codec format: profile parameter must be present after the period.
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc1_dot_codec(), kPrefixedClearKey));
- // Non-MP4 codecs.
+ // Invalid or Non-MP4 codecs.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc2_codec(), kPrefixedClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", mp4a_invalid_no_extension(), kPrefixedClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", vp8_codec(), kPrefixedClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", unknown_codec(), kPrefixedClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", mixed_codecs(), kPrefixedClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", vp8_invalid_extension_codec(), kPrefixedClearKey));
// Valid audio types.
EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
@@ -532,9 +561,11 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest,
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"audio/mp4", avc3_codec(), kPrefixedClearKey));
- // Non-MP4 codec.
+ // Invalid or Non-MP4 codec.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"audio/mp4", vorbis_codec(), kPrefixedClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "audio/mp4", mp4a_invalid_no_extension(), kPrefixedClearKey));
}
//
@@ -641,9 +672,13 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", avc1_codec(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/webm", avc3_codec(), kExternalClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", unknown_codec(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", mixed_codecs(), kExternalClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/webm", vp8_invalid_extension_codec(), kExternalClearKey));
// Valid audio types.
EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType(
@@ -682,6 +717,8 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc3_codec(), kExternalClearKey));
EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", avc3_and_aac_codecs(), kExternalClearKey));
+ EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", aac_codec(), kExternalClearKey));
// Extended codecs.
@@ -690,19 +727,23 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc3_extended_codec(), kExternalClearKey));
- // Invalid codec format, but canPlayType() strips away the period.
- EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
+ // Invalid codec format: profile parameter must be present after the period.
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc1_dot_codec(), kExternalClearKey));
- // Non-MP4 codecs.
+ // Invalid or Non-MP4 codecs.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc2_codec(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", mp4a_invalid_no_extension(), kExternalClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", vp8_codec(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", unknown_codec(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", mixed_codecs(), kExternalClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", vp8_invalid_extension_codec(), kExternalClearKey));
// Valid audio types.
EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
@@ -717,10 +758,14 @@ IN_PROC_BROWSER_TEST_F(
"audio/mp4", avc1_and_aac_codecs(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"audio/mp4", avc3_codec(), kExternalClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "audio/mp4", avc3_and_aac_codecs(), kExternalClearKey));
- // Non-MP4 codec.
+ // Invalid or Non-MP4 codec.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"audio/mp4", vorbis_codec(), kExternalClearKey));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "audio/mp4", mp4a_invalid_no_extension(), kExternalClearKey));
}
//
@@ -831,9 +876,13 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", avc1_codec(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/webm", avc3_codec(), kWidevineAlpha));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", unknown_codec(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/webm", mixed_codecs(), kWidevineAlpha));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/webm", vp8_invalid_extension_codec(), kWidevineAlpha));
// Valid audio types.
EXPECT_WV(IsSupportedKeySystemWithMediaMimeType(
@@ -870,6 +919,8 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc3_codec(), kWidevineAlpha));
EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", avc3_and_aac_codecs(), kWidevineAlpha));
+ EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", aac_codec(), kWidevineAlpha));
// Valid video types - parent key system.
@@ -879,6 +930,10 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
"video/mp4", avc1_codec(), kWidevine));
EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc1_and_aac_codecs(), kWidevine));
+ EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", avc3_codec(), kWidevine));
+ EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", avc3_and_aac_codecs(), kWidevine));
EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", aac_codec(), kWidevine));
@@ -888,19 +943,23 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc3_extended_codec(), kWidevineAlpha));
- // Invalid codec format, but canPlayType() strips away the period.
- EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
+ // Invalid codec format: profile paramter must be present after the period.
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc1_dot_codec(), kWidevineAlpha));
- // Non-MP4 codecs.
+ // Invalid or Non-MP4 codecs.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", avc2_codec(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", mp4a_invalid_no_extension(), kWidevineAlpha));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", vp8_codec(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", unknown_codec(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"video/mp4", mixed_codecs(), kWidevineAlpha));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "video/mp4", vp8_invalid_extension_codec(), kWidevineAlpha));
// Valid audio types.
EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType(
@@ -921,10 +980,14 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
"audio/mp4", avc1_and_aac_codecs(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"audio/mp4", avc3_codec(), kWidevineAlpha));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "audio/mp4", avc3_and_aac_codecs(), kWidevineAlpha));
- // Non-MP4 codec.
+ // Invalid or Non-MP4 codec.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
"audio/mp4", vorbis_codec(), kWidevineAlpha));
+ EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
+ "audio/mp4", mp4a_invalid_no_extension(), kWidevineAlpha));
}
IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
« no previous file with comments | « no previous file | content/browser/media/media_canplaytype_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698