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

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

Issue 665213002: Implement navigator.requestMediaKeySystemAccess() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updates Created 6 years, 2 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 85
86 function onTimeUpdate(event) 86 function onTimeUpdate(event)
87 { 87 {
88 if (event.target.currentTime < 0.5 || !sessionReadyReceived) 88 if (event.target.currentTime < 0.5 || !sessionReadyReceived)
89 return; 89 return;
90 90
91 test.done(); 91 test.done();
92 } 92 }
93 93
94 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { 94 navigator.requestMediaKeySystemAccess('org.w3.clearkey').then(fu nction(access) {
95 return access.createMediaKeys();
96 }).then(function(mediaKeys) {
95 waitForEventAndRunStep('encrypted', video, onEncrypted, test ); 97 waitForEventAndRunStep('encrypted', video, onEncrypted, test );
96 waitForEventAndRunStep('playing', video, onPlaying, test); 98 waitForEventAndRunStep('playing', video, onPlaying, test);
97 video.src = '../content/test-encrypted.webm'; 99 video.src = '../content/test-encrypted.webm';
98 return video.setMediaKeys(mediaKeys); 100 return video.setMediaKeys(mediaKeys);
99 }).then(function(result) { 101 }).then(function(result) {
100 video.play(); 102 video.play();
101 }).catch(function(error) { 103 }).catch(function(error) {
102 forceTestFailureFromPromise(test, error); 104 forceTestFailureFromPromise(test, error);
103 }); 105 });
104 }, 'Waiting for a key.'); 106 }, 'Waiting for a key.');
105 </script> 107 </script>
106 </body> 108 </body>
107 </html> 109 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698