mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision d011702f368b88b3bae86e7a8fd2ddd22e18b33c
This commit is contained in:
parent
f9608022ca
commit
299ad0f9d0
573 changed files with 38776 additions and 14942 deletions
|
@ -6,20 +6,16 @@
|
|||
<script>
|
||||
|
||||
encodings_table.forEach(function(section) {
|
||||
section.encodings.filter(function(encoding) {
|
||||
return encoding.name !== 'replacement';
|
||||
}).forEach(function(encoding) {
|
||||
if (utf_encodings.indexOf(encoding.name) !== -1) {
|
||||
section.encodings.forEach(function(encoding) {
|
||||
if (encoding.name !== 'replacement') {
|
||||
test(function() {
|
||||
assert_equals(new TextDecoder(encoding.name).encoding, encoding.name);
|
||||
assert_equals(new TextEncoder(encoding.name).encoding, encoding.name);
|
||||
}, 'UTF encodings are supported for encode and decode: ' + encoding.name);
|
||||
} else {
|
||||
test(function() {
|
||||
assert_equals(new TextDecoder(encoding.name).encoding, encoding.name);
|
||||
assert_throws(new RangeError(), function() { new TextEncoder(encoding.name); });
|
||||
}, 'Non-UTF encodings supported only for decode, not encode: ' + encoding.name);
|
||||
}, 'Encoding argument supported for decode: ' + encoding.name);
|
||||
}
|
||||
|
||||
test(function() {
|
||||
assert_equals(new TextEncoder(encoding.name).encoding, 'utf-8');
|
||||
}, 'Encoding argument not considered for encode: ' + encoding.name);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue