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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-clear-key-invalid-license.html

Issue 2084053002: EME: Update tests so 'audioCapabilities' always provided (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes (+rebase) Created 4 years, 5 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Invalid Clear Key License.</title> 4 <title>Invalid Clear Key License.</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>
11 <script> 11 <script>
12 async_test(function(test) 12 async_test(function(test)
13 { 13 {
14 var initDataType; 14 var initDataType;
15 var initData; 15 var initData;
16 var invalidLicense = new Uint8Array( 16 var invalidLicense = new Uint8Array(
17 [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77]); 17 [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77]);
18 18
19 function handleMessage(event) { 19 function handleMessage(event) {
20 event.target.update(invalidLicense).then(function(event) { 20 event.target.update(invalidLicense).then(function(event) {
21 assert_unreached('Error: update() succeeded unexpectedly .'); 21 assert_unreached('Error: update() succeeded unexpectedly .');
22 test.done(); 22 test.done();
23 }).catch(function(error) { 23 }).catch(function(error) {
24 assert_equals(error.name, 'InvalidAccessError'); 24 assert_equals(error.name, 'InvalidAccessError');
25 test.done(); 25 test.done();
26 }); 26 });
27 } 27 }
28 28
29 getSupportedInitDataType().then(function(type) { 29 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp leConfiguration()).then(function(access) {
30 initDataType = type; 30 initDataType = access.getConfiguration().initDataTypes[0];
31 initData = getInitData(initDataType); 31 initData = getInitData(initDataType);
32 return navigator.requestMediaKeySystemAccess('org.w3.clearke y', [{}]);
33 }).then(function(access) {
34 return access.createMediaKeys(); 32 return access.createMediaKeys();
35 }).then(function(mediaKeys) { 33 }).then(function(mediaKeys) {
36 var keySession = mediaKeys.createSession(); 34 var keySession = mediaKeys.createSession();
37 keySession.addEventListener('message', handleMessage, false) ; 35 keySession.addEventListener('message', handleMessage, false) ;
38 keySession.generateRequest(initDataType, initData); 36 keySession.generateRequest(initDataType, initData);
39 }).catch(function(error) { 37 }).catch(function(error) {
40 forceTestFailureFromPromise(test, error); 38 forceTestFailureFromPromise(test, error);
41 }); 39 });
42 }, 'Invalid Clear Key License.'); 40 }, 'Invalid Clear Key License.');
43 </script> 41 </script>
44 </body> 42 </body>
45 </html> 43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698