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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-playback-two-videos.html

Issue 2084053002: EME: Update tests so 'audioCapabilities' always provided (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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>Clear Key Play Two Videos At Same Time</title> 4 <title>Clear Key Play Two Videos At Same Time</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 11 matching lines...) Expand all
22 { 22 {
23 var promises = [ 23 var promises = [
24 play_video_as_promise(document.getElementById('testVideo'), '../content/test-encrypted.webm'), 24 play_video_as_promise(document.getElementById('testVideo'), '../content/test-encrypted.webm'),
25 play_video_as_promise(document.getElementById('secondVideo') , '../content/test-encrypted.webm') 25 play_video_as_promise(document.getElementById('secondVideo') , '../content/test-encrypted.webm')
26 ]; 26 ];
27 return Promise.all(promises); 27 return Promise.all(promises);
28 }, 'Play two videos at the same time.'); 28 }, 'Play two videos at the same time.');
29 29
30 function play_video_as_promise(video, content) 30 function play_video_as_promise(video, content)
31 { 31 {
32 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { 32 return requestClearKeySystemAccessForInitType('webm').then(funct ion(access) {
33 return access.createMediaKeys(); 33 return access.createMediaKeys();
34 }).then(function(mediaKeys) { 34 }).then(function(mediaKeys) {
35 return video.setMediaKeys(mediaKeys); 35 return video.setMediaKeys(mediaKeys);
36 }).then(function(result) { 36 }).then(function(result) {
37 video.src = content; 37 video.src = content;
38 video.play(); 38 video.play();
39 return wait_for_encrypted_message(video); 39 return wait_for_encrypted_message(video);
40 }).then(function(result) { 40 }).then(function(result) {
41 return wait_for_timeupdate_message(video); 41 return wait_for_timeupdate_message(video);
42 }); 42 });
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (e.target.currentTime < 0.2) 76 if (e.target.currentTime < 0.2)
77 return; 77 return;
78 video.removeEventListener('timeupdate', listener); 78 video.removeEventListener('timeupdate', listener);
79 resolve(e); 79 resolve(e);
80 }); 80 });
81 }); 81 });
82 }; 82 };
83 </script> 83 </script>
84 </body> 84 </body>
85 </html> 85 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698