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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-syntax.html

Issue 2354083003: media: Change MediaKeyMessageEventInit to require both attributes (Closed)
Patch Set: Created 4 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 | third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEventInit.idl » ('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 <script> 10 <script>
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 assert_not_equals(promises.length, 0); 994 assert_not_equals(promises.length, 0);
995 return Promise.all(promises); 995 return Promise.all(promises);
996 }).then(function(result) { 996 }).then(function(result) {
997 assert_array_equals(result, expected_result); 997 assert_array_equals(result, expected_result);
998 test.done(); 998 test.done();
999 }).catch(function(error) { 999 }).catch(function(error) {
1000 forceTestFailureFromPromise(test, error, 'setServerCertifica te() test failed'); 1000 forceTestFailureFromPromise(test, error, 'setServerCertifica te() test failed');
1001 }); 1001 });
1002 }, 'Test MediaKeys setServerCertificate().'); 1002 }, 'Test MediaKeys setServerCertificate().');
1003 1003
1004 function test_valid_message_type(message_type)
1005 {
1006 var event = new MediaKeyMessageEvent('eventType', { messageType: message_type, message: new ArrayBuffer(0) } );
1007 assert_equals(message_type, event.messageType);
foolip 2016/09/21 08:32:07 testharness.js uses the order actual, expected, so
jrummell 2016/09/22 20:12:24 Done.
1008 }
1009
1010 async_test(function(test)
1011 {
1012 // Valid MediaKeyMessageType values.
1013 test_valid_message_type('license-request');
1014 test_valid_message_type('license-renewal');
1015 test_valid_message_type('license-release');
1016 // TODO(jrummell): Add 'individualization-request' if the final
1017 // spec includes it. http://crbug.com/628437.
1018
1019 // Invalid MediaKeyMessageType values should throw a TypeError.
foolip 2016/09/21 08:32:07 assert_throws(new TypeError, function() { new Me
jrummell 2016/09/22 20:12:24 Done.
1020 try {
1021 var event = new MediaKeyMessageEvent('eventType', { messageT ype: 'something-else', message: new ArrayBuffer(0) } );
1022 assert_unreached('MediaKeyMessageEvent with invalid messageT ype should not be created.');
1023 } catch (error) {
1024 assert_equals('TypeError', error.name);
1025 }
1026
1027 // Missing required values should throw a TypeError.
foolip 2016/09/21 08:32:07 assert_throws for these too.
jrummell 2016/09/22 20:12:24 Done.
1028 try {
1029 var event = new MediaKeyMessageEvent('eventType', { message: new ArrayBuffer(0) } );
1030 assert_unreached('MediaKeyMessageEvent with missing messageT ype should not be created.');
1031 } catch (error) {
1032 assert_equals('TypeError', error.name);
1033 }
1034 try {
1035 var event = new MediaKeyMessageEvent('eventType', { messageT ype: 'license-request' } );
1036 assert_unreached('MediaKeyMessageEvent with missing message should not be created.');
1037 } catch (error) {
1038 assert_equals('TypeError', error.name);
1039 }
1040
1041 test.done();
foolip 2016/09/21 08:32:07 This can be a sync test if you drop this and just
jrummell 2016/09/22 20:12:24 Done. Was just copying the pattern used for the ot
1042 }, 'Test MediaKeyMessageEvent.');
1004 1043
1005 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported(). 1044 // FIXME: Add syntax checks for MediaKeys.IsTypeSupported().
1006 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev ents. 1045 // FIXME: Add syntax checks for MediaKeyError and MediaKeySession ev ents.
1007 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med iakeys, onencrypted. 1046 // FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, med iakeys, onencrypted.
1008 </script> 1047 </script>
1009 </body> 1048 </body>
1010 </html> 1049 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEventInit.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698