OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>setMediaKeys() multiple times with the same MediaKeys.</title> | 4 <title>setMediaKeys() multiple times with the same MediaKeys.</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 <video id="video"></video> | 10 <video></video> |
11 <div id="log"></div> | |
12 <script> | 11 <script> |
13 promise_test(function(test) | 12 promise_test(function(test) |
14 { | 13 { |
15 var video = document.getElementById('video'); | 14 var video = document.querySelector('video'); |
16 var content = '../content/test-encrypted.webm'; | 15 var content = '../content/test-encrypted.webm'; |
17 var mediaKeys; | 16 var mediaKeys; |
18 | 17 |
19 assert_equals(video.mediaKeys, null); | 18 assert_equals(video.mediaKeys, null); |
20 | 19 |
21 return navigator.requestMediaKeySystemAccess('org.w3.clearkey',
getConfigurationForFile(content)).then(function(access) { | 20 return navigator.requestMediaKeySystemAccess('org.w3.clearkey',
getConfigurationForFile(content)).then(function(access) { |
22 return access.createMediaKeys(); | 21 return access.createMediaKeys(); |
23 }).then(function(result) { | 22 }).then(function(result) { |
24 mediaKeys = result; | 23 mediaKeys = result; |
25 assert_not_equals(mediaKeys, null); | 24 assert_not_equals(mediaKeys, null); |
(...skipping 11 matching lines...) Expand all Loading... |
37 // Set mediaKeys again on video should still return a | 36 // Set mediaKeys again on video should still return a |
38 // resolved promise. | 37 // resolved promise. |
39 return video.setMediaKeys(mediaKeys); | 38 return video.setMediaKeys(mediaKeys); |
40 }).then(function() { | 39 }).then(function() { |
41 assert_true(video.mediaKeys === mediaKeys); | 40 assert_true(video.mediaKeys === mediaKeys); |
42 }); | 41 }); |
43 }, 'setMediaKeys() multiple times with the same MediaKeys.'); | 42 }, 'setMediaKeys() multiple times with the same MediaKeys.'); |
44 </script> | 43 </script> |
45 </body> | 44 </body> |
46 </html> | 45 </html> |
OLD | NEW |