Chromium Code Reviews| 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 ed0e4daa000ee341649c93e4df2b08d0849e6136..4d0613ee1247715080a8fb6f68e1ca0d1877b62e 100644 |
| --- a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc |
| +++ b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc |
| @@ -109,13 +109,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_extended_codec_.push_back("mp4a.40.2"); |
| + |
| avc1_and_aac_codecs_.push_back("avc1"); |
| avc1_and_aac_codecs_.push_back("mp4a"); |
| + avc3_and_aac_codecs_.push_back("avc3"); |
| + avc3_and_aac_codecs_.push_back("mp4a"); |
| + |
| + avc1_and_aac_extended_codecs_.push_back("avc1.4D400C"); |
| + avc1_and_aac_extended_codecs_.push_back("mp4a.40.2"); |
| + |
| + avc3_and_aac_extended_codecs_.push_back("avc3.64001F"); |
| + avc3_and_aac_extended_codecs_.push_back("mp4a.40.2"); |
| + |
| unknown_codec_.push_back("foo"); |
| mixed_codecs_.push_back("vorbis"); |
| @@ -142,9 +153,19 @@ class EncryptedMediaIsTypeSupportedTest : public InProcessBrowserTest { |
| return avc3_extended_codec_; |
| } |
| const CodecVector& aac_codec() const { return aac_codec_; } |
| + const CodecVector& aac_extended_codec() const { return aac_extended_codec_; } |
| 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& avc1_and_aac_extended_codecs() const { |
| + return avc1_and_aac_extended_codecs_; |
| + } |
| + const CodecVector& avc3_and_aac_extended_codecs() const { |
| + return avc3_and_aac_extended_codecs_; |
| + } |
| const CodecVector& unknown_codec() const { return unknown_codec_; } |
| const CodecVector& mixed_codecs() const { return mixed_codecs_; } |
| @@ -253,7 +274,11 @@ class EncryptedMediaIsTypeSupportedTest : public InProcessBrowserTest { |
| CodecVector avc3_codec_; |
| CodecVector avc3_extended_codec_; |
| CodecVector aac_codec_; |
| + CodecVector aac_extended_codec_; |
| CodecVector avc1_and_aac_codecs_; |
| + CodecVector avc3_and_aac_codecs_; |
| + CodecVector avc1_and_aac_extended_codecs_; |
| + CodecVector avc3_and_aac_extended_codecs_; |
| CodecVector unknown_codec_; |
| CodecVector mixed_codecs_; |
| bool is_test_page_loaded_; |
| @@ -429,6 +454,8 @@ 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)); |
| @@ -465,6 +492,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. |
| @@ -472,9 +501,15 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest, |
| "video/mp4", avc1_extended_codec(), kPrefixedClearKey)); |
| EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc3_extended_codec(), kPrefixedClearKey)); |
| - |
| - // Invalid codec format, but canPlayType() strips away the period. |
| EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", aac_extended_codec(), kPrefixedClearKey)); |
| + EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", avc1_and_aac_extended_codecs(), kPrefixedClearKey)); |
| + EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", avc3_and_aac_extended_codecs(), kPrefixedClearKey)); |
| + |
| + // Invalid codec format, profile parameter must be present after the period. |
|
ddorwin
2014/04/29 17:12:54
nit: use a : or - instead of a ,
amogh.bihani
2014/04/30 06:12:10
Done.
|
| + EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc1_dot_codec(), kPrefixedClearKey)); |
| // Non-MP4 codecs. |
| @@ -492,6 +527,8 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest, |
| "audio/mp4", no_codecs(), kPrefixedClearKey)); |
| EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", aac_codec(), kPrefixedClearKey)); |
| + EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", aac_extended_codec(), kPrefixedClearKey)); |
| // Non-audio codecs. |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| @@ -499,7 +536,13 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedTest, |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", avc1_and_aac_codecs(), kPrefixedClearKey)); |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", avc1_and_aac_extended_codecs(), kPrefixedClearKey)); |
| + EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", avc3_codec(), kPrefixedClearKey)); |
| + EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", avc3_and_aac_codecs(), kPrefixedClearKey)); |
| + EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", avc3_and_aac_extended_codecs(), kPrefixedClearKey)); |
| // Non-MP4 codec. |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| @@ -604,6 +647,8 @@ 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)); |
| @@ -641,6 +686,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. |
| @@ -648,9 +695,15 @@ IN_PROC_BROWSER_TEST_F( |
| "video/mp4", avc1_extended_codec(), kExternalClearKey)); |
| EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc3_extended_codec(), kExternalClearKey)); |
| - |
| - // Invalid codec format, but canPlayType() strips away the period. |
| EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", aac_extended_codec(), kExternalClearKey)); |
| + EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", avc1_and_aac_extended_codecs(), kExternalClearKey)); |
| + EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", avc3_and_aac_extended_codecs(), kExternalClearKey)); |
| + |
| + // Invalid codec format, profile parameter must be present after the period. |
|
ddorwin
2014/04/29 17:12:54
ditto
|
| + EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc1_dot_codec(), kExternalClearKey)); |
| // Non-MP4 codecs. |
| @@ -668,6 +721,8 @@ IN_PROC_BROWSER_TEST_F( |
| "audio/mp4", no_codecs(), kExternalClearKey)); |
| EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", aac_codec(), kExternalClearKey)); |
| + EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", aac_extended_codec(), kExternalClearKey)); |
| // Non-audio codecs. |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| @@ -676,6 +731,8 @@ 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. |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| @@ -787,6 +844,8 @@ 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)); |
| @@ -826,7 +885,11 @@ 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)); |
| + EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", aac_extended_codec(), kWidevineAlpha)); |
|
ddorwin
2014/04/29 17:12:54
This is the only place where an extended OR audio
amogh.bihani
2014/04/30 06:12:10
Done.
|
| // Valid video types - parent key system. |
| EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( |
| @@ -835,17 +898,27 @@ 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)); |
| + EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", aac_extended_codec(), kWidevine)); |
|
ddorwin
2014/04/29 17:12:54
ditto. I see how this makes sense. Maybe we should
amogh.bihani
2014/04/30 06:12:10
Done.
|
| // Extended codecs. |
| EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc1_extended_codec(), kWidevineAlpha)); |
| EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc3_extended_codec(), kWidevineAlpha)); |
| - |
| - // Invalid codec format, but canPlayType() strips away the period. |
| EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", avc1_and_aac_extended_codecs(), kWidevineAlpha)); |
| + EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( |
| + "video/mp4", avc3_and_aac_extended_codecs(), kWidevineAlpha)); |
| + |
| + // Invalid codec format, profile paramter must be present after the period. |
|
ddorwin
2014/04/29 17:12:54
ditto on comma
|
| + EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| "video/mp4", avc1_dot_codec(), kWidevineAlpha)); |
| // Non-MP4 codecs. |
| @@ -863,12 +936,16 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest, |
| "audio/mp4", no_codecs(), kWidevineAlpha)); |
| EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", aac_codec(), kWidevineAlpha)); |
| + EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", aac_extended_codec(), kWidevineAlpha)); |
| // Valid audio types - parent key system. |
| EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", no_codecs(), kWidevine)); |
| EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( |
| "audio/mp4", aac_codec(), kWidevine)); |
| + EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( |
| + "audio/mp4", aac_extended_codec(), kWidevine)); |
| // Non-audio codecs. |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
| @@ -877,6 +954,8 @@ 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. |
| EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |