mirror of
https://github.com/servo/servo.git
synced 2025-08-27 16:18:21 +01:00
Throw RangeErrors in TextEncoder/TextDecoder constructors.
Fixes #5620. Fix the TODOs and FIXMEs to comply with the spec. Add test case for passing invalid invalid labels. Update test metadata; three test cases have been resolved upstream and will be fixed whenever the rust-encoding dependency is sufficiently upgraded.
This commit is contained in:
parent
f3aee90b06
commit
97301400a5
6 changed files with 37 additions and 130 deletions
14
tests/wpt/web-platform-tests/encoding/api-invalid-label.html
Normal file
14
tests/wpt/web-platform-tests/encoding/api-invalid-label.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<!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({name: 'RangeError'}, function() { new TextEncoder(invalidLabel); });
|
||||
assert_throws({name: 'RangeError'}, function() { new TextDecoder(invalidLabel); });
|
||||
}, 'Invalid label "' + invalidLabel + '" should be rejected by API.');
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue