OLD | NEW |
(Empty) | |
| 1 function runTest( config, qualifier ) |
| 2 { |
| 3 function checkInitDataType(initDataType) |
| 4 { |
| 5 return isInitDataTypeSupported(initDataType).then(function(result) { |
| 6 // If |initDataType| is not supported, simply succeed. |
| 7 if (!result) |
| 8 return Promise.resolve('Not supported'); |
| 9 |
| 10 return navigator.requestMediaKeySystemAccess( config.keysystem, getS
impleConfigurationForInitDataType(initDataType)) |
| 11 .then(function(access) { |
| 12 return access.createMediaKeys(); |
| 13 }).then(function(mediaKeys) { |
| 14 var mediaKeySession = mediaKeys.createSession(); |
| 15 var initData = getInitData(initDataType); |
| 16 return mediaKeySession.generateRequest(initDataType, initDat
a); |
| 17 }); |
| 18 }); |
| 19 } |
| 20 |
| 21 promise_test(function() |
| 22 { |
| 23 return checkInitDataType('webm'); |
| 24 }, testnamePrefix( qualifier, config.keysystem ) + ' support for "webm".'); |
| 25 |
| 26 promise_test(function() |
| 27 { |
| 28 return checkInitDataType('cenc'); |
| 29 }, testnamePrefix( qualifier, config.keysystem ) + ' support for "cenc".'); |
| 30 |
| 31 promise_test(function() |
| 32 { |
| 33 return checkInitDataType('keyids'); |
| 34 }, testnamePrefix( qualifier, config.keysystem ) + ' support for "keyids".')
; |
| 35 } |
OLD | NEW |