| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>setMediaKeys</title> | 4 <title>setMediaKeys</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 async_test(function(test) | 12 async_test(function(test) |
| 14 { | 13 { |
| 15 var mediaKeys; | 14 var mediaKeys; |
| 16 var video = document.getElementById('video'); | 15 var video = document.querySelector('video'); |
| 17 assert_not_equals(video, null); | 16 assert_not_equals(video, null); |
| 18 | 17 |
| 19 // Test MediaKeys assignment. | 18 // Test MediaKeys assignment. |
| 20 assert_equals(video.mediaKeys, null); | 19 assert_equals(video.mediaKeys, null); |
| 21 assert_equals(typeof video.setMediaKeys, 'function'); | 20 assert_equals(typeof video.setMediaKeys, 'function'); |
| 22 | 21 |
| 23 // Try setting mediaKeys to null. | 22 // Try setting mediaKeys to null. |
| 24 video.setMediaKeys(null).then(function(result) { | 23 video.setMediaKeys(null).then(function(result) { |
| 25 assert_equals(video.mediaKeys, null); | 24 assert_equals(video.mediaKeys, null); |
| 26 | 25 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 assert_not_equals(video.mediaKeys, null); | 45 assert_not_equals(video.mediaKeys, null); |
| 47 assert_true(video.mediaKeys === mediaKeys); | 46 assert_true(video.mediaKeys === mediaKeys); |
| 48 test.done(); | 47 test.done(); |
| 49 }).catch(function(error) { | 48 }).catch(function(error) { |
| 50 forceTestFailureFromPromise(test, error); | 49 forceTestFailureFromPromise(test, error); |
| 51 }); | 50 }); |
| 52 }, 'Setting MediaKeys on a video object.'); | 51 }, 'Setting MediaKeys on a video object.'); |
| 53 </script> | 52 </script> |
| 54 </body> | 53 </body> |
| 55 </html> | 54 </html> |
| OLD | NEW |