| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Verify MediaKeySession.keyStatuses</title> | 4 <title>Verify MediaKeySession.keyStatuses</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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 else | 143 else |
| 144 { | 144 { |
| 145 // The second keystatuseschange (caused by close()) | 145 // The second keystatuseschange (caused by close()) |
| 146 // should not have any keys. | 146 // should not have any keys. |
| 147 assert_equals(mediaKeySession.keyStatuses.size, 0); | 147 assert_equals(mediaKeySession.keyStatuses.size, 0); |
| 148 test.done(); | 148 test.done(); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 | 151 |
| 152 getSupportedInitDataType().then(function(type) { | 152 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { |
| 153 initDataType = type; | 153 initDataType = access.getConfiguration().initDataTypes[0]; |
| 154 initData = getInitData(initDataType); | 154 initData = getInitData(initDataType); |
| 155 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); | |
| 156 }).then(function(access) { | |
| 157 return access.createMediaKeys(); | 155 return access.createMediaKeys(); |
| 158 }).then(function(mediaKeys) { | 156 }).then(function(mediaKeys) { |
| 159 mediaKeySession = mediaKeys.createSession(); | 157 mediaKeySession = mediaKeys.createSession(); |
| 160 | 158 |
| 161 // There should be no keys defined yet. | 159 // There should be no keys defined yet. |
| 162 assert_equals(mediaKeySession.keyStatuses.size, 0); | 160 assert_equals(mediaKeySession.keyStatuses.size, 0); |
| 163 | 161 |
| 164 waitForEventAndRunStep('message', mediaKeySession, processMe
ssage, test); | 162 waitForEventAndRunStep('message', mediaKeySession, processMe
ssage, test); |
| 165 return mediaKeySession.generateRequest(initDataType, initDat
a); | 163 return mediaKeySession.generateRequest(initDataType, initDat
a); |
| 166 }).catch(function(error) { | 164 }).catch(function(error) { |
| 167 forceTestFailureFromPromise(test, error); | 165 forceTestFailureFromPromise(test, error); |
| 168 }); | 166 }); |
| 169 }, 'Verify MediaKeySession.keyStatuses.'); | 167 }, 'Verify MediaKeySession.keyStatuses.'); |
| 170 </script> | 168 </script> |
| 171 </body> | 169 </body> |
| 172 </html> | 170 </html> |
| OLD | NEW |