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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-setmediakeys-multiple-times-with-the-same-mediakeys.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>setMediaKeys() multiple times with the same MediaKeys.</title> 4 <title>setMediaKeys() multiple times with the same MediaKeys.</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="video"></video> 10 <video id="video"></video>
11 <div id="log"></div> 11 <div id="log"></div>
12 <script> 12 <script>
13 promise_test(function(test) 13 promise_test(function(test)
14 { 14 {
15 var video = document.getElementById('video'); 15 var video = document.getElementById('video');
16 var mediaKeys; 16 var mediaKeys;
17 17
18 assert_equals(video.mediaKeys, null); 18 assert_equals(video.mediaKeys, null);
19 19
20 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { 20 getSupportedInitDataType().then(function(initDataType) {
21 return requestClearKeySystemAccessForInitType(initDataType);
22 }).then(function(access) {
21 return access.createMediaKeys(); 23 return access.createMediaKeys();
22 }).then(function(result) { 24 }).then(function(result) {
23 mediaKeys = result; 25 mediaKeys = result;
24 assert_not_equals(mediaKeys, null); 26 assert_not_equals(mediaKeys, null);
25 // Set mediaKeys on video should work. 27 // Set mediaKeys on video should work.
26 return video.setMediaKeys(mediaKeys); 28 return video.setMediaKeys(mediaKeys);
27 }).then(function() { 29 }).then(function() {
28 assert_true(video.mediaKeys === mediaKeys); 30 assert_true(video.mediaKeys === mediaKeys);
29 // Set mediaKeys on video again should return a resolved 31 // Set mediaKeys on video again should return a resolved
30 // promise. 32 // promise.
31 return video.setMediaKeys(mediaKeys); 33 return video.setMediaKeys(mediaKeys);
32 }).then(function() { 34 }).then(function() {
33 assert_true(video.mediaKeys === mediaKeys); 35 assert_true(video.mediaKeys === mediaKeys);
34 // Load the media element to create the WebMediaPlayer. 36 // Load the media element to create the WebMediaPlayer.
35 video.src = '../content/test-encrypted.webm'; 37 video.src = '../content/test-encrypted.webm';
36 // Set mediaKeys again on video should still return a 38 // Set mediaKeys again on video should still return a
37 // resolved promise. 39 // resolved promise.
38 return video.setMediaKeys(mediaKeys); 40 return video.setMediaKeys(mediaKeys);
39 }).then(function() { 41 }).then(function() {
40 assert_true(video.mediaKeys === mediaKeys); 42 assert_true(video.mediaKeys === mediaKeys);
41 }); 43 });
42 }, 'setMediaKeys() multiple times with the same MediaKeys.'); 44 }, 'setMediaKeys() multiple times with the same MediaKeys.');
43 </script> 45 </script>
44 </body> 46 </body>
45 </html> 47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698