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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 }).catch(function(error) { | 469 }).catch(function(error) { |
470 forceTestFailureFromPromise(test, error, 'update() tests fai
led'); | 470 forceTestFailureFromPromise(test, error, 'update() tests fai
led'); |
471 }); | 471 }); |
472 }, 'Test MediaKeySession update() exceptions.'); | 472 }, 'Test MediaKeySession update() exceptions.'); |
473 | 473 |
474 function create_update_test(mediaKeys, type, initData) | 474 function create_update_test(mediaKeys, type, initData) |
475 { | 475 { |
476 var mediaKeySession; | 476 var mediaKeySession; |
477 var promise = mediaKeys.createSession(type, initData).then(funct
ion(result) { | 477 var promise = mediaKeys.createSession(type, initData).then(funct
ion(result) { |
478 mediaKeySession = result; | 478 mediaKeySession = result; |
479 var validLicense = stringToUint8Array(createJWKSet(createJWK
(stringToUint8Array('123'), stringToUint8Array('1234567890abcdef')))); | 479 var validLicense = stringToUint8Array(createJWKSet(createJWK
('123', stringToUint8Array('1234567890abcdef')))); |
480 return mediaKeySession.update(validLicense); | 480 return mediaKeySession.update(validLicense); |
481 }).then(function(result) { | 481 }).then(function(result) { |
482 // Call update() with a different license and an extra | 482 // Call update() with a different license and an extra |
483 // parameter. The extra parameter is ignored. | 483 // parameter. The extra parameter is ignored. |
484 var validLicense = stringToUint8Array(createJWKSet(createJWK
(stringToUint8Array('4567890'), stringToUint8Array('01234567890abcde')))); | 484 var validLicense = stringToUint8Array(createJWKSet(createJWK
('4567890', stringToUint8Array('01234567890abcde')))); |
485 return mediaKeySession.update(validLicense, 'extra'); | 485 return mediaKeySession.update(validLicense, 'extra'); |
486 }); | 486 }); |
487 return promise; | 487 return promise; |
488 } | 488 } |
489 | 489 |
490 async_test(function(test) | 490 async_test(function(test) |
491 { | 491 { |
492 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { | 492 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { |
493 var promises = []; | 493 var promises = []; |
494 | 494 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 forceTestFailureFromPromise(test, error, 'release() tests fa
iled'); | 545 forceTestFailureFromPromise(test, error, 'release() tests fa
iled'); |
546 }); | 546 }); |
547 }, 'Test MediaKeySession release().'); | 547 }, 'Test MediaKeySession release().'); |
548 | 548 |
549 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported(). | 549 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported(). |
550 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev
ents. | 550 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev
ents. |
551 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med
iakeys, onneedkey. | 551 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med
iakeys, onneedkey. |
552 </script> | 552 </script> |
553 </body> | 553 </body> |
554 </html> | 554 </html> |
OLD | NEW |