| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Initialization Data returned when using same origin</title> | 4 <title>Initialization Data returned when using same origin</title> |
| 5 <script src="/js-test-resources/testharness.js"></script> | 5 <script src="/js-test-resources/testharness.js"></script> |
| 6 <script src="/js-test-resources/testharnessreport.js"></script> | 6 <script src="/js-test-resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <video id="testVideo"></video> | 9 <video id="testVideo"></video> |
| 10 <div id="log"></div> | 10 <div id="log"></div> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // both initDataType and initData should contain something. | 24 // both initDataType and initData should contain something. |
| 25 assert_equals(event.initDataType, 'webm'); | 25 assert_equals(event.initDataType, 'webm'); |
| 26 assert_greater_than(event.initData.byteLength, 0); | 26 assert_greater_than(event.initData.byteLength, 0); |
| 27 | 27 |
| 28 // Both the audio and the video tracks have initData, | 28 // Both the audio and the video tracks have initData, |
| 29 // so finish once both events are received. | 29 // so finish once both events are received. |
| 30 if (++encryptedEventCount == 2) | 30 if (++encryptedEventCount == 2) |
| 31 test.done(); | 31 test.done(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 navigator.requestMediaKeySystemAccess( | 34 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { |
| 35 'org.w3.clearkey', | |
| 36 [{audioCapabilities: [{contentType: 'audio/webm; codecs=vorb
is'}]}]) | |
| 37 .then(function(access) { | |
| 38 return access.createMediaKeys(); | 35 return access.createMediaKeys(); |
| 39 }).then(function(mediaKeys) { | 36 }).then(function(mediaKeys) { |
| 40 video.addEventListener('encrypted', test.step_func(onEncrypt
ed), true); | 37 video.addEventListener('encrypted', test.step_func(onEncrypt
ed), true); |
| 41 return video.setMediaKeys(mediaKeys); | 38 return video.setMediaKeys(mediaKeys); |
| 42 }).then(function(result) { | 39 }).then(function(result) { |
| 43 video.src = 'test-encrypted.webm'; | 40 video.src = 'test-encrypted.webm'; |
| 44 video.play(); | 41 video.play(); |
| 45 }); | 42 }); |
| 46 }, 'Initialization Data returned when using same origin.'); | 43 }, 'Initialization Data returned when using same origin.'); |
| 47 </script> | 44 </script> |
| 48 </body> | 45 </body> |
| 49 </html> | 46 </html> |
| OLD | NEW |