| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Encoding API: invalid label</title> | 2 <title>Encoding API: invalid label</title> |
| 3 <meta name="timeout" content="long"> |
| 3 <script src="../../../resources/testharness.js"></script> | 4 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> | 5 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script src="resources/encodings.js"></script> | 6 <script src="resources/encodings.js"></script> |
| 6 <script> | 7 <script> |
| 7 var tests = ["invalid-invalidLabel"]; | 8 var tests = ["invalid-invalidLabel"]; |
| 8 setup(function() { | 9 setup(function() { |
| 9 encodings_table.forEach(function(section) { | 10 encodings_table.forEach(function(section) { |
| 10 section.encodings.filter(function(encoding) { | 11 section.encodings.filter(function(encoding) { |
| 11 return encoding.name !== 'replacement'; | 12 return encoding.name !== 'replacement'; |
| 12 }).forEach(function(encoding) { | 13 }).forEach(function(encoding) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 24 tests.forEach(function(input) { | 25 tests.forEach(function(input) { |
| 25 test(function() { | 26 test(function() { |
| 26 assert_throws(new RangeError(), function() { new TextEncoder(input); }); | 27 assert_throws(new RangeError(), function() { new TextEncoder(input); }); |
| 27 }, 'Invalid label ' + format_value(input) + ' should be rejected by TextEncode
r.'); | 28 }, 'Invalid label ' + format_value(input) + ' should be rejected by TextEncode
r.'); |
| 28 | 29 |
| 29 test(function() { | 30 test(function() { |
| 30 assert_throws(new RangeError(), function() { new TextDecoder(input); }); | 31 assert_throws(new RangeError(), function() { new TextDecoder(input); }); |
| 31 }, 'Invalid label ' + format_value(input) + ' should be rejected by TextDecode
r.'); | 32 }, 'Invalid label ' + format_value(input) + ' should be rejected by TextDecode
r.'); |
| 32 }); | 33 }); |
| 33 </script> | 34 </script> |
| OLD | NEW |