| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test Clear Key handling of non-ASCII responses for update().</tit
le> | 4 <title>Test Clear Key handling of non-ASCII responses for update().</tit
le> |
| 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 10 matching lines...) Expand all Loading... |
| 21 { | 21 { |
| 22 // |jwkSet| includes some non-ASCII characters. | 22 // |jwkSet| includes some non-ASCII characters. |
| 23 var jwkSet = '{"keys":[{' | 23 var jwkSet = '{"keys":[{' |
| 24 + '"kty":"oct\uDC00\uD800",' | 24 + '"kty":"oct\uDC00\uD800",' |
| 25 + '"k":"MDEyMzQ1Njc4OTAxMjM0NQ",' | 25 + '"k":"MDEyMzQ1Njc4OTAxMjM0NQ",' |
| 26 + '"kid":"MDEyMzQ1Njc4OTAxMjM0NQ"' | 26 + '"kid":"MDEyMzQ1Njc4OTAxMjM0NQ"' |
| 27 + '\xff\xfe}]'; | 27 + '\xff\xfe}]'; |
| 28 mediaKeySession.update(stringToUint8Array(jwkSet)).then(func
tion() { | 28 mediaKeySession.update(stringToUint8Array(jwkSet)).then(func
tion() { |
| 29 forceTestFailureFromPromise(test, 'Error: update() succe
eded'); | 29 forceTestFailureFromPromise(test, 'Error: update() succe
eded'); |
| 30 }, function(error) { | 30 }, function(error) { |
| 31 assert_equals(error.name, 'InvalidAccessError'); | 31 assert_equals(error.name, 'TypeError'); |
| 32 test.done(); | 32 test.done(); |
| 33 }); | 33 }); |
| 34 } | 34 } |
| 35 | 35 |
| 36 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { | 36 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { |
| 37 initDataType = access.getConfiguration().initDataTypes[0]; | 37 initDataType = access.getConfiguration().initDataTypes[0]; |
| 38 initData = getInitData(initDataType); | 38 initData = getInitData(initDataType); |
| 39 return access.createMediaKeys(); | 39 return access.createMediaKeys(); |
| 40 }).then(function(mediaKeys) { | 40 }).then(function(mediaKeys) { |
| 41 mediaKeySession = mediaKeys.createSession(); | 41 mediaKeySession = mediaKeys.createSession(); |
| 42 waitForEventAndRunStep('message', mediaKeySession, processMe
ssage, test); | 42 waitForEventAndRunStep('message', mediaKeySession, processMe
ssage, test); |
| 43 return mediaKeySession.generateRequest(initDataType, initDat
a); | 43 return mediaKeySession.generateRequest(initDataType, initDat
a); |
| 44 }); | 44 }); |
| 45 }, 'Clear Key update() with non-ASCII response.'); | 45 }, 'Clear Key update() with non-ASCII response.'); |
| 46 </script> | 46 </script> |
| 47 </body> | 47 </body> |
| 48 </html> | 48 </html> |
| OLD | NEW |