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

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

Issue 2686133002: EME: Require codecs parameter for audio/videoCapabilities (Closed)
Patch Set: Created 3 years, 10 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>Test navigator.requestMediaKeySystemAccess()</title> 4 <title>Test navigator.requestMediaKeySystemAccess()</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 <script> 10 <script>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 expect_error('org.w3.clear.key', [{}], 'NotSupportedError', 'Extra d ot in key systems name'); 73 expect_error('org.w3.clear.key', [{}], 'NotSupportedError', 'Extra d ot in key systems name');
74 74
75 // Key system name is case sensitive. 75 // Key system name is case sensitive.
76 expect_error('org.w3.Clearkey', [{}], 'NotSupportedError', 'Key syst em name is case sensitive'); 76 expect_error('org.w3.Clearkey', [{}], 'NotSupportedError', 'Key syst em name is case sensitive');
77 expect_error('Org.w3.clearkey', [{}], 'NotSupportedError', 'Key syst em name is case sensitive'); 77 expect_error('Org.w3.clearkey', [{}], 'NotSupportedError', 'Key syst em name is case sensitive');
78 78
79 // Tests for trivial configurations. 79 // Tests for trivial configurations.
80 expect_error('org.w3.clearkey', [], 'TypeError', 'Empty supportedCon figurations'); 80 expect_error('org.w3.clearkey', [], 'TypeError', 'Empty supportedCon figurations');
81 expect_error('org.w3.clearkey', [{}], 'NotSupportedError', 'Empty co nfiguration'); 81 expect_error('org.w3.clearkey', [{}], 'NotSupportedError', 'Empty co nfiguration');
82 82
83 // Various combinations of supportedConfigurations. 83 // contentType without codecs is not supported.
84 // TODO(jrummell): Specifying contentType without codecs is 84 expect_error('org.w3.clearkey', [{
85 // deprecated, so this test should fail. http://crbug.com/605661.
86 expect_config('org.w3.clearkey', [{
87 initDataTypes: ['webm'], 85 initDataTypes: ['webm'],
88 audioCapabilities: [{contentType: 'audio/webm'}], 86 audioCapabilities: [{contentType: 'audio/webm'}],
89 videoCapabilities: [{contentType: 'video/webm'}], 87 videoCapabilities: [{contentType: 'video/webm'}],
90 }], { 88 }], 'NotSupportedError', 'Basic supported configuration without code cs');
xhwang 2017/02/09 20:07:55 Just in case, add a test where codecs for only aud
jrummell 2017/02/09 23:36:08 Done. Added both.
91 initDataTypes: ['webm'],
92 audioCapabilities: [{contentType: 'audio/webm'}],
93 videoCapabilities: [{contentType: 'video/webm'}],
94 }, 'Basic supported configuration');
95 89
96 // TODO(jrummell): Specifying contentType without codecs is 90 expect_error('org.w3.clearkey', [{
97 // deprecated, so this test should fail. http://crbug.com/605661.
98 expect_config('org.w3.clearkey', [{
99 initDataTypes: ['fakeidt', 'webm'], 91 initDataTypes: ['fakeidt', 'webm'],
100 audioCapabilities: [{contentType: 'audio/fake'}, {contentType: ' audio/webm'}], 92 audioCapabilities: [{contentType: 'audio/fake'}, {contentType: ' audio/webm'}],
101 videoCapabilities: [{contentType: 'video/fake'}, {contentType: ' video/webm'}], 93 videoCapabilities: [{contentType: 'video/fake'}, {contentType: ' video/webm'}],
94 }], 'NotSupportedError', 'Partially supported configuration without codecs');
95
96 // Various combinations of supportedConfigurations.
97 expect_config('org.w3.clearkey', [{
98 initDataTypes: ['webm'],
99 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}],
100 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}],
102 }], { 101 }], {
103 initDataTypes: ['webm'], 102 initDataTypes: ['webm'],
104 audioCapabilities: [{contentType: 'audio/webm'}], 103 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}],
105 videoCapabilities: [{contentType: 'video/webm'}], 104 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}],
105 }, 'Basic supported configuration');
106
107 expect_config('org.w3.clearkey', [{
108 initDataTypes: ['fakeidt', 'webm'],
109 audioCapabilities: [
110 {contentType: 'audio/fake; codecs=vorbis'},
111 {contentType: 'audio/webm; codecs=vorbis'}
112 ],
113 videoCapabilities: [
114 {contentType: 'video/fake; codecs=vp8'},
115 {contentType: 'video/webm; codecs=vp8'}
116 ],
117 }], {
118 initDataTypes: ['webm'],
119 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}],
120 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}],
106 }, 'Partially supported configuration'); 121 }, 'Partially supported configuration');
107 122
108 expect_config('org.w3.clearkey', [{ 123 expect_config('org.w3.clearkey', [{
109 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], 124 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}],
110 }], { 125 }], {
111 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], 126 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}],
112 }, 'Supported audio codec'); 127 }, 'Supported audio codec');
113 128
114 expect_config('org.w3.clearkey', [{ 129 expect_config('org.w3.clearkey', [{
115 audioCapabilities: [{contentType: 'audio/webm; codecs="vorbis"' }], 130 audioCapabilities: [{contentType: 'audio/webm; codecs="vorbis"' }],
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 }], 'NotSupportedError', 'persistent-license sessionType'); 357 }], 'NotSupportedError', 'persistent-license sessionType');
343 358
344 // Verify invalid sessionTypes. 359 // Verify invalid sessionTypes.
345 expect_error('org.w3.clearkey', [{ 360 expect_error('org.w3.clearkey', [{
346 sessionTypes: [ 'foo' ], 361 sessionTypes: [ 'foo' ],
347 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] 362 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}]
348 }], 'NotSupportedError', 'invalid sessionType'); 363 }], 'NotSupportedError', 'invalid sessionType');
349 </script> 364 </script>
350 </body> 365 </body>
351 </html> 366 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698