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

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

Issue 2652373002: EME: Fail requestMediaKeySystemAccess if no capabilities specified (Closed)
Patch Set: more changes 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 expect_error('org.w3.clearkey.', [{}], 'NotSupportedError', 'Trailin g dot in key systems name'); 71 expect_error('org.w3.clearkey.', [{}], 'NotSupportedError', 'Trailin g dot in key systems name');
72 expect_error('org.w3..clearkey', [{}], 'NotSupportedError', 'Double dot in key systems name'); 72 expect_error('org.w3..clearkey', [{}], 'NotSupportedError', 'Double dot in key systems name');
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_config('org.w3.clearkey', [{}], {}, 'Empty configuration'); 81 expect_error('org.w3.clearkey', [{}], 'NotSupportedError', 'Empty co nfiguration');
82 82
83 // Various combinations of supportedConfigurations. 83 // Various combinations of supportedConfigurations.
84 // TODO(jrummell): Specifying contentType without codecs is 84 // TODO(jrummell): Specifying contentType without codecs is
85 // deprecated, so this test should fail. http://crbug.com/605661. 85 // deprecated, so this test should fail. http://crbug.com/605661.
86 expect_config('org.w3.clearkey', [{ 86 expect_config('org.w3.clearkey', [{
87 initDataTypes: ['webm'], 87 initDataTypes: ['webm'],
88 audioCapabilities: [{contentType: 'audio/webm'}], 88 audioCapabilities: [{contentType: 'audio/webm'}],
89 videoCapabilities: [{contentType: 'video/webm'}], 89 videoCapabilities: [{contentType: 'video/webm'}],
90 }], { 90 }], {
91 initDataTypes: ['webm'], 91 initDataTypes: ['webm'],
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 }], 'NotSupportedError', 'Unsupported video codec'); 147 }], 'NotSupportedError', 'Unsupported video codec');
148 148
149 expect_error('org.w3.clearkey', [{ 149 expect_error('org.w3.clearkey', [{
150 audioCapabilities: [ 150 audioCapabilities: [
151 {contentType: 'audio/webm; codecs=avc1'}, 151 {contentType: 'audio/webm; codecs=avc1'},
152 {contentType: 'audio/webm; codecs=avc1.42e01e'} 152 {contentType: 'audio/webm; codecs=avc1.42e01e'}
153 ], 153 ],
154 }], 'NotSupportedError', 'Mismatched video container/codec'); 154 }], 'NotSupportedError', 'Mismatched video container/codec');
155 155
156 expect_config('org.w3.clearkey', [ 156 expect_config('org.w3.clearkey', [
157 {initDataTypes: ['fakeidt']}, 157 { initDataTypes: ['fakeidt'],
158 {initDataTypes: ['webm']} 158 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'} ]
159 },
160 { initDataTypes: ['webm'],
161 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'} ]
162 }
159 ], {initDataTypes: ['webm']}, 'Two configurations, one supported'); 163 ], {initDataTypes: ['webm']}, 'Two configurations, one supported');
160 164
161 expect_config('org.w3.clearkey', [ 165 expect_config('org.w3.clearkey', [
162 {initDataTypes: ['webm']}, 166 { initDataTypes: ['webm'],
163 {} 167 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'} ]
168 },
169 { audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'} ]
170 }
164 ], {initDataTypes: ['webm']}, 'Two configurations, both supported'); 171 ], {initDataTypes: ['webm']}, 'Two configurations, both supported');
165 172
166 // Audio MIME type does not support video codecs. 173 // Audio MIME type does not support video codecs.
167 expect_error('org.w3.clearkey', [{ 174 expect_error('org.w3.clearkey', [{
168 audioCapabilities: [ 175 audioCapabilities: [
169 {contentType: 'audio/webm; codecs="vp8,vorbis"'}, 176 {contentType: 'audio/webm; codecs="vp8,vorbis"'},
170 {contentType: 'audio/webm; codecs="vorbis, vp8"'}, 177 {contentType: 'audio/webm; codecs="vorbis, vp8"'},
171 {contentType: 'audio/webm; codecs="vp8"'} 178 {contentType: 'audio/webm; codecs="vp8"'}
172 ], 179 ],
173 }], 'NotSupportedError', 'Audio MIME type does not support video cod ecs.'); 180 }], 'NotSupportedError', 'Audio MIME type does not support video cod ecs.');
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 expect_error('org.w3.clearkey', [{ 315 expect_error('org.w3.clearkey', [{
309 videoCapabilities: [{contentType: 'video/webm; codecs="vp8,"'}], 316 videoCapabilities: [{contentType: 'video/webm; codecs="vp8,"'}],
310 }], 'NotSupportedError', 'Trailing , in codecs'); 317 }], 'NotSupportedError', 'Trailing , in codecs');
311 318
312 expect_error('org.w3.clearkey', [{ 319 expect_error('org.w3.clearkey', [{
313 videoCapabilities: [{contentType: 'video/webm; codecs=",vp8,"'}] , 320 videoCapabilities: [{contentType: 'video/webm; codecs=",vp8,"'}] ,
314 }], 'NotSupportedError', 'Leading and trailing , in codecs'); 321 }], 'NotSupportedError', 'Leading and trailing , in codecs');
315 322
316 // Verify 'temporary' sessionType. 323 // Verify 'temporary' sessionType.
317 expect_config('org.w3.clearkey', [{ 324 expect_config('org.w3.clearkey', [{
318 sessionTypes: [ 'temporary' ] 325 sessionTypes: [ 'temporary' ],
326 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}]
319 }], { 327 }], {
320 sessionTypes: [ 'temporary' ] 328 sessionTypes: [ 'temporary' ],
329 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}]
321 }, 'temporary sessionType'); 330 }, 'temporary sessionType');
322 331
323 // Clear Key doesn't support persistent sessions. 332 // Clear Key doesn't support persistent sessions.
324 expect_error('org.w3.clearkey', [{ 333 expect_error('org.w3.clearkey', [{
325 sessionTypes: [ 'persistent-license' ] 334 sessionTypes: [ 'persistent-license' ],
335 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}]
326 }], 'NotSupportedError', 'persistent-license sessionType'); 336 }], 'NotSupportedError', 'persistent-license sessionType');
327 337
328 // Verify invalid sessionTypes. 338 // Verify invalid sessionTypes.
329 expect_error('org.w3.clearkey', [{ 339 expect_error('org.w3.clearkey', [{
330 sessionTypes: [ 'foo' ] 340 sessionTypes: [ 'foo' ],
341 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}]
331 }], 'NotSupportedError', 'invalid sessionType'); 342 }], 'NotSupportedError', 'invalid sessionType');
332 </script> 343 </script>
333 </body> 344 </body>
334 </html> 345 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698