| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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'); |
| 89 |
| 90 expect_error('org.w3.clearkey', [{ |
| 91 initDataTypes: ['webm'], | 91 initDataTypes: ['webm'], |
| 92 audioCapabilities: [{contentType: 'audio/webm'}], | 92 audioCapabilities: [{contentType: 'audio/webm'}], |
| 93 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}], |
| 94 }], 'NotSupportedError', 'Basic supported configuration without audi
o codecs'); |
| 95 |
| 96 expect_error('org.w3.clearkey', [{ |
| 97 initDataTypes: ['webm'], |
| 98 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], |
| 93 videoCapabilities: [{contentType: 'video/webm'}], | 99 videoCapabilities: [{contentType: 'video/webm'}], |
| 94 }, 'Basic supported configuration'); | 100 }], 'NotSupportedError', 'Basic supported configuration without vide
o codecs'); |
| 95 | 101 |
| 96 // TODO(jrummell): Specifying contentType without codecs is | 102 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'], | 103 initDataTypes: ['fakeidt', 'webm'], |
| 100 audioCapabilities: [{contentType: 'audio/fake'}, {contentType: '
audio/webm'}], | 104 audioCapabilities: [{contentType: 'audio/fake'}, {contentType: '
audio/webm'}], |
| 101 videoCapabilities: [{contentType: 'video/fake'}, {contentType: '
video/webm'}], | 105 videoCapabilities: [{contentType: 'video/fake'}, {contentType: '
video/webm'}], |
| 106 }], 'NotSupportedError', 'Partially supported configuration without
codecs'); |
| 107 |
| 108 // Various combinations of supportedConfigurations. |
| 109 expect_config('org.w3.clearkey', [{ |
| 110 initDataTypes: ['webm'], |
| 111 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], |
| 112 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}], |
| 102 }], { | 113 }], { |
| 103 initDataTypes: ['webm'], | 114 initDataTypes: ['webm'], |
| 104 audioCapabilities: [{contentType: 'audio/webm'}], | 115 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], |
| 105 videoCapabilities: [{contentType: 'video/webm'}], | 116 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}], |
| 117 }, 'Basic supported configuration'); |
| 118 |
| 119 expect_config('org.w3.clearkey', [{ |
| 120 initDataTypes: ['fakeidt', 'webm'], |
| 121 audioCapabilities: [ |
| 122 {contentType: 'audio/fake; codecs=vorbis'}, |
| 123 {contentType: 'audio/webm; codecs=vorbis'} |
| 124 ], |
| 125 videoCapabilities: [ |
| 126 {contentType: 'video/fake; codecs=vp8'}, |
| 127 {contentType: 'video/webm; codecs=vp8'} |
| 128 ], |
| 129 }], { |
| 130 initDataTypes: ['webm'], |
| 131 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], |
| 132 videoCapabilities: [{contentType: 'video/webm; codecs=vp8'}], |
| 106 }, 'Partially supported configuration'); | 133 }, 'Partially supported configuration'); |
| 107 | 134 |
| 108 expect_config('org.w3.clearkey', [{ | 135 expect_config('org.w3.clearkey', [{ |
| 109 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], | 136 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], |
| 110 }], { | 137 }], { |
| 111 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], | 138 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}], |
| 112 }, 'Supported audio codec'); | 139 }, 'Supported audio codec'); |
| 113 | 140 |
| 114 expect_config('org.w3.clearkey', [{ | 141 expect_config('org.w3.clearkey', [{ |
| 115 audioCapabilities: [{contentType: 'audio/webm; codecs="vorbis"'
}], | 142 audioCapabilities: [{contentType: 'audio/webm; codecs="vorbis"'
}], |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 }], 'NotSupportedError', 'persistent-license sessionType'); | 369 }], 'NotSupportedError', 'persistent-license sessionType'); |
| 343 | 370 |
| 344 // Verify invalid sessionTypes. | 371 // Verify invalid sessionTypes. |
| 345 expect_error('org.w3.clearkey', [{ | 372 expect_error('org.w3.clearkey', [{ |
| 346 sessionTypes: [ 'foo' ], | 373 sessionTypes: [ 'foo' ], |
| 347 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] | 374 audioCapabilities: [{contentType: 'audio/webm; codecs=vorbis'}] |
| 348 }], 'NotSupportedError', 'invalid sessionType'); | 375 }], 'NotSupportedError', 'invalid sessionType'); |
| 349 </script> | 376 </script> |
| 350 </body> | 377 </body> |
| 351 </html> | 378 </html> |
| OLD | NEW |