| OLD | NEW |
| 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 Loading... |
| 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_error('org.w3.clearkey', [{}], 'NotSupportedError', 'Empty co
nfiguration'); | 81 expect_config('org.w3.clearkey', [{}], {}, 'Empty configuration'); |
| 82 | 82 |
| 83 // contentType without codecs is not supported. | 83 // contentType without codecs is not supported. |
| 84 expect_error('org.w3.clearkey', [{ | 84 expect_error('org.w3.clearkey', [{ |
| 85 initDataTypes: ['webm'], | 85 initDataTypes: ['webm'], |
| 86 audioCapabilities: [{contentType: 'audio/webm'}], | 86 audioCapabilities: [{contentType: 'audio/webm'}], |
| 87 videoCapabilities: [{contentType: 'video/webm'}], | 87 videoCapabilities: [{contentType: 'video/webm'}], |
| 88 }], 'NotSupportedError', 'Basic supported configuration without code
cs'); | 88 }], 'NotSupportedError', 'Basic supported configuration without code
cs'); |
| 89 | 89 |
| 90 expect_error('org.w3.clearkey', [{ | 90 expect_error('org.w3.clearkey', [{ |
| 91 initDataTypes: ['webm'], | 91 initDataTypes: ['webm'], |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 }], 'NotSupportedError', 'Unsupported video codec'); | 174 }], 'NotSupportedError', 'Unsupported video codec'); |
| 175 | 175 |
| 176 expect_error('org.w3.clearkey', [{ | 176 expect_error('org.w3.clearkey', [{ |
| 177 audioCapabilities: [ | 177 audioCapabilities: [ |
| 178 {contentType: 'audio/webm; codecs=avc1'}, | 178 {contentType: 'audio/webm; codecs=avc1'}, |
| 179 {contentType: 'audio/webm; codecs=avc1.42e01e'} | 179 {contentType: 'audio/webm; codecs=avc1.42e01e'} |
| 180 ], | 180 ], |
| 181 }], 'NotSupportedError', 'Mismatched video container/codec'); | 181 }], 'NotSupportedError', 'Mismatched video container/codec'); |
| 182 | 182 |
| 183 expect_config('org.w3.clearkey', [ | 183 expect_config('org.w3.clearkey', [ |
| 184 { initDataTypes: ['fakeidt'], | 184 {initDataTypes: ['fakeidt']}, |
| 185 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}
] | 185 {initDataTypes: ['webm']} |
| 186 }, | |
| 187 { initDataTypes: ['webm'], | |
| 188 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}
] | |
| 189 } | |
| 190 ], {initDataTypes: ['webm']}, 'Two configurations, one supported'); | 186 ], {initDataTypes: ['webm']}, 'Two configurations, one supported'); |
| 191 | 187 |
| 192 expect_config('org.w3.clearkey', [ | 188 expect_config('org.w3.clearkey', [ |
| 193 { initDataTypes: ['webm'], | 189 {initDataTypes: ['webm']}, |
| 194 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}
] | 190 {} |
| 195 }, | |
| 196 { audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}
] | |
| 197 } | |
| 198 ], {initDataTypes: ['webm']}, 'Two configurations, both supported'); | 191 ], {initDataTypes: ['webm']}, 'Two configurations, both supported'); |
| 199 | 192 |
| 200 // Audio MIME type does not support video codecs. | 193 // Audio MIME type does not support video codecs. |
| 201 expect_error('org.w3.clearkey', [{ | 194 expect_error('org.w3.clearkey', [{ |
| 202 audioCapabilities: [ | 195 audioCapabilities: [ |
| 203 {contentType: 'audio/webm; codecs="vp8,vorbis"'}, | 196 {contentType: 'audio/webm; codecs="vp8,vorbis"'}, |
| 204 {contentType: 'audio/webm; codecs="vorbis, vp8"'}, | 197 {contentType: 'audio/webm; codecs="vorbis, vp8"'}, |
| 205 {contentType: 'audio/webm; codecs="vp8"'} | 198 {contentType: 'audio/webm; codecs="vp8"'} |
| 206 ], | 199 ], |
| 207 }], 'NotSupportedError', 'Audio MIME type does not support video cod
ecs.'); | 200 }], 'NotSupportedError', 'Audio MIME type does not support video cod
ecs.'); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 expect_error('org.w3.clearkey', [{ | 341 expect_error('org.w3.clearkey', [{ |
| 349 videoCapabilities: [{contentType: 'video/webm; codecs="vp8,"'}], | 342 videoCapabilities: [{contentType: 'video/webm; codecs="vp8,"'}], |
| 350 }], 'NotSupportedError', 'Trailing , in codecs'); | 343 }], 'NotSupportedError', 'Trailing , in codecs'); |
| 351 | 344 |
| 352 expect_error('org.w3.clearkey', [{ | 345 expect_error('org.w3.clearkey', [{ |
| 353 videoCapabilities: [{contentType: 'video/webm; codecs=",vp8,"'}]
, | 346 videoCapabilities: [{contentType: 'video/webm; codecs=",vp8,"'}]
, |
| 354 }], 'NotSupportedError', 'Leading and trailing , in codecs'); | 347 }], 'NotSupportedError', 'Leading and trailing , in codecs'); |
| 355 | 348 |
| 356 // Verify 'temporary' sessionType. | 349 // Verify 'temporary' sessionType. |
| 357 expect_config('org.w3.clearkey', [{ | 350 expect_config('org.w3.clearkey', [{ |
| 358 sessionTypes: [ 'temporary' ], | 351 sessionTypes: [ 'temporary' ] |
| 359 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] | |
| 360 }], { | 352 }], { |
| 361 sessionTypes: [ 'temporary' ], | 353 sessionTypes: [ 'temporary' ] |
| 362 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] | |
| 363 }, 'temporary sessionType'); | 354 }, 'temporary sessionType'); |
| 364 | 355 |
| 365 // Clear Key doesn't support persistent sessions. | 356 // Clear Key doesn't support persistent sessions. |
| 366 expect_error('org.w3.clearkey', [{ | 357 expect_error('org.w3.clearkey', [{ |
| 367 sessionTypes: [ 'persistent-license' ], | 358 sessionTypes: [ 'persistent-license' ] |
| 368 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] | |
| 369 }], 'NotSupportedError', 'persistent-license sessionType'); | 359 }], 'NotSupportedError', 'persistent-license sessionType'); |
| 370 | 360 |
| 371 // Verify invalid sessionTypes. | 361 // Verify invalid sessionTypes. |
| 372 expect_error('org.w3.clearkey', [{ | 362 expect_error('org.w3.clearkey', [{ |
| 373 sessionTypes: [ 'foo' ], | 363 sessionTypes: [ 'foo' ] |
| 374 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] | |
| 375 }], 'NotSupportedError', 'invalid sessionType'); | 364 }], 'NotSupportedError', 'invalid sessionType'); |
| 376 </script> | 365 </script> |
| 377 </body> | 366 </body> |
| 378 </html> | 367 </html> |
| OLD | NEW |