OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test EME syntax</title> | 4 <title>Test EME syntax</title> |
5 <script src="encrypted-media-utils.js"></script> | 5 <script src="encrypted-media-utils.js"></script> |
6 <script src="../../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
7 <script src="../../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <div id="log"></div> | 10 <div id="log"></div> |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 func: function(mk5, type) { return mk5.createSession().gener
ateRequest(type, 1); } | 335 func: function(mk5, type) { return mk5.createSession().gener
ateRequest(type, 1); } |
336 }, | 336 }, |
337 { | 337 { |
338 exception: 'InvalidAccessError', | 338 exception: 'InvalidAccessError', |
339 func: function(mk6, type) { return mk6.createSession().gener
ateRequest(type, new Uint8Array(0)); } | 339 func: function(mk6, type) { return mk6.createSession().gener
ateRequest(type, new Uint8Array(0)); } |
340 } | 340 } |
341 ]; | 341 ]; |
342 | 342 |
343 async_test(function(test) | 343 async_test(function(test) |
344 { | 344 { |
345 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 345 var isWebmSupported; |
| 346 var isCencSupported; |
| 347 |
| 348 isInitDataTypeSupported('webm').then(function(result) { |
| 349 isWebmSupported = result; |
| 350 return isInitDataTypeSupported('cenc'); |
| 351 }).then(function(result) { |
| 352 isCencSupported = result; |
| 353 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 354 }).then(function(access) { |
346 return access.createMediaKeys(); | 355 return access.createMediaKeys(); |
347 }).then(function(mediaKeys) { | 356 }).then(function(mediaKeys) { |
348 var initData = stringToUint8Array('init data'); | 357 var initData = stringToUint8Array('init data'); |
349 var sessionPromises = kGenerateRequestExceptionsTestCases.ma
p(function(testCase) { | 358 var sessionPromises = kGenerateRequestExceptionsTestCases.ma
p(function(testCase) { |
350 return test_exception(testCase, mediaKeys, '', initData)
; | 359 return test_exception(testCase, mediaKeys, '', initData)
; |
351 }); | 360 }); |
352 | 361 |
353 // Test that WebM sessions generate the expected error, if | 362 // Test that WebM sessions generate the expected error, if |
354 // supported. | 363 // supported. |
355 if (isInitDataTypeSupported('webm')) { | 364 if (isWebmSupported) { |
356 var WebmSessionPromises = kTypeSpecificGenerateRequestEx
ceptionsTestCases.map(function(testCase) { | 365 var WebmSessionPromises = kTypeSpecificGenerateRequestEx
ceptionsTestCases.map(function(testCase) { |
357 return test_exception(testCase, mediaKeys, 'webm', g
etInitData('webm')); | 366 return test_exception(testCase, mediaKeys, 'webm', g
etInitData('webm')); |
358 }); | 367 }); |
359 sessionPromises = sessionPromises.concat(WebmSessionProm
ises); | 368 sessionPromises = sessionPromises.concat(WebmSessionProm
ises); |
360 } | 369 } |
361 | 370 |
362 // Repeat for MP4, if supported. | 371 // Repeat for MP4, if supported. |
363 if (isInitDataTypeSupported('cenc')) { | 372 if (isCencSupported) { |
364 var mp4SessionPromises = kTypeSpecificGenerateRequestExc
eptionsTestCases.map(function(testCase) { | 373 var mp4SessionPromises = kTypeSpecificGenerateRequestExc
eptionsTestCases.map(function(testCase) { |
365 return test_exception(testCase, mediaKeys, 'cenc', g
etInitData('cenc')); | 374 return test_exception(testCase, mediaKeys, 'cenc', g
etInitData('cenc')); |
366 }); | 375 }); |
367 sessionPromises = sessionPromises.concat(mp4SessionPromi
ses); | 376 sessionPromises = sessionPromises.concat(mp4SessionPromi
ses); |
368 } | 377 } |
369 | 378 |
370 assert_not_equals(sessionPromises.length, 0); | 379 assert_not_equals(sessionPromises.length, 0); |
371 return Promise.all(sessionPromises); | 380 return Promise.all(sessionPromises); |
372 }).then(function(result) { | 381 }).then(function(result) { |
373 test.done(); | 382 test.done(); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 try { | 526 try { |
518 var mediaKeySession = testCase.func.call(null, mediaKeys); | 527 var mediaKeySession = testCase.func.call(null, mediaKeys); |
519 return mediaKeySession.generateRequest(type, initData); | 528 return mediaKeySession.generateRequest(type, initData); |
520 } catch (e) { | 529 } catch (e) { |
521 assert_true(testCase.isNotSupportedAllowed); | 530 assert_true(testCase.isNotSupportedAllowed); |
522 } | 531 } |
523 } | 532 } |
524 | 533 |
525 async_test(function(test) | 534 async_test(function(test) |
526 { | 535 { |
527 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 536 var isWebmSupported; |
| 537 var isCencSupported; |
| 538 |
| 539 isInitDataTypeSupported('webm').then(function(result) { |
| 540 isWebmSupported = result; |
| 541 return isInitDataTypeSupported('cenc'); |
| 542 }).then(function(result) { |
| 543 isCencSupported = result; |
| 544 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 545 }).then(function(access) { |
528 return access.createMediaKeys(); | 546 return access.createMediaKeys(); |
529 }).then(function(mediaKeys) { | 547 }).then(function(mediaKeys) { |
530 var sessionPromises = []; | 548 var sessionPromises = []; |
531 | 549 |
532 // Test that WebM sessions generate the expected error, if | 550 // Test that WebM sessions generate the expected error, if |
533 // supported. | 551 // supported. |
534 if (isInitDataTypeSupported('webm')) { | 552 if (isWebmSupported) { |
535 var WebmSessionPromises = kCreateSessionTestCases.map(fu
nction(testCase) { | 553 var WebmSessionPromises = kCreateSessionTestCases.map(fu
nction(testCase) { |
536 return test_generateRequest(testCase, mediaKeys, 'we
bm', getInitData('webm')); | 554 return test_generateRequest(testCase, mediaKeys, 'we
bm', getInitData('webm')); |
537 }); | 555 }); |
538 sessionPromises = sessionPromises.concat(WebmSessionProm
ises); | 556 sessionPromises = sessionPromises.concat(WebmSessionProm
ises); |
539 } | 557 } |
540 | 558 |
541 // Repeat for MP4, if supported. | 559 // Repeat for MP4, if supported. |
542 if (isInitDataTypeSupported('cenc')) { | 560 if (isCencSupported) { |
543 var mp4SessionPromises = kCreateSessionTestCases.map(fun
ction(testCase) { | 561 var mp4SessionPromises = kCreateSessionTestCases.map(fun
ction(testCase) { |
544 return test_generateRequest(testCase, mediaKeys, 'ce
nc', getInitData('cenc')); | 562 return test_generateRequest(testCase, mediaKeys, 'ce
nc', getInitData('cenc')); |
545 }); | 563 }); |
546 sessionPromises = sessionPromises.concat(mp4SessionPromi
ses); | 564 sessionPromises = sessionPromises.concat(mp4SessionPromi
ses); |
547 } | 565 } |
548 | 566 |
549 assert_not_equals(sessionPromises.length, 0); | 567 assert_not_equals(sessionPromises.length, 0); |
550 return Promise.all(sessionPromises); | 568 return Promise.all(sessionPromises); |
551 }).then(function(result) { | 569 }).then(function(result) { |
552 test.done(); | 570 test.done(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 func: function(s) { return s.update(1); } | 602 func: function(s) { return s.update(1); } |
585 }, | 603 }, |
586 { | 604 { |
587 exception: 'InvalidAccessError', | 605 exception: 'InvalidAccessError', |
588 func: function(s) { return s.update(new Uint8Array(0)); } | 606 func: function(s) { return s.update(new Uint8Array(0)); } |
589 } | 607 } |
590 ]; | 608 ]; |
591 | 609 |
592 async_test(function(test) | 610 async_test(function(test) |
593 { | 611 { |
594 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 612 var isWebmSupported; |
| 613 var isCencSupported; |
| 614 |
| 615 isInitDataTypeSupported('webm').then(function(result) { |
| 616 isWebmSupported = result; |
| 617 return isInitDataTypeSupported('cenc'); |
| 618 }).then(function(result) { |
| 619 isCencSupported = result; |
| 620 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 621 }).then(function(access) { |
595 return access.createMediaKeys(); | 622 return access.createMediaKeys(); |
596 }).then(function(mediaKeys) { | 623 }).then(function(mediaKeys) { |
597 var promises = []; | 624 var promises = []; |
598 | 625 |
599 if (isInitDataTypeSupported('webm')) { | 626 if (isWebmSupported) { |
600 var WebmSessionPromises = kUpdateSessionExceptionsTestCa
ses.map(function(testCase) { | 627 var WebmSessionPromises = kUpdateSessionExceptionsTestCa
ses.map(function(testCase) { |
601 var mediaKeySession = mediaKeys.createSession(); | 628 var mediaKeySession = mediaKeys.createSession(); |
602 return mediaKeySession.generateRequest('webm', getIn
itData('webm')).then(function(result) { | 629 return mediaKeySession.generateRequest('webm', getIn
itData('webm')).then(function(result) { |
603 return test_exception(testCase, mediaKeySession)
; | 630 return test_exception(testCase, mediaKeySession)
; |
604 }); | 631 }); |
605 }); | 632 }); |
606 promises = promises.concat(WebmSessionPromises); | 633 promises = promises.concat(WebmSessionPromises); |
607 } | 634 } |
608 | 635 |
609 if (isInitDataTypeSupported('cenc')) { | 636 if (isCencSupported) { |
610 var mp4SessionPromises = kUpdateSessionExceptionsTestCas
es.map(function(testCase) { | 637 var mp4SessionPromises = kUpdateSessionExceptionsTestCas
es.map(function(testCase) { |
611 var mediaKeySession = mediaKeys.createSession(); | 638 var mediaKeySession = mediaKeys.createSession(); |
612 return mediaKeySession.generateRequest('cenc', getInit
Data('cenc')).then(function(result) { | 639 return mediaKeySession.generateRequest('cenc', getInit
Data('cenc')).then(function(result) { |
613 return test_exception(testCase, mediaKeySession); | 640 return test_exception(testCase, mediaKeySession); |
614 }); | 641 }); |
615 }); | 642 }); |
616 promises = promises.concat(mp4SessionPromises); | 643 promises = promises.concat(mp4SessionPromises); |
617 } | 644 } |
618 | 645 |
619 assert_not_equals(promises.length, 0); | 646 assert_not_equals(promises.length, 0); |
(...skipping 15 matching lines...) Expand all Loading... |
635 // Call update() with a different license and an extra | 662 // Call update() with a different license and an extra |
636 // parameter. The extra parameter is ignored. | 663 // parameter. The extra parameter is ignored. |
637 var validLicense = stringToUint8Array(createJWKSet(createJWK
(stringToUint8Array('4567890'), stringToUint8Array('01234567890abcde')))); | 664 var validLicense = stringToUint8Array(createJWKSet(createJWK
(stringToUint8Array('4567890'), stringToUint8Array('01234567890abcde')))); |
638 return mediaKeySession.update(validLicense, 'extra'); | 665 return mediaKeySession.update(validLicense, 'extra'); |
639 }); | 666 }); |
640 return promise; | 667 return promise; |
641 } | 668 } |
642 | 669 |
643 async_test(function(test) | 670 async_test(function(test) |
644 { | 671 { |
645 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 672 var isWebmSupported; |
| 673 var isCencSupported; |
| 674 |
| 675 isInitDataTypeSupported('webm').then(function(result) { |
| 676 isWebmSupported = result; |
| 677 return isInitDataTypeSupported('cenc'); |
| 678 }).then(function(result) { |
| 679 isCencSupported = result; |
| 680 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 681 }).then(function(access) { |
646 return access.createMediaKeys(); | 682 return access.createMediaKeys(); |
647 }).then(function(mediaKeys) { | 683 }).then(function(mediaKeys) { |
648 var promises = []; | 684 var promises = []; |
649 | 685 |
650 if (isInitDataTypeSupported('webm')) { | 686 if (isWebmSupported) { |
651 promises.push(create_update_test(mediaKeys, 'webm', getIni
tData('webm'))); | 687 promises.push(create_update_test(mediaKeys, 'webm', getIni
tData('webm'))); |
652 } | 688 } |
653 | 689 |
654 if (isInitDataTypeSupported('cenc')) { | 690 if (isCencSupported) { |
655 promises.push(create_update_test(mediaKeys, 'cenc', getIni
tData('cenc'))); | 691 promises.push(create_update_test(mediaKeys, 'cenc', getIni
tData('cenc'))); |
656 } | 692 } |
657 | 693 |
658 assert_not_equals(promises.length, 0); | 694 assert_not_equals(promises.length, 0); |
659 return Promise.all(promises); | 695 return Promise.all(promises); |
660 }).then(function(result) { | 696 }).then(function(result) { |
661 test.done(); | 697 test.done(); |
662 }).catch(function(error) { | 698 }).catch(function(error) { |
663 forceTestFailureFromPromise(test, error, 'update() tests fai
led'); | 699 forceTestFailureFromPromise(test, error, 'update() tests fai
led'); |
664 }); | 700 }); |
665 }, 'Test MediaKeySession update().'); | 701 }, 'Test MediaKeySession update().'); |
666 | 702 |
667 function create_close_exception_test(mediaKeys, type, initData) | 703 function create_close_exception_test(mediaKeys, type, initData) |
668 { | 704 { |
669 var mediaKeySession = mediaKeys.createSession(); | 705 var mediaKeySession = mediaKeys.createSession(); |
670 return mediaKeySession.close().then(function(result) { | 706 return mediaKeySession.close().then(function(result) { |
671 assert_unreached('close() should not succeed if session unin
itialized'); | 707 assert_unreached('close() should not succeed if session unin
itialized'); |
672 }).catch(function(error) { | 708 }).catch(function(error) { |
673 assert_equals(error.name, 'InvalidStateError'); | 709 assert_equals(error.name, 'InvalidStateError'); |
674 // Return something so the promise resolves. | 710 // Return something so the promise resolves. |
675 return Promise.resolve(); | 711 return Promise.resolve(); |
676 }); | 712 }); |
677 } | 713 } |
678 | 714 |
679 async_test(function(test) | 715 async_test(function(test) |
680 { | 716 { |
681 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 717 var isWebmSupported; |
| 718 var isCencSupported; |
| 719 |
| 720 isInitDataTypeSupported('webm').then(function(result) { |
| 721 isWebmSupported = result; |
| 722 return isInitDataTypeSupported('cenc'); |
| 723 }).then(function(result) { |
| 724 isCencSupported = result; |
| 725 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 726 }).then(function(access) { |
682 return access.createMediaKeys(); | 727 return access.createMediaKeys(); |
683 }).then(function(mediaKeys) { | 728 }).then(function(mediaKeys) { |
684 var promises = []; | 729 var promises = []; |
685 | 730 |
686 if (isInitDataTypeSupported('webm')) { | 731 if (isWebmSupported) { |
687 promises.push(create_close_exception_test(mediaKeys, 'we
bm', getInitData('webm'))); | 732 promises.push(create_close_exception_test(mediaKeys, 'we
bm', getInitData('webm'))); |
688 } | 733 } |
689 | 734 |
690 if (isInitDataTypeSupported('cenc')) { | 735 if (isCencSupported) { |
691 promises.push(create_close_exception_test(mediaKeys, 'ce
nc', getInitData('cenc'))); | 736 promises.push(create_close_exception_test(mediaKeys, 'ce
nc', getInitData('cenc'))); |
692 } | 737 } |
693 | 738 |
694 assert_not_equals(promises.length, 0); | 739 assert_not_equals(promises.length, 0); |
695 return Promise.all(promises); | 740 return Promise.all(promises); |
696 }).then(function(result) { | 741 }).then(function(result) { |
697 test.done(); | 742 test.done(); |
698 }).catch(function(error) { | 743 }).catch(function(error) { |
699 forceTestFailureFromPromise(test, error, 'close() exception
tests failed'); | 744 forceTestFailureFromPromise(test, error, 'close() exception
tests failed'); |
700 }); | 745 }); |
701 }, 'Test MediaKeySession close() exceptions.'); | 746 }, 'Test MediaKeySession close() exceptions.'); |
702 | 747 |
703 | 748 |
704 function create_close_test(mediaKeys, type, initData) | 749 function create_close_test(mediaKeys, type, initData) |
705 { | 750 { |
706 var mediaKeySession = mediaKeys.createSession(); | 751 var mediaKeySession = mediaKeys.createSession(); |
707 var promise = mediaKeySession.generateRequest(type, initData).th
en(function(result) { | 752 var promise = mediaKeySession.generateRequest(type, initData).th
en(function(result) { |
708 return mediaKeySession.close(); | 753 return mediaKeySession.close(); |
709 }).then(function(result) { | 754 }).then(function(result) { |
710 // Call close() again with an extra parameter. The extra | 755 // Call close() again with an extra parameter. The extra |
711 // parameter is ignored. | 756 // parameter is ignored. |
712 return mediaKeySession.close('extra'); | 757 return mediaKeySession.close('extra'); |
713 }); | 758 }); |
714 return promise; | 759 return promise; |
715 } | 760 } |
716 | 761 |
717 async_test(function(test) | 762 async_test(function(test) |
718 { | 763 { |
719 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 764 var isWebmSupported; |
| 765 var isCencSupported; |
| 766 |
| 767 isInitDataTypeSupported('webm').then(function(result) { |
| 768 isWebmSupported = result; |
| 769 return isInitDataTypeSupported('cenc'); |
| 770 }).then(function(result) { |
| 771 isCencSupported = result; |
| 772 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 773 }).then(function(access) { |
720 return access.createMediaKeys(); | 774 return access.createMediaKeys(); |
721 }).then(function(mediaKeys) { | 775 }).then(function(mediaKeys) { |
722 var promises = []; | 776 var promises = []; |
723 | 777 |
724 if (isInitDataTypeSupported('webm')) { | 778 if (isWebmSupported) { |
725 promises.push(create_close_test(mediaKeys, 'webm', getIn
itData('webm'))); | 779 promises.push(create_close_test(mediaKeys, 'webm', getIn
itData('webm'))); |
726 } | 780 } |
727 | 781 |
728 if (isInitDataTypeSupported('cenc')) { | 782 if (isCencSupported) { |
729 promises.push(create_close_test(mediaKeys, 'cenc', getIn
itData('cenc'))); | 783 promises.push(create_close_test(mediaKeys, 'cenc', getIn
itData('cenc'))); |
730 } | 784 } |
731 | 785 |
732 assert_not_equals(promises.length, 0); | 786 assert_not_equals(promises.length, 0); |
733 return Promise.all(promises); | 787 return Promise.all(promises); |
734 }).then(function(result) { | 788 }).then(function(result) { |
735 test.done(); | 789 test.done(); |
736 }).catch(function(error) { | 790 }).catch(function(error) { |
737 forceTestFailureFromPromise(test, error, 'close() tests fail
ed'); | 791 forceTestFailureFromPromise(test, error, 'close() tests fail
ed'); |
738 }); | 792 }); |
(...skipping 14 matching lines...) Expand all Loading... |
753 return mediaKeySession.remove(); | 807 return mediaKeySession.remove(); |
754 }).then(function(result) { | 808 }).then(function(result) { |
755 assert_unreached('remove() should not succeed for temporary
sessions'); | 809 assert_unreached('remove() should not succeed for temporary
sessions'); |
756 }, function(error) { | 810 }, function(error) { |
757 assert_equals(error.name, 'InvalidAccessError'); | 811 assert_equals(error.name, 'InvalidAccessError'); |
758 }); | 812 }); |
759 } | 813 } |
760 | 814 |
761 async_test(function(test) | 815 async_test(function(test) |
762 { | 816 { |
763 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 817 var isWebmSupported; |
| 818 var isCencSupported; |
| 819 |
| 820 isInitDataTypeSupported('webm').then(function(result) { |
| 821 isWebmSupported = result; |
| 822 return isInitDataTypeSupported('cenc'); |
| 823 }).then(function(result) { |
| 824 isCencSupported = result; |
| 825 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 826 }).then(function(access) { |
764 return access.createMediaKeys(); | 827 return access.createMediaKeys(); |
765 }).then(function(mediaKeys) { | 828 }).then(function(mediaKeys) { |
766 var promises = []; | 829 var promises = []; |
767 | 830 |
768 if (isInitDataTypeSupported('webm')) { | 831 if (isWebmSupported) { |
769 promises.push(create_remove_exception_test(mediaKeys, 'w
ebm', getInitData('webm'))); | 832 promises.push(create_remove_exception_test(mediaKeys, 'w
ebm', getInitData('webm'))); |
770 } | 833 } |
771 | 834 |
772 if (isInitDataTypeSupported('cenc')) { | 835 if (isCencSupported) { |
773 promises.push(create_remove_exception_test(mediaKeys, 'c
enc', getInitData('cenc'))); | 836 promises.push(create_remove_exception_test(mediaKeys, 'c
enc', getInitData('cenc'))); |
774 } | 837 } |
775 | 838 |
776 assert_not_equals(promises.length, 0); | 839 assert_not_equals(promises.length, 0); |
777 return Promise.all(promises); | 840 return Promise.all(promises); |
778 }).then(function(result) { | 841 }).then(function(result) { |
779 test.done(); | 842 test.done(); |
780 }).catch(function(error) { | 843 }).catch(function(error) { |
781 forceTestFailureFromPromise(test, error, 'remove() exception
tests failed'); | 844 forceTestFailureFromPromise(test, error, 'remove() exception
tests failed'); |
782 }); | 845 }); |
(...skipping 10 matching lines...) Expand all Loading... |
793 assert_equals(error.name, 'NotSupportedError'); | 856 assert_equals(error.name, 'NotSupportedError'); |
794 return Promise.resolve(); | 857 return Promise.resolve(); |
795 } | 858 } |
796 return mediaKeySession.generateRequest(type, initData).then(func
tion(result) { | 859 return mediaKeySession.generateRequest(type, initData).then(func
tion(result) { |
797 return mediaKeySession.remove(); | 860 return mediaKeySession.remove(); |
798 }); | 861 }); |
799 } | 862 } |
800 | 863 |
801 async_test(function(test) | 864 async_test(function(test) |
802 { | 865 { |
803 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 866 var isWebmSupported; |
| 867 var isCencSupported; |
| 868 |
| 869 isInitDataTypeSupported('webm').then(function(result) { |
| 870 isWebmSupported = result; |
| 871 return isInitDataTypeSupported('cenc'); |
| 872 }).then(function(result) { |
| 873 isCencSupported = result; |
| 874 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); |
| 875 }).then(function(access) { |
804 return access.createMediaKeys(); | 876 return access.createMediaKeys(); |
805 }).then(function(mediaKeys) { | 877 }).then(function(mediaKeys) { |
806 var promises = []; | 878 var promises = []; |
807 | 879 |
808 if (isInitDataTypeSupported('webm')) { | 880 if (isWebmSupported) { |
809 promises.push(create_remove_test(mediaKeys, 'webm', getI
nitData('webm'))); | 881 promises.push(create_remove_test(mediaKeys, 'webm', getI
nitData('webm'))); |
810 } | 882 } |
811 | 883 |
812 if (isInitDataTypeSupported('cenc')) { | 884 if (isCencSupported) { |
813 promises.push(create_remove_test(mediaKeys, 'cenc', getI
nitData('cenc'))); | 885 promises.push(create_remove_test(mediaKeys, 'cenc', getI
nitData('cenc'))); |
814 } | 886 } |
815 | 887 |
816 assert_not_equals(promises.length, 0); | 888 assert_not_equals(promises.length, 0); |
817 return Promise.all(promises); | 889 return Promise.all(promises); |
818 }).then(function(result) { | 890 }).then(function(result) { |
819 test.done(); | 891 test.done(); |
820 }).catch(function(error) { | 892 }).catch(function(error) { |
821 forceTestFailureFromPromise(test, error, 'remove() tests fai
led'); | 893 forceTestFailureFromPromise(test, error, 'remove() tests fai
led'); |
822 }); | 894 }); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 | 954 |
883 // FIXME: Add test for successful setServerCertificate(). Note that | 955 // FIXME: Add test for successful setServerCertificate(). Note that |
884 // Clear Key does not support it. | 956 // Clear Key does not support it. |
885 | 957 |
886 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported(). | 958 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported(). |
887 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev
ents. | 959 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev
ents. |
888 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med
iakeys, onencrypted. | 960 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med
iakeys, onencrypted. |
889 </script> | 961 </script> |
890 </body> | 962 </body> |
891 </html> | 963 </html> |
OLD | NEW |