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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-unique-origin.html

Issue 2084053002: EME: Update tests so 'audioCapabilities' always provided (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes (+rebase) Created 4 years, 5 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>Unique origin is unable to create MediaKeys</title> 4 <title>Unique origin is unable to create MediaKeys</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <div id="log"></div> 9 <div id="log"></div>
10 <script> 10 <script>
(...skipping 17 matching lines...) Expand all
28 resolve(e.data); 28 resolve(e.data);
29 self.removeEventListener('message', listener); 29 self.removeEventListener('message', listener);
30 }); 30 });
31 }); 31 });
32 } 32 }
33 33
34 promise_test(function(test) { 34 promise_test(function(test) {
35 var script = 'data:text/html,' + 35 var script = 'data:text/html,' +
36 '<script>' + 36 '<script>' +
37 ' window.onmessage = function(e) {' + 37 ' window.onmessage = function(e) {' +
38 ' navigator.requestMediaKeySystemAccess(\'org.w3.clea rkey\', [{}]).then(function(access) {' + 38 ' navigator.requestMediaKeySystemAccess(\'org.w3.clea rkey\', [{' +
39 ' initDataTypes: [ \'keyids\' ],' +
40 ' audioCapabilities: [' +
41 ' { contentType: \'audio/mp4; codecs="mp4a.40. 2"\' },' +
42 ' { contentType: \'audio/webm; codecs="opus"\' }' +
43 ' ]' +
44 ' }]).then(function(access) {' +
39 ' return access.createMediaKeys();' + 45 ' return access.createMediaKeys();' +
40 ' }).then(function(mediaKeys) {' + 46 ' }).then(function(mediaKeys) {' +
41 ' window.parent.postMessage({result: \'allowed\'} , \'*\');' + 47 ' window.parent.postMessage({result: \'allowed\'} , \'*\');' +
42 ' }, function(error) {' + 48 ' }, function(error) {' +
43 ' window.parent.postMessage({result: \'failed\'}, \'*\');' + 49 ' window.parent.postMessage({result: \'failed\'}, \'*\');' +
44 ' });' + 50 ' });' +
45 ' };' + 51 ' };' +
46 '<\/script>'; 52 '<\/script>';
47 53
48 // Verify that this page can create a MediaKeys first. 54 // Verify that this page can create a MediaKeys first.
49 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t hen(function(access) { 55 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{
56 initDataTypes: [ 'keyids' ],
57 audioCapabilities: [
58 { contentType: 'audio/mp4; codecs="mp4a.40.2"' },
59 { contentType: 'audio/webm; codecs="opus"' }
60 ]
61 }]).then(function(access) {
50 return access.createMediaKeys(); 62 return access.createMediaKeys();
51 }).then(function(mediaKeys) { 63 }).then(function(mediaKeys) {
52 // Success, so now create the iframe and try there. 64 // Success, so now create the iframe and try there.
53 return load_iframe(script, 'allow-scripts') 65 return load_iframe(script, 'allow-scripts')
54 }).then(function(iframe) { 66 }).then(function(iframe) {
55 iframe.contentWindow.postMessage({}, '*'); 67 iframe.contentWindow.postMessage({}, '*');
56 return wait_for_message(); 68 return wait_for_message();
57 }).then(function(message) { 69 }).then(function(message) {
58 assert_equals(message.result, 'failed'); 70 assert_equals(message.result, 'failed');
59 }); 71 });
60 }, 'Unique origin is unable to create MediaKeys'); 72 }, 'Unique origin is unable to create MediaKeys');
61 </script> 73 </script>
62 </body> 74 </body>
63 </html> 75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698