| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Initialization Data not returned when using different origin</tit
le> | 4 <title>Initialization Data not returned when using different origin</tit
le> |
| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Both the audio and the video tracks have initData, | 38 // Both the audio and the video tracks have initData, |
| 39 // so finish once both events are received. | 39 // so finish once both events are received. |
| 40 if (++encryptedEventCount == 2) { | 40 if (++encryptedEventCount == 2) { |
| 41 logMessage('done'); | 41 logMessage('done'); |
| 42 test.done(); | 42 test.done(); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 logMessage('starting'); | 46 logMessage('starting'); |
| 47 navigator.requestMediaKeySystemAccess( | 47 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { |
| 48 'org.w3.clearkey', | |
| 49 [{audioCapabilities: [{contentType: 'audio/webm; codecs=vorb
is'}]}]) | |
| 50 .then(function(access) { | |
| 51 return access.createMediaKeys(); | 48 return access.createMediaKeys(); |
| 52 }).then(function(mediaKeys) { | 49 }).then(function(mediaKeys) { |
| 53 video.addEventListener('encrypted', test.step_func(onEncrypt
ed), true); | 50 video.addEventListener('encrypted', test.step_func(onEncrypt
ed), true); |
| 54 return video.setMediaKeys(mediaKeys); | 51 return video.setMediaKeys(mediaKeys); |
| 55 }).then(function(result) { | 52 }).then(function(result) { |
| 56 // Verify that the current origin is different than what | 53 // Verify that the current origin is different than what |
| 57 // we use for the content. | 54 // we use for the content. |
| 58 logMessage('setting src'); | 55 logMessage('setting src'); |
| 59 assert_equals(document.origin, 'http://127.0.0.1:8000'); | 56 assert_equals(document.origin, 'http://127.0.0.1:8000'); |
| 60 video.src = 'http://127.0.0.1:8080/media/encrypted-media/tes
t-encrypted.webm'; | 57 video.src = 'http://127.0.0.1:8080/media/encrypted-media/tes
t-encrypted.webm'; |
| 61 video.play(); | 58 video.play(); |
| 62 }); | 59 }); |
| 63 }, 'Initialization Data not returned when using different origin.'); | 60 }, 'Initialization Data not returned when using different origin.'); |
| 64 </script> | 61 </script> |
| 65 </body> | 62 </body> |
| 66 </html> | 63 </html> |
| OLD | NEW |