Revision dcc531a79a68cd725ffe68fe06467c7e8560c8ad authored by Boris Zbarsky on 08 April 2016, 10:15:41 UTC, committed by James Graham on 08 April 2016, 10:47:04 UTC
1 parent 3d7a057
api-invalid-label.html
<!DOCTYPE html>
<title>Encoding API: invalid label</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/encodings.js"></script>
<script>
var tests = ["invalid-invalidLabel"];
setup(function() {
encodings_table.forEach(function(section) {
section.encodings.filter(function(encoding) {
return encoding.name !== 'replacement';
}).forEach(function(encoding) {
encoding.labels.forEach(function(label) {
["\u0000", "\u000b", "\u00a0", "\u2028", "\u2029"].forEach(function(ws) {
tests.push(ws + label);
tests.push(label + ws);
tests.push(ws + label + ws);
});
});
});
});
});
tests.forEach(function(input) {
test(function() {
assert_throws(new RangeError(), function() { new TextDecoder(input); });
}, 'Invalid label ' + format_value(input) + ' should be rejected by TextDecoder.');
});
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...