| OLD | NEW |
| 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> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 getSupportedInitDataType().then(function(type) { |
| 30 initDataType = type; | 30 initDataType = type; |
| 31 initData = getInitData(initDataType); | 31 initData = getInitData(initDataType); |
| 32 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); | 32 return requestClearKeySystemAccessForInitType(initDataType); |
| 33 }).then(function(access) { | 33 }).then(function(access) { |
| 34 return access.createMediaKeys(); | 34 return access.createMediaKeys(); |
| 35 }).then(function(mediaKeys) { | 35 }).then(function(mediaKeys) { |
| 36 var keySession = mediaKeys.createSession(); | 36 var keySession = mediaKeys.createSession(); |
| 37 keySession.addEventListener('message', handleMessage, false)
; | 37 keySession.addEventListener('message', handleMessage, false)
; |
| 38 keySession.generateRequest(initDataType, initData); | 38 keySession.generateRequest(initDataType, initData); |
| 39 }).catch(function(error) { | 39 }).catch(function(error) { |
| 40 forceTestFailureFromPromise(test, error); | 40 forceTestFailureFromPromise(test, error); |
| 41 }); | 41 }); |
| 42 }, 'Invalid Clear Key License.'); | 42 }, 'Invalid Clear Key License.'); |
| 43 </script> | 43 </script> |
| 44 </body> | 44 </body> |
| 45 </html> | 45 </html> |
| OLD | NEW |