Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html

Issue 423633002: Make HTMLMediaElement.setMediaKeys() asynchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase + add comment Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Waiting for a key.</title> 4 <title>Waiting for a key.</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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 { 84 {
85 if (event.target.currentTime < 0.5 || !sessionReadyReceived) 85 if (event.target.currentTime < 0.5 || !sessionReadyReceived)
86 return; 86 return;
87 87
88 test.done(); 88 test.done();
89 } 89 }
90 90
91 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { 91 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
92 waitForEventAndRunStep('needkey', video, onNeedKey, test); 92 waitForEventAndRunStep('needkey', video, onNeedKey, test);
93 waitForEventAndRunStep('playing', video, onPlaying, test); 93 waitForEventAndRunStep('playing', video, onPlaying, test);
94
95 video.setMediaKeys(mediaKeys);
96 video.src = '../content/test-encrypted.webm'; 94 video.src = '../content/test-encrypted.webm';
95 return video.setMediaKeys(mediaKeys);
96 }).then(function(result) {
97 video.play(); 97 video.play();
98 }).catch(function(error) { 98 }).catch(function(error) {
99 forceTestFailureFromPromise(test, error); 99 forceTestFailureFromPromise(test, error);
100 }); 100 });
101 }, 'Waiting for a key.'); 101 }, 'Waiting for a key.');
102 </script> 102 </script>
103 </body> 103 </body>
104 </html> 104 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698