| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Encoding API: TextEncoder labels and whitespace</title> | 2 <title>Encoding API: TextEncoder labels and whitespace</title> |
| 3 <script src="../../../resources/testharness.js"></script> | 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> | 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script src="resources/shared.js"></script> | 5 <script src="resources/encodings.js"></script> |
| 6 <script> | 6 <script> |
| 7 var tests = [], failure_tests = []; | 7 var tests = [], failure_tests = []; |
| 8 setup(function() { | 8 setup(function() { |
| 9 var whitespace = [' ', '\t', '\n', '\f', '\r']; | 9 var whitespace = [' ', '\t', '\n', '\f', '\r']; |
| 10 var bad_whitespace = ['\u000B', '\u00A0', '\u2028', '\u2029']; | 10 var bad_whitespace = ['\u000B', '\u00A0', '\u2028', '\u2029']; |
| 11 encodings_table.forEach(function(section) { | 11 encodings_table.forEach(function(section) { |
| 12 section.encodings.filter(function(encoding) { | 12 section.encodings.filter(function(encoding) { |
| 13 return utf_encodings.indexOf(encoding.name) !== -1; | 13 return utf_encodings.indexOf(encoding.name) !== -1; |
| 14 }).forEach(function(encoding) { | 14 }).forEach(function(encoding) { |
| 15 var name = encoding.name; | 15 var name = encoding.name; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 failure_tests.forEach(function(t) { | 43 failure_tests.forEach(function(t) { |
| 44 var input = t[0], output = t[1]; | 44 var input = t[0], output = t[1]; |
| 45 test(function() { | 45 test(function() { |
| 46 assert_throws({name:'RangeError'}, | 46 assert_throws({name:'RangeError'}, |
| 47 function() { new TextEncoder(input); }, | 47 function() { new TextEncoder(input); }, |
| 48 'non-ASCII whitespace should not be stripped'); | 48 'non-ASCII whitespace should not be stripped'); |
| 49 }, format_value(input) + " => " + format_value(output)); | 49 }, format_value(input) + " => " + format_value(output)); |
| 50 }); | 50 }); |
| 51 </script> | 51 </script> |
| OLD | NEW |