| OLD | NEW |
| 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 <script> | 10 <script> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 function processMessage(event) | 43 function processMessage(event) |
| 44 { | 44 { |
| 45 var jwkSet = createReallyLongJWKSet(); | 45 var jwkSet = createReallyLongJWKSet(); |
| 46 assert_greater_than(jwkSet.length, 65536); | 46 assert_greater_than(jwkSet.length, 65536); |
| 47 var jwkSetArray = stringToUint8Array(jwkSet); | 47 var jwkSetArray = stringToUint8Array(jwkSet); |
| 48 mediaKeySession.update(jwkSetArray).then(function() { | 48 mediaKeySession.update(jwkSetArray).then(function() { |
| 49 forceTestFailureFromPromise(test, 'Error: update() succe
eded'); | 49 forceTestFailureFromPromise(test, 'Error: update() succe
eded'); |
| 50 }, function(error) { | 50 }, function(error) { |
| 51 assert_equals(error.name, 'InvalidAccessError'); | 51 assert_equals(error.name, 'TypeError'); |
| 52 test.done(); | 52 test.done(); |
| 53 }); | 53 }); |
| 54 } | 54 } |
| 55 | 55 |
| 56 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { | 56 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { |
| 57 initDataType = access.getConfiguration().initDataTypes[0]; | 57 initDataType = access.getConfiguration().initDataTypes[0]; |
| 58 initData = getInitData(initDataType); | 58 initData = getInitData(initDataType); |
| 59 return access.createMediaKeys(); | 59 return access.createMediaKeys(); |
| 60 }).then(function(mediaKeys) { | 60 }).then(function(mediaKeys) { |
| 61 mediaKeySession = mediaKeys.createSession(); | 61 mediaKeySession = mediaKeys.createSession(); |
| 62 waitForEventAndRunStep('message', mediaKeySession, processMe
ssage, test); | 62 waitForEventAndRunStep('message', mediaKeySession, processMe
ssage, test); |
| 63 return mediaKeySession.generateRequest(initDataType, initDat
a); | 63 return mediaKeySession.generateRequest(initDataType, initDat
a); |
| 64 }); | 64 }); |
| 65 }, 'update() with response longer than 64Kb characters.'); | 65 }, 'update() with response longer than 64Kb characters.'); |
| 66 </script> | 66 </script> |
| 67 </body> | 67 </body> |
| 68 </html> | 68 </html> |
| OLD | NEW |