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 // Reload the page to catch any possible teardown issues. | 71 // Reload the page to catch any possible teardown issues. |
72 if (location.hash == '#x') { | 72 if (location.hash == '#x') { |
73 test.done(); | 73 test.done(); |
74 return; | 74 return; |
75 } | 75 } |
76 | 76 |
77 location.hash += 'x'; | 77 location.hash += 'x'; |
78 location.reload(); | 78 location.reload(); |
79 } | 79 } |
80 | 80 |
| 81 waitForEventAndRunStep('needkey', video, onNeedKey, test); |
| 82 waitForEventAndRunStep('playing', video, onPlaying, test); |
| 83 video.src = '../content/test-encrypted.webm'; |
| 84 |
81 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { | 85 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { |
82 | 86 return video.setMediaKeys(mediaKeys); |
83 waitForEventAndRunStep('needkey', video, onNeedKey, test); | 87 }).then(function(result) { |
84 waitForEventAndRunStep('playing', video, onPlaying, test); | |
85 | |
86 video.setMediaKeys(mediaKeys); | |
87 video.src = '../content/test-encrypted.webm'; | |
88 video.play(); | 88 video.play(); |
89 }).catch(function(error) { | 89 }).catch(function(error) { |
90 forceTestFailureFromPromise(test, error); | 90 forceTestFailureFromPromise(test, error); |
91 }); | 91 }); |
92 }, 'Reloading during encrypted media playback.'); | 92 }, 'Reloading during encrypted media playback.'); |
93 </script> | 93 </script> |
94 </body> | 94 </body> |
95 </html> | 95 </html> |
OLD | NEW |