Revision 6135f17c8825701fc2ec62117a08fdcadca4a0a2 authored by Rune Lillesveen on 27 March 2018, 12:06:44 UTC, committed by Blink WPT Bot on 27 March 2018, 12:15:41 UTC
Bug: 820299
Change-Id: I9e380416b18f30294fe7cb969a0ce7d0ab1fd7bd
Reviewed-on: https://chromium-review.googlesource.com/977910
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546082}
1 parent 2e48036
Raw File
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.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>
back to top