OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test MediaKeys::isTypeSupported()</title> | 4 <title>Test MediaKeys::isTypeSupported()</title> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <div id="log"></div> | 9 <div id="log"></div> |
10 <script> | 10 <script> |
| 11 // Timeout for all tests to run. |
| 12 setup({ timeout: 60000 }); |
| 13 |
11 // Generate a distinct test for each type in |types|. | 14 // Generate a distinct test for each type in |types|. |
12 function test_type_support(types, expectation, description) | 15 function test_type_support(types, expectation, description) |
13 { | 16 { |
14 for (var i = 0; i < types.length; ++i) { | 17 for (var i = 0; i < types.length; ++i) { |
15 var type = types[i]; | 18 var type = types[i]; |
16 test(function() | 19 test(function() |
17 { | 20 { |
18 assert_true(type.length == 1 || type.length == 2); | 21 assert_true(type.length == 1 || type.length == 2); |
19 assert_equals(MediaKeys.isTypeSupported.apply( | 22 assert_equals(MediaKeys.isTypeSupported.apply( |
20 this, type), expectation, 'isTypeSupported'); | 23 this, type), expectation, 'isTypeSupported'); |
21 }, description + ": '" + type.join("', '") + "'"); | 24 }, description + ": '" + type.join("', '") + "'", |
| 25 { timeout: 60000 }); |
22 } | 26 } |
23 }; | 27 }; |
24 | 28 |
25 test_type_support([ | 29 test_type_support([ |
26 // Empty key system. | 30 // Empty key system. |
27 [''], | 31 [''], |
28 ['', 'video/webm'], | 32 ['', 'video/webm'], |
29 // Unsupported key system. | 33 // Unsupported key system. |
30 ['com.example.foo'], | 34 ['com.example.foo'], |
31 ['com.example.foo', 'video/webm'], | 35 ['com.example.foo', 'video/webm'], |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // The actually codec names are case sensitive. | 124 // The actually codec names are case sensitive. |
121 ['org.w3.clearkey', 'video/webm; codecs="Vp8"'], | 125 ['org.w3.clearkey', 'video/webm; codecs="Vp8"'], |
122 ['org.w3.clearkey', 'video/webm; codecs="VP8"'], | 126 ['org.w3.clearkey', 'video/webm; codecs="VP8"'], |
123 // Non-ASCII contentTypes. | 127 // Non-ASCII contentTypes. |
124 ['org.w3.clearkey', 'video/webm\u263A'], | 128 ['org.w3.clearkey', 'video/webm\u263A'], |
125 ['org.w3.clearkey', 'video/webm; codecs="vp8\u263A"'], | 129 ['org.w3.clearkey', 'video/webm; codecs="vp8\u263A"'], |
126 ], false, 'Test Clear Key with invalid contentTypes'); | 130 ], false, 'Test Clear Key with invalid contentTypes'); |
127 </script> | 131 </script> |
128 </body> | 132 </body> |
129 </html> | 133 </html> |
OLD | NEW |