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: LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html

Issue 563083002: Implement MediaKeys.setServerCertificate() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 2 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 | « no previous file | Source/modules/encryptedmedia/MediaKeys.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 assert_not_equals(promises.length, 0); 583 assert_not_equals(promises.length, 0);
584 return Promise.all(promises); 584 return Promise.all(promises);
585 }).then(function(result) { 585 }).then(function(result) {
586 test.done(); 586 test.done();
587 }).catch(function(error) { 587 }).catch(function(error) {
588 forceTestFailureFromPromise(test, error, 'release() tests fa iled'); 588 forceTestFailureFromPromise(test, error, 'release() tests fa iled');
589 }); 589 });
590 }, 'Test MediaKeySession release().'); 590 }, 'Test MediaKeySession release().');
591 591
592 var kSetServerCertificateExceptionsTestCases = [
593 // Too few parameters.
594 {
595 exception: 'TypeError',
596 func: function(mk) { return mk.setServerCertificate(); }
597 },
598 // Invalid parameters.
599 {
600 exception: 'TypeError',
601 func: function(mk) { return mk.setServerCertificate(''); }
602 },
603 {
604 exception: 'TypeError',
605 func: function(mk) { return mk.setServerCertificate(null); }
606 },
607 {
608 exception: 'TypeError',
609 func: function(mk) { return mk.setServerCertificate(undefine d); }
610 },
611 {
612 exception: 'TypeError',
613 func: function(mk) { return mk.setServerCertificate(1); }
614 },
615 // Empty array.
616 {
617 exception: 'InvalidAccessError',
618 func: function(mk) { return mk.setServerCertificate(new Uint 8Array(0)); }
619 },
620 // Valid calls, but not supported by ClearKey.
621 {
622 exception: 'NotSupportedError',
623 func: function(mk) { var cert = new Uint8Array(200); assert_ true(ArrayBuffer.isView(cert)); return mk.setServerCertificate(cert); }
624 },
625 {
626 // Pass in ArrayBuffer
627 exception: 'NotSupportedError',
628 func: function(mk) { var cert = new Uint8Array(200); assert_ false(ArrayBuffer.isView(cert.buffer)); return mk.setServerCertificate(cert.buff er); }
629 }
630 ];
631
632 async_test(function(test)
633 {
634 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
635 var promises = kSetServerCertificateExceptionsTestCases.map( function(testCase) {
636 return test_exception(testCase, mediaKeys);
637 });
638
639 assert_not_equals(promises.length, 0);
640 return Promise.all(promises);
641 }).then(function(result) {
642 test.done();
643 }).catch(function(error) {
644 forceTestFailureFromPromise(test, error, 'setServerCertifica te() exception tests failed');
645 });
646 }, 'Test MediaKeys setServerCertificate() exceptions.');
647
648 // FIXME: Add test for successful setServerCertificate(). Note that
649 // ClearKey does not support it.
650
592 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported(). 651 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported().
593 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev ents. 652 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev ents.
594 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med iakeys, onencrypted. 653 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med iakeys, onencrypted.
595 </script> 654 </script>
596 </body> 655 </body>
597 </html> 656 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/encryptedmedia/MediaKeys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698