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

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

Issue 2342953002: Update EME errors to use TypeError (Closed)
Patch Set: changes Created 4 years, 2 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 20 matching lines...) Expand all
31 31
32 function expect_config(keySystem, configurations, expectedConfigurat ion, testName) { 32 function expect_config(keySystem, configurations, expectedConfigurat ion, testName) {
33 promise_test(function(test) { 33 promise_test(function(test) {
34 return navigator.requestMediaKeySystemAccess(keySystem, conf igurations).then(function(a) { 34 return navigator.requestMediaKeySystemAccess(keySystem, conf igurations).then(function(a) {
35 assert_subset(a.getConfiguration(), expectedConfiguratio n, 'getConfiguration()'); 35 assert_subset(a.getConfiguration(), expectedConfiguratio n, 'getConfiguration()');
36 }); 36 });
37 }, testName); 37 }, testName);
38 } 38 }
39 39
40 // Tests for keySystem. 40 // Tests for keySystem.
41 expect_error('', [{}], 'InvalidAccessError', 'Empty keySystem'); 41 expect_error('', [{}], 'TypeError', 'Empty keySystem');
42 expect_error('com.example.unsupported', [{}], 'NotSupportedError', ' Unsupported keySystem'); 42 expect_error('com.example.unsupported', [{}], 'NotSupportedError', ' Unsupported keySystem');
43 expect_error('org.w3.clearkey.', [{}], 'NotSupportedError', 'keySyst em ends with "."'); 43 expect_error('org.w3.clearkey.', [{}], 'NotSupportedError', 'keySyst em ends with "."');
44 expect_error('org.w3.ClearKey', [{}], 'NotSupportedError', 'Capitali zed keySystem'); 44 expect_error('org.w3.ClearKey', [{}], 'NotSupportedError', 'Capitali zed keySystem');
45 expect_error('org.w3.clearke\u028F', [{}], 'NotSupportedError', 'Non -ASCII keySystem'); 45 expect_error('org.w3.clearke\u028F', [{}], 'NotSupportedError', 'Non -ASCII keySystem');
46 46
47 // Parent of Clear Key not supported. 47 // Parent of Clear Key not supported.
48 expect_error('org', [{}], 'NotSupportedError', 'Parent of Clear Key (org)'); 48 expect_error('org', [{}], 'NotSupportedError', 'Parent of Clear Key (org)');
49 expect_error('org.', [{}], 'NotSupportedError', 'Parent of Clear Key (org.)'); 49 expect_error('org.', [{}], 'NotSupportedError', 'Parent of Clear Key (org.)');
50 expect_error('org.w3', [{}], 'NotSupportedError', 'Parent of Clear K ey (org.w3)'); 50 expect_error('org.w3', [{}], 'NotSupportedError', 'Parent of Clear K ey (org.w3)');
51 expect_error('org.w3.', [{}], 'NotSupportedError', 'Parent of Clear Key (org.w3.)'); 51 expect_error('org.w3.', [{}], 'NotSupportedError', 'Parent of Clear Key (org.w3.)');
(...skipping 18 matching lines...) Expand all
70 expect_error('.org.w3.clearkey', [{}], 'NotSupportedError', 'Leading dot in key systems name'); 70 expect_error('.org.w3.clearkey', [{}], 'NotSupportedError', 'Leading dot in key systems name');
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', [], 'InvalidAccessError', 'Empty sup portedConfigurations'); 80 expect_error('org.w3.clearkey', [], 'TypeError', 'Empty supportedCon figurations');
81 expect_config('org.w3.clearkey', [{}], {}, 'Empty configuration'); 81 expect_config('org.w3.clearkey', [{}], {}, 'Empty configuration');
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 }], {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 sessionTypes: [ 'persistent-license' ] 325 sessionTypes: [ 'persistent-license' ]
326 }], 'NotSupportedError', 'persistent-license sessionType'); 326 }], 'NotSupportedError', 'persistent-license sessionType');
327 327
328 // Verify invalid sessionTypes. 328 // Verify invalid sessionTypes.
329 expect_error('org.w3.clearkey', [{ 329 expect_error('org.w3.clearkey', [{
330 sessionTypes: [ 'foo' ] 330 sessionTypes: [ 'foo' ]
331 }], 'NotSupportedError', 'invalid sessionType'); 331 }], 'NotSupportedError', 'invalid sessionType');
332 </script> 332 </script>
333 </body> 333 </body>
334 </html> 334 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698