servo/tests/wpt/web-platform-tests/encoding/api-invalid-label.html

14 lines
486 B
HTML

<!DOCTYPE html>
<title>Encoding API: invalid label</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var invalidLabel = "invalid-invalidLabel"
test(function() {
assert_throws(new RangeError(), function() { new TextEncoder(invalidLabel); });
assert_throws(new RangeError(), function() { new TextDecoder(invalidLabel); });
}, 'Invalid label "' + invalidLabel + '" should be rejected by API.');
</script>