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

Side by Side 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: Changing AreSupportedCodecsWithProfile() implementation Created 6 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
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 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 avc1_codec_.push_back("avc1"); 115 avc1_codec_.push_back("avc1");
116 116
117 avc1_extended_codec_.push_back("avc1.4D400C"); 117 avc1_extended_codec_.push_back("avc1.4D400C");
118 118
119 avc1_dot_codec_.push_back("avc1."); 119 avc1_dot_codec_.push_back("avc1.");
120 120
121 avc2_codec_.push_back("avc2"); 121 avc2_codec_.push_back("avc2");
122 122
123 avc3_codec_.push_back("avc3"); 123 avc3_codec_.push_back("avc3");
124 124
125 avc3_extended_codec_.push_back("avc3.64001f"); 125 avc3_extended_codec_.push_back("avc3.64001F");
126 126
127 aac_codec_.push_back("mp4a"); 127 aac_codec_.push_back("mp4a.40");
acolwell GONE FROM CHROMIUM 2014/06/02 21:22:42 nit: Why is this called aac_codec_? mp4a.40 does n
amogh.bihani 2014/06/03 13:26:12 Yes, this is non-compliant, this is just to keep t
acolwell GONE FROM CHROMIUM 2014/06/09 23:50:31 It doesn't make sense to keep the variable names c
128 128
129 avc1_and_aac_codecs_.push_back("avc1"); 129 avc1_and_aac_codecs_.push_back("avc1");
130 avc1_and_aac_codecs_.push_back("mp4a"); 130 avc1_and_aac_codecs_.push_back("mp4a.40");
acolwell GONE FROM CHROMIUM 2014/06/02 21:22:42 ditto.
131
132 avc3_and_aac_codecs_.push_back("avc3");
133 avc3_and_aac_codecs_.push_back("mp4a.40");
acolwell GONE FROM CHROMIUM 2014/06/02 21:22:42 ditto.
131 134
132 unknown_codec_.push_back("foo"); 135 unknown_codec_.push_back("foo");
133 136
134 mixed_codecs_.push_back("vorbis"); 137 mixed_codecs_.push_back("vorbis");
135 mixed_codecs_.push_back("avc1"); 138 mixed_codecs_.push_back("avc1");
139
140 vp8_invalid_extension_codec_.push_back("vp8.1");
136 } 141 }
137 142
138 typedef std::vector<std::string> CodecVector; 143 typedef std::vector<std::string> CodecVector;
139 144
140 const CodecVector& no_codecs() const { return no_codecs_; } 145 const CodecVector& no_codecs() const { return no_codecs_; }
141 const CodecVector& vp8_codec() const { return vp8_codec_; } 146 const CodecVector& vp8_codec() const { return vp8_codec_; }
142 const CodecVector& vp80_codec() const { return vp80_codec_; } 147 const CodecVector& vp80_codec() const { return vp80_codec_; }
143 const CodecVector& vp9_codec() const { return vp9_codec_; } 148 const CodecVector& vp9_codec() const { return vp9_codec_; }
144 const CodecVector& vp90_codec() const { return vp90_codec_; } 149 const CodecVector& vp90_codec() const { return vp90_codec_; }
145 const CodecVector& vorbis_codec() const { return vorbis_codec_; } 150 const CodecVector& vorbis_codec() const { return vorbis_codec_; }
(...skipping 10 matching lines...) Expand all
156 const CodecVector& avc1_dot_codec() const { return avc1_dot_codec_; } 161 const CodecVector& avc1_dot_codec() const { return avc1_dot_codec_; }
157 const CodecVector& avc2_codec() const { return avc2_codec_; } 162 const CodecVector& avc2_codec() const { return avc2_codec_; }
158 const CodecVector& avc3_codec() const { return avc3_codec_; } 163 const CodecVector& avc3_codec() const { return avc3_codec_; }
159 const CodecVector& avc3_extended_codec() const { 164 const CodecVector& avc3_extended_codec() const {
160 return avc3_extended_codec_; 165 return avc3_extended_codec_;
161 } 166 }
162 const CodecVector& aac_codec() const { return aac_codec_; } 167 const CodecVector& aac_codec() const { return aac_codec_; }
163 const CodecVector& avc1_and_aac_codecs() const { 168 const CodecVector& avc1_and_aac_codecs() const {
164 return avc1_and_aac_codecs_; 169 return avc1_and_aac_codecs_;
165 } 170 }
171 const CodecVector& avc3_and_aac_codecs() const {
172 return avc3_and_aac_codecs_;
173 }
166 const CodecVector& unknown_codec() const { return unknown_codec_; } 174 const CodecVector& unknown_codec() const { return unknown_codec_; }
167 const CodecVector& mixed_codecs() const { return mixed_codecs_; } 175 const CodecVector& mixed_codecs() const { return mixed_codecs_; }
176 const CodecVector& vp8_invalid_extension_codec() const {
177 return vp8_invalid_extension_codec_;
178 }
168 179
169 // Update the command line to load |adapter_name| for 180 // Update the command line to load |adapter_name| for
170 // |pepper_type_for_key_system|. 181 // |pepper_type_for_key_system|.
171 void RegisterPepperCdm(CommandLine* command_line, 182 void RegisterPepperCdm(CommandLine* command_line,
172 const std::string& adapter_name, 183 const std::string& adapter_name,
173 const std::string& pepper_type_for_key_system, 184 const std::string& pepper_type_for_key_system,
174 bool expect_adapter_exists = true) { 185 bool expect_adapter_exists = true) {
175 DCHECK(!is_pepper_cdm_registered_) 186 DCHECK(!is_pepper_cdm_registered_)
176 << "RegisterPepperCdm() can only be called once."; 187 << "RegisterPepperCdm() can only be called once.";
177 is_pepper_cdm_registered_ = true; 188 is_pepper_cdm_registered_ = true;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 CodecVector vp8_and_vorbis_codecs_; 279 CodecVector vp8_and_vorbis_codecs_;
269 CodecVector vp9_and_vorbis_codecs_; 280 CodecVector vp9_and_vorbis_codecs_;
270 CodecVector avc1_codec_; 281 CodecVector avc1_codec_;
271 CodecVector avc1_extended_codec_; 282 CodecVector avc1_extended_codec_;
272 CodecVector avc1_dot_codec_; 283 CodecVector avc1_dot_codec_;
273 CodecVector avc2_codec_; 284 CodecVector avc2_codec_;
274 CodecVector avc3_codec_; 285 CodecVector avc3_codec_;
275 CodecVector avc3_extended_codec_; 286 CodecVector avc3_extended_codec_;
276 CodecVector aac_codec_; 287 CodecVector aac_codec_;
277 CodecVector avc1_and_aac_codecs_; 288 CodecVector avc1_and_aac_codecs_;
289 CodecVector avc3_and_aac_codecs_;
278 CodecVector unknown_codec_; 290 CodecVector unknown_codec_;
279 CodecVector mixed_codecs_; 291 CodecVector mixed_codecs_;
292 CodecVector vp8_invalid_extension_codec_;
280 bool is_test_page_loaded_; 293 bool is_test_page_loaded_;
281 bool is_pepper_cdm_registered_; 294 bool is_pepper_cdm_registered_;
282 }; 295 };
283 296
284 // For ExternalClearKey tests, ensure that the ClearKey adapter is loaded. 297 // For ExternalClearKey tests, ensure that the ClearKey adapter is loaded.
285 class EncryptedMediaIsTypeSupportedExternalClearKeyTest 298 class EncryptedMediaIsTypeSupportedExternalClearKeyTest
286 : public EncryptedMediaIsTypeSupportedTest { 299 : public EncryptedMediaIsTypeSupportedTest {
287 #if defined(ENABLE_PEPPER_CDMS) 300 #if defined(ENABLE_PEPPER_CDMS)
288 protected: 301 protected:
289 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 302 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 "video/webm", vp90_codec(), kPrefixedClearKey)); 462 "video/webm", vp90_codec(), kPrefixedClearKey));
450 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( 463 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
451 "video/webm", vp9_and_vorbis_codecs(), kPrefixedClearKey)); 464 "video/webm", vp9_and_vorbis_codecs(), kPrefixedClearKey));
452 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( 465 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
453 "video/webm", vorbis_codec(), kPrefixedClearKey)); 466 "video/webm", vorbis_codec(), kPrefixedClearKey));
454 467
455 // Non-Webm codecs. 468 // Non-Webm codecs.
456 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 469 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
457 "video/webm", avc1_codec(), kPrefixedClearKey)); 470 "video/webm", avc1_codec(), kPrefixedClearKey));
458 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 471 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
472 "video/webm", avc3_codec(), kPrefixedClearKey));
473 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
459 "video/webm", unknown_codec(), kPrefixedClearKey)); 474 "video/webm", unknown_codec(), kPrefixedClearKey));
460 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 475 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
461 "video/webm", mixed_codecs(), kPrefixedClearKey)); 476 "video/webm", mixed_codecs(), kPrefixedClearKey));
477 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
478 "video/webm", vp8_invalid_extension_codec(), kPrefixedClearKey));
462 479
463 // Valid audio types. 480 // Valid audio types.
464 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( 481 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
465 "audio/webm", no_codecs(), kPrefixedClearKey)); 482 "audio/webm", no_codecs(), kPrefixedClearKey));
466 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( 483 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
467 "audio/webm", vorbis_codec(), kPrefixedClearKey)); 484 "audio/webm", vorbis_codec(), kPrefixedClearKey));
468 485
469 // Non-audio codecs. 486 // Non-audio codecs.
470 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 487 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
471 "audio/webm", vp8_codec(), kPrefixedClearKey)); 488 "audio/webm", vp8_codec(), kPrefixedClearKey));
(...skipping 17 matching lines...) Expand all
489 // The parent should be supported but is not. See http://crbug.com/164303. 506 // The parent should be supported but is not. See http://crbug.com/164303.
490 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 507 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
491 "video/mp4", no_codecs(), kPrefixedClearKeyParent)); 508 "video/mp4", no_codecs(), kPrefixedClearKeyParent));
492 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 509 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
493 "video/mp4", avc1_codec(), kPrefixedClearKey)); 510 "video/mp4", avc1_codec(), kPrefixedClearKey));
494 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 511 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
495 "video/mp4", avc1_and_aac_codecs(), kPrefixedClearKey)); 512 "video/mp4", avc1_and_aac_codecs(), kPrefixedClearKey));
496 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 513 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
497 "video/mp4", avc3_codec(), kPrefixedClearKey)); 514 "video/mp4", avc3_codec(), kPrefixedClearKey));
498 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 515 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
516 "video/mp4", avc3_and_aac_codecs(), kPrefixedClearKey));
517 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
499 "video/mp4", aac_codec(), kPrefixedClearKey)); 518 "video/mp4", aac_codec(), kPrefixedClearKey));
500 519
501 // Extended codecs. 520 // Extended codecs.
502 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 521 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
503 "video/mp4", avc1_extended_codec(), kPrefixedClearKey)); 522 "video/mp4", avc1_extended_codec(), kPrefixedClearKey));
504 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 523 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
505 "video/mp4", avc3_extended_codec(), kPrefixedClearKey)); 524 "video/mp4", avc3_extended_codec(), kPrefixedClearKey));
506 525
507 // Invalid codec format, but canPlayType() strips away the period. 526 // Invalid codec format: profile parameter must be present after the period.
508 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 527 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
509 "video/mp4", avc1_dot_codec(), kPrefixedClearKey)); 528 "video/mp4", avc1_dot_codec(), kPrefixedClearKey));
510 529
511 // Non-MP4 codecs. 530 // Non-MP4 codecs.
512 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 531 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
513 "video/mp4", avc2_codec(), kPrefixedClearKey)); 532 "video/mp4", avc2_codec(), kPrefixedClearKey));
514 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 533 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
515 "video/mp4", vp8_codec(), kPrefixedClearKey)); 534 "video/mp4", vp8_codec(), kPrefixedClearKey));
516 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 535 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
517 "video/mp4", unknown_codec(), kPrefixedClearKey)); 536 "video/mp4", unknown_codec(), kPrefixedClearKey));
518 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 537 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
519 "video/mp4", mixed_codecs(), kPrefixedClearKey)); 538 "video/mp4", mixed_codecs(), kPrefixedClearKey));
539 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
540 "video/mp4", vp8_invalid_extension_codec(), kPrefixedClearKey));
520 541
521 // Valid audio types. 542 // Valid audio types.
522 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 543 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
523 "audio/mp4", no_codecs(), kPrefixedClearKey)); 544 "audio/mp4", no_codecs(), kPrefixedClearKey));
524 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 545 EXPECT_PROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
525 "audio/mp4", aac_codec(), kPrefixedClearKey)); 546 "audio/mp4", aac_codec(), kPrefixedClearKey));
526 547
527 // Non-audio codecs. 548 // Non-audio codecs.
528 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 549 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
529 "audio/mp4", avc1_codec(), kPrefixedClearKey)); 550 "audio/mp4", avc1_codec(), kPrefixedClearKey));
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 "video/webm", vp90_codec(), kExternalClearKey)); 655 "video/webm", vp90_codec(), kExternalClearKey));
635 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType( 656 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType(
636 "video/webm", vp9_and_vorbis_codecs(), kExternalClearKey)); 657 "video/webm", vp9_and_vorbis_codecs(), kExternalClearKey));
637 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType( 658 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType(
638 "video/webm", vorbis_codec(), kExternalClearKey)); 659 "video/webm", vorbis_codec(), kExternalClearKey));
639 660
640 // Non-Webm codecs. 661 // Non-Webm codecs.
641 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 662 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
642 "video/webm", avc1_codec(), kExternalClearKey)); 663 "video/webm", avc1_codec(), kExternalClearKey));
643 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 664 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
665 "video/webm", avc3_codec(), kExternalClearKey));
666 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
644 "video/webm", unknown_codec(), kExternalClearKey)); 667 "video/webm", unknown_codec(), kExternalClearKey));
645 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 668 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
646 "video/webm", mixed_codecs(), kExternalClearKey)); 669 "video/webm", mixed_codecs(), kExternalClearKey));
670 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
671 "video/webm", vp8_invalid_extension_codec(), kExternalClearKey));
647 672
648 // Valid audio types. 673 // Valid audio types.
649 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType( 674 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType(
650 "audio/webm", no_codecs(), kExternalClearKey)); 675 "audio/webm", no_codecs(), kExternalClearKey));
651 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType( 676 EXPECT_ECK(IsSupportedKeySystemWithMediaMimeType(
652 "audio/webm", vorbis_codec(), kExternalClearKey)); 677 "audio/webm", vorbis_codec(), kExternalClearKey));
653 678
654 // Non-audio codecs. 679 // Non-audio codecs.
655 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 680 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
656 "audio/webm", vp8_codec(), kExternalClearKey)); 681 "audio/webm", vp8_codec(), kExternalClearKey));
(...skipping 18 matching lines...) Expand all
675 // The parent should be supported but is not. See http://crbug.com/164303. 700 // The parent should be supported but is not. See http://crbug.com/164303.
676 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 701 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
677 "video/mp4", no_codecs(), "org.chromium")); 702 "video/mp4", no_codecs(), "org.chromium"));
678 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 703 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
679 "video/mp4", avc1_codec(), kExternalClearKey)); 704 "video/mp4", avc1_codec(), kExternalClearKey));
680 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 705 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
681 "video/mp4", avc1_and_aac_codecs(), kExternalClearKey)); 706 "video/mp4", avc1_and_aac_codecs(), kExternalClearKey));
682 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 707 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
683 "video/mp4", avc3_codec(), kExternalClearKey)); 708 "video/mp4", avc3_codec(), kExternalClearKey));
684 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 709 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
710 "video/mp4", avc3_and_aac_codecs(), kExternalClearKey));
711 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
685 "video/mp4", aac_codec(), kExternalClearKey)); 712 "video/mp4", aac_codec(), kExternalClearKey));
686 713
687 // Extended codecs. 714 // Extended codecs.
688 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 715 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
689 "video/mp4", avc1_extended_codec(), kExternalClearKey)); 716 "video/mp4", avc1_extended_codec(), kExternalClearKey));
690 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 717 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
691 "video/mp4", avc3_extended_codec(), kExternalClearKey)); 718 "video/mp4", avc3_extended_codec(), kExternalClearKey));
692 719
693 // Invalid codec format, but canPlayType() strips away the period. 720 // Invalid codec format: profile parameter must be present after the period.
694 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 721 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
695 "video/mp4", avc1_dot_codec(), kExternalClearKey)); 722 "video/mp4", avc1_dot_codec(), kExternalClearKey));
696 723
697 // Non-MP4 codecs. 724 // Non-MP4 codecs.
698 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 725 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
699 "video/mp4", avc2_codec(), kExternalClearKey)); 726 "video/mp4", avc2_codec(), kExternalClearKey));
700 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 727 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
701 "video/mp4", vp8_codec(), kExternalClearKey)); 728 "video/mp4", vp8_codec(), kExternalClearKey));
702 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 729 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
703 "video/mp4", unknown_codec(), kExternalClearKey)); 730 "video/mp4", unknown_codec(), kExternalClearKey));
704 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 731 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
705 "video/mp4", mixed_codecs(), kExternalClearKey)); 732 "video/mp4", mixed_codecs(), kExternalClearKey));
733 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
734 "video/mp4", vp8_invalid_extension_codec(), kExternalClearKey));
706 735
707 // Valid audio types. 736 // Valid audio types.
708 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 737 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
709 "audio/mp4", no_codecs(), kExternalClearKey)); 738 "audio/mp4", no_codecs(), kExternalClearKey));
710 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType( 739 EXPECT_ECKPROPRIETARY(IsSupportedKeySystemWithMediaMimeType(
711 "audio/mp4", aac_codec(), kExternalClearKey)); 740 "audio/mp4", aac_codec(), kExternalClearKey));
712 741
713 // Non-audio codecs. 742 // Non-audio codecs.
714 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 743 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
715 "audio/mp4", avc1_codec(), kExternalClearKey)); 744 "audio/mp4", avc1_codec(), kExternalClearKey));
716 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 745 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
717 "audio/mp4", avc1_and_aac_codecs(), kExternalClearKey)); 746 "audio/mp4", avc1_and_aac_codecs(), kExternalClearKey));
718 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 747 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
719 "audio/mp4", avc3_codec(), kExternalClearKey)); 748 "audio/mp4", avc3_codec(), kExternalClearKey));
749 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
750 "audio/mp4", avc3_and_aac_codecs(), kExternalClearKey));
720 751
721 // Non-MP4 codec. 752 // Non-MP4 codec.
722 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 753 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
723 "audio/mp4", vorbis_codec(), kExternalClearKey)); 754 "audio/mp4", vorbis_codec(), kExternalClearKey));
724 } 755 }
725 756
726 // 757 //
727 // Widevine 758 // Widevine
728 // 759 //
729 760
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 "video/webm", vp80_codec(), kWidevine)); 855 "video/webm", vp80_codec(), kWidevine));
825 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType( 856 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType(
826 "video/webm", vp8_and_vorbis_codecs(), kWidevine)); 857 "video/webm", vp8_and_vorbis_codecs(), kWidevine));
827 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType( 858 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType(
828 "video/webm", vorbis_codec(), kWidevine)); 859 "video/webm", vorbis_codec(), kWidevine));
829 860
830 // Non-Webm codecs. 861 // Non-Webm codecs.
831 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 862 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
832 "video/webm", avc1_codec(), kWidevineAlpha)); 863 "video/webm", avc1_codec(), kWidevineAlpha));
833 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 864 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
865 "video/webm", avc3_codec(), kWidevineAlpha));
866 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
834 "video/webm", unknown_codec(), kWidevineAlpha)); 867 "video/webm", unknown_codec(), kWidevineAlpha));
835 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 868 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
836 "video/webm", mixed_codecs(), kWidevineAlpha)); 869 "video/webm", mixed_codecs(), kWidevineAlpha));
870 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
871 "video/webm", vp8_invalid_extension_codec(), kWidevineAlpha));
837 872
838 // Valid audio types. 873 // Valid audio types.
839 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType( 874 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType(
840 "audio/webm", no_codecs(), kWidevineAlpha)); 875 "audio/webm", no_codecs(), kWidevineAlpha));
841 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType( 876 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType(
842 "audio/webm", vorbis_codec(), kWidevineAlpha)); 877 "audio/webm", vorbis_codec(), kWidevineAlpha));
843 878
844 // Valid audio types - parent key system. 879 // Valid audio types - parent key system.
845 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType( 880 EXPECT_WV(IsSupportedKeySystemWithMediaMimeType(
846 "audio/webm", no_codecs(), kWidevine)); 881 "audio/webm", no_codecs(), kWidevine));
(...skipping 16 matching lines...) Expand all
863 // Valid video types. 898 // Valid video types.
864 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( 899 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType(
865 "video/mp4", no_codecs(), kWidevineAlpha)); 900 "video/mp4", no_codecs(), kWidevineAlpha));
866 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( 901 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
867 "video/mp4", avc1_codec(), kWidevineAlpha)); 902 "video/mp4", avc1_codec(), kWidevineAlpha));
868 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType( 903 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
869 "video/mp4", avc1_and_aac_codecs(), kWidevineAlpha)); 904 "video/mp4", avc1_and_aac_codecs(), kWidevineAlpha));
870 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( 905 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
871 "video/mp4", avc3_codec(), kWidevineAlpha)); 906 "video/mp4", avc3_codec(), kWidevineAlpha));
872 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType( 907 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
908 "video/mp4", avc3_and_aac_codecs(), kWidevineAlpha));
909 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
873 "video/mp4", aac_codec(), kWidevineAlpha)); 910 "video/mp4", aac_codec(), kWidevineAlpha));
874 911
875 // Valid video types - parent key system. 912 // Valid video types - parent key system.
876 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( 913 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType(
877 "video/mp4", no_codecs(), kWidevine)); 914 "video/mp4", no_codecs(), kWidevine));
878 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( 915 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
879 "video/mp4", avc1_codec(), kWidevine)); 916 "video/mp4", avc1_codec(), kWidevine));
880 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType( 917 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
881 "video/mp4", avc1_and_aac_codecs(), kWidevine)); 918 "video/mp4", avc1_and_aac_codecs(), kWidevine));
919 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
920 "video/mp4", avc3_codec(), kWidevine));
921 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
922 "video/mp4", avc3_and_aac_codecs(), kWidevine));
882 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType( 923 EXPECT_WVAVC1AAC(IsSupportedKeySystemWithMediaMimeType(
883 "video/mp4", aac_codec(), kWidevine)); 924 "video/mp4", aac_codec(), kWidevine));
884 925
885 // Extended codecs. 926 // Extended codecs.
886 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( 927 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
887 "video/mp4", avc1_extended_codec(), kWidevineAlpha)); 928 "video/mp4", avc1_extended_codec(), kWidevineAlpha));
888 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( 929 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType(
889 "video/mp4", avc3_extended_codec(), kWidevineAlpha)); 930 "video/mp4", avc3_extended_codec(), kWidevineAlpha));
890 931
891 // Invalid codec format, but canPlayType() strips away the period. 932 // Invalid codec format: profile paramter must be present after the period.
892 EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( 933 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
893 "video/mp4", avc1_dot_codec(), kWidevineAlpha)); 934 "video/mp4", avc1_dot_codec(), kWidevineAlpha));
894 935
895 // Non-MP4 codecs. 936 // Non-MP4 codecs.
896 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 937 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
897 "video/mp4", avc2_codec(), kWidevineAlpha)); 938 "video/mp4", avc2_codec(), kWidevineAlpha));
898 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 939 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
899 "video/mp4", vp8_codec(), kWidevineAlpha)); 940 "video/mp4", vp8_codec(), kWidevineAlpha));
900 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 941 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
901 "video/mp4", unknown_codec(), kWidevineAlpha)); 942 "video/mp4", unknown_codec(), kWidevineAlpha));
902 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 943 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
903 "video/mp4", mixed_codecs(), kWidevineAlpha)); 944 "video/mp4", mixed_codecs(), kWidevineAlpha));
945 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
946 "video/mp4", vp8_invalid_extension_codec(), kWidevineAlpha));
904 947
905 // Valid audio types. 948 // Valid audio types.
906 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( 949 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType(
907 "audio/mp4", no_codecs(), kWidevineAlpha)); 950 "audio/mp4", no_codecs(), kWidevineAlpha));
908 EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( 951 EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType(
909 "audio/mp4", aac_codec(), kWidevineAlpha)); 952 "audio/mp4", aac_codec(), kWidevineAlpha));
910 953
911 // Valid audio types - parent key system. 954 // Valid audio types - parent key system.
912 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( 955 EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType(
913 "audio/mp4", no_codecs(), kWidevine)); 956 "audio/mp4", no_codecs(), kWidevine));
914 EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( 957 EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType(
915 "audio/mp4", aac_codec(), kWidevine)); 958 "audio/mp4", aac_codec(), kWidevine));
916 959
917 // Non-audio codecs. 960 // Non-audio codecs.
918 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 961 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
919 "audio/mp4", avc1_codec(), kWidevineAlpha)); 962 "audio/mp4", avc1_codec(), kWidevineAlpha));
920 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 963 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
921 "audio/mp4", avc1_and_aac_codecs(), kWidevineAlpha)); 964 "audio/mp4", avc1_and_aac_codecs(), kWidevineAlpha));
922 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 965 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
923 "audio/mp4", avc3_codec(), kWidevineAlpha)); 966 "audio/mp4", avc3_codec(), kWidevineAlpha));
967 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
968 "audio/mp4", avc3_and_aac_codecs(), kWidevineAlpha));
924 969
925 // Non-MP4 codec. 970 // Non-MP4 codec.
926 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 971 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
927 "audio/mp4", vorbis_codec(), kWidevineAlpha)); 972 "audio/mp4", vorbis_codec(), kWidevineAlpha));
928 } 973 }
929 974
930 IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest, 975 IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest,
931 Widevine_HR_Basic) { 976 Widevine_HR_Basic) {
932 // HR support cannot be detected in tests, so this is expected to fail 977 // HR support cannot be detected in tests, so this is expected to fail
933 // everywhere. 978 // everywhere.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 EncryptedMediaIsTypeSupportedWidevineCDMRegisteredWithWrongPathTest, 1048 EncryptedMediaIsTypeSupportedWidevineCDMRegisteredWithWrongPathTest,
1004 PepperCDMsRegisteredButAdapterNotPresent) { 1049 PepperCDMsRegisteredButAdapterNotPresent) {
1005 EXPECT_FALSE(IsConcreteSupportedKeySystem(kWidevineAlpha)); 1050 EXPECT_FALSE(IsConcreteSupportedKeySystem(kWidevineAlpha));
1006 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 1051 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
1007 "video/webm", no_codecs(), kWidevineAlpha)); 1052 "video/webm", no_codecs(), kWidevineAlpha));
1008 } 1053 }
1009 #endif // !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT ) 1054 #endif // !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT )
1010 #endif // defined(ENABLE_PEPPER_CDMS) 1055 #endif // defined(ENABLE_PEPPER_CDMS)
1011 1056
1012 } // namespace chrome 1057 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698