OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Reloading during encrypted media playback</title> | 4 <title>Reloading during encrypted media playback</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="testVideo"></video> | 10 <video id="testVideo"></video> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (location.hash == '#x') { | 71 if (location.hash == '#x') { |
72 test.done(); | 72 test.done(); |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 location.hash += 'x'; | 76 location.hash += 'x'; |
77 location.reload(); | 77 location.reload(); |
78 } | 78 } |
79 | 79 |
80 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { | 80 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { |
81 | |
82 waitForEventAndRunStep('needkey', video, onNeedKey, test); | 81 waitForEventAndRunStep('needkey', video, onNeedKey, test); |
83 waitForEventAndRunStep('playing', video, onPlaying, test); | 82 waitForEventAndRunStep('playing', video, onPlaying, test); |
84 | |
85 video.setMediaKeys(mediaKeys); | |
86 video.src = '../content/test-encrypted.webm'; | 83 video.src = '../content/test-encrypted.webm'; |
| 84 return video.setMediaKeys(mediaKeys); |
| 85 }).then(function(result) { |
87 video.play(); | 86 video.play(); |
88 }).catch(function(error) { | 87 }).catch(function(error) { |
89 forceTestFailureFromPromise(test, error); | 88 forceTestFailureFromPromise(test, error); |
90 }); | 89 }); |
91 }, 'Reloading during encrypted media playback.'); | 90 }, 'Reloading during encrypted media playback.'); |
92 </script> | 91 </script> |
93 </body> | 92 </body> |
94 </html> | 93 </html> |
OLD | NEW |