Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Verify MediaKeySession.keyStatuses with multiple updates</title> | 4 <title>Verify MediaKeySession.keyStatuses with multiple updates</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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 }); | 51 }); |
| 52 } else { | 52 } else { |
| 53 // Verify that the session now contains key1 and key2. | 53 // Verify that the session now contains key1 and key2. |
| 54 dumpKeyStatuses(mediaKeySession.keyStatuses); | 54 dumpKeyStatuses(mediaKeySession.keyStatuses); |
| 55 verifyKeyStatuses(mediaKeySession.keyStatuses, { expecte d: [key1, key2] }); | 55 verifyKeyStatuses(mediaKeySession.keyStatuses, { expecte d: [key1, key2] }); |
| 56 | 56 |
| 57 test.done(); | 57 test.done(); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t hen(function(access) { | 61 getSupportedInitDataType().then(function(type) { |
| 62 initDataType = type; | |
|
sandersd (OOO until July 31)
2015/03/16 19:57:08
Missing declarations.
jrummell
2015/03/16 20:44:09
Done. Wonder how it works?
sandersd (OOO until July 31)
2015/03/17 22:23:17
By setting those values on the global object (aka
| |
| 63 initData = getInitData(initDataType); | |
| 64 return navigator.requestMediaKeySystemAccess('org.w3.clearke y', [{}]); | |
| 65 }).then(function(access) { | |
| 62 return access.createMediaKeys(); | 66 return access.createMediaKeys(); |
| 63 }).then(function(mediaKeys) { | 67 }).then(function(mediaKeys) { |
| 64 var initDataType = getInitDataType(); | |
| 65 mediaKeySession = mediaKeys.createSession(); | 68 mediaKeySession = mediaKeys.createSession(); |
| 66 | 69 |
| 67 // There should be no keys defined yet. | 70 // There should be no keys defined yet. |
| 68 assert_equals(mediaKeySession.keyStatuses.size, 0); | 71 assert_equals(mediaKeySession.keyStatuses.size, 0); |
| 69 | 72 |
| 70 waitForEventAndRunStep('message', mediaKeySession, processMe ssage, test); | 73 waitForEventAndRunStep('message', mediaKeySession, processMe ssage, test); |
| 71 waitForEventAndRunStep('keystatuseschange', mediaKeySession, processKeyStatusesChange, test); | 74 waitForEventAndRunStep('keystatuseschange', mediaKeySession, processKeyStatusesChange, test); |
| 72 | 75 |
| 73 return mediaKeySession.generateRequest(initDataType, getInit Data(initDataType)); | 76 return mediaKeySession.generateRequest(initDataType, initDat a); |
| 74 }).catch(function(error) { | 77 }).catch(function(error) { |
| 75 forceTestFailureFromPromise(test, error); | 78 forceTestFailureFromPromise(test, error); |
| 76 }); | 79 }); |
| 77 }, 'Verify MediaKeySession.keyStatuses with multiple updates.'); | 80 }, 'Verify MediaKeySession.keyStatuses with multiple updates.'); |
| 78 </script> | 81 </script> |
| 79 </body> | 82 </body> |
| 80 </html> | 83 </html> |
| OLD | NEW |