OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>setMediaKeys() multiple times with different MediaKeys.</title> | 4 <title>setMediaKeys() multiple times with different 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 keySystemAccess; | 16 var keySystemAccess; |
18 var mediaKeys1; | 17 var mediaKeys1; |
19 var mediaKeys2; | 18 var mediaKeys2; |
20 | 19 |
21 assert_equals(video.mediaKeys, null); | 20 assert_equals(video.mediaKeys, null); |
22 | 21 |
23 return navigator.requestMediaKeySystemAccess('org.w3.clearkey',
getConfigurationForFile(content)).then(function(access) { | 22 return navigator.requestMediaKeySystemAccess('org.w3.clearkey',
getConfigurationForFile(content)).then(function(access) { |
24 keySystemAccess = access; | 23 keySystemAccess = access; |
25 // Create a mediaKeys. | 24 // Create a mediaKeys. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 }, function(error) { | 69 }, function(error) { |
71 assert_true(video.mediaKeys === mediaKeys1); | 70 assert_true(video.mediaKeys === mediaKeys1); |
72 assert_equals(error.name, 'InvalidStateError'); | 71 assert_equals(error.name, 'InvalidStateError'); |
73 assert_not_equals(error.message, ''); | 72 assert_not_equals(error.message, ''); |
74 return Promise.resolve(); | 73 return Promise.resolve(); |
75 }); | 74 }); |
76 }, 'setMediaKeys() multiple times with different MediaKeys.'); | 75 }, 'setMediaKeys() multiple times with different MediaKeys.'); |
77 </script> | 76 </script> |
78 </body> | 77 </body> |
79 </html> | 78 </html> |
OLD | NEW |