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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-update-disallowed-input.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>Test handling of invalid responses for update().</title> 4 <title>Test handling of invalid responses for update().</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 // This test passes |response| to update() as a JSON Web Key Set. 12 // This test passes |response| to update() as a JSON Web Key Set.
13 // CDMs other than Clear Key won't expect |response| in this format. 13 // CDMs other than Clear Key won't expect |response| in this format.
14 14
15 async_test(function(test) 15 async_test(function(test)
16 { 16 {
17 var initDataType; 17 var initDataType;
18 var initData;
18 var mediaKeySession; 19 var mediaKeySession;
19 20
20 function repeat(pattern, count) { 21 function repeat(pattern, count) {
21 var result = ''; 22 var result = '';
22 while (count > 1) { 23 while (count > 1) {
23 if (count & 1) result += pattern; 24 if (count & 1) result += pattern;
24 count >>= 1; 25 count >>= 1;
25 pattern += pattern; 26 pattern += pattern;
26 } 27 }
27 return result + pattern; 28 return result + pattern;
(...skipping 18 matching lines...) Expand all
46 assert_greater_than(jwkSet.length, 65536); 47 assert_greater_than(jwkSet.length, 65536);
47 var jwkSetArray = stringToUint8Array(jwkSet); 48 var jwkSetArray = stringToUint8Array(jwkSet);
48 mediaKeySession.update(jwkSetArray).then(function() { 49 mediaKeySession.update(jwkSetArray).then(function() {
49 forceTestFailureFromPromise(test, 'Error: update() succe eded'); 50 forceTestFailureFromPromise(test, 'Error: update() succe eded');
50 }, function(error) { 51 }, function(error) {
51 assert_equals(error.name, 'InvalidAccessError'); 52 assert_equals(error.name, 'InvalidAccessError');
52 test.done(); 53 test.done();
53 }); 54 });
54 } 55 }
55 56
56 getSupportedInitDataType().then(function(type) { 57 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp leConfiguration()).then(function(access) {
57 initDataType = type; 58 initDataType = access.getConfiguration().initDataTypes[0];
58 return navigator.requestMediaKeySystemAccess('org.w3.clearke y', [{}]); 59 initData = getInitData(initDataType);
59 }).then(function(access) {
60 return access.createMediaKeys(); 60 return access.createMediaKeys();
61 }).then(function(mediaKeys) { 61 }).then(function(mediaKeys) {
62 mediaKeySession = mediaKeys.createSession(); 62 mediaKeySession = mediaKeys.createSession();
63 waitForEventAndRunStep('message', mediaKeySession, processMe ssage, test); 63 waitForEventAndRunStep('message', mediaKeySession, processMe ssage, test);
64 return mediaKeySession.generateRequest(initDataType, getInit Data(initDataType)); 64 return mediaKeySession.generateRequest(initDataType, initDat a);
65 }); 65 });
66 }, 'update() with response longer than 64Kb characters.'); 66 }, 'update() with response longer than 64Kb characters.');
67 </script> 67 </script>
68 </body> 68 </body>
69 </html> 69 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698