Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Test multiple calls to MediaKeySession.close()</title> | |
|
xhwang
2016/12/07 06:51:42
Please add a reference to the spec bug.
jrummell
2016/12/07 22:26:50
Done (in comments below).
| |
| 5 <script src="encrypted-media-utils.js"></script> | |
| 6 <script src="../../resources/testharness.js"></script> | |
| 7 <script src="../../resources/testharnessreport.js"></script> | |
| 8 </head> | |
| 9 <body> | |
| 10 <script> | |
| 11 async_test(function(test) | |
| 12 { | |
| 13 var initDataType; | |
| 14 var initData; | |
| 15 var mediaKeySession; | |
| 16 | |
| 17 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp leConfiguration()).then(function(access) { | |
| 18 initDataType = access.getConfiguration().initDataTypes[0]; | |
| 19 initData = getInitData(initDataType); | |
| 20 return access.createMediaKeys(); | |
| 21 }).then(function(mediaKeys) { | |
| 22 mediaKeySession = mediaKeys.createSession(); | |
| 23 return mediaKeySession.generateRequest(initDataType, initDat a); | |
| 24 }).then(function() { | |
| 25 // Call close() multiple times. | |
| 26 return Promise.all([mediaKeySession.close(), mediaKeySession .close(), mediaKeySession.close()]); | |
| 27 }).then(function() { | |
| 28 test.done(); | |
| 29 }).catch(function(error) { | |
| 30 forceTestFailureFromPromise(test, error); | |
| 31 }); | |
| 32 }, 'Test multiple calls to MediaKeySession.close().'); | |
| 33 </script> | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |