Update web-platform-tests and CSS tests.

- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
Ms2ger 2017-02-06 11:06:12 +01:00
parent fb4f421c8b
commit 296fa2512b
21852 changed files with 2080936 additions and 892894 deletions

View file

@ -4,33 +4,32 @@
<script src="/resources/testharnessreport.js"></script>
<script src="resources/encodings.js"></script>
<script>
var tests = [];
setup(function() {
var whitespace = [' ', '\t', '\n', '\f', '\r'];
encodings_table.forEach(function(section) {
section.encodings.filter(function(encoding) {
return encoding.name !== 'replacement';
}).forEach(function(encoding) {
var name = encoding.name;
encoding.labels.forEach(function(label) {
tests.push([label, encoding.name]);
var whitespace = [' ', '\t', '\n', '\f', '\r'];
encodings_table.forEach(function(section) {
section.encodings.filter(function(encoding) {
return encoding.name !== 'replacement';
}).forEach(function(encoding) {
encoding.labels.forEach(function(label) {
test(function(t) {
assert_equals(
new TextDecoder(label).encoding, encoding.name,
'label for encoding should match');
assert_equals(
new TextDecoder(label.toUpperCase()).encoding, encoding.name,
'label matching should be case-insensitive');
whitespace.forEach(function(ws) {
tests.push([ws + label, encoding.name]);
tests.push([label + ws, encoding.name]);
tests.push([ws + label + ws, encoding.name]);
assert_equals(
new TextDecoder(ws + label).encoding, encoding.name,
'label for encoding with leading whitespace should match');
assert_equals(
new TextDecoder(label + ws).encoding, encoding.name,
'label for encoding with trailing whitespace should match');
assert_equals(
new TextDecoder(ws + label + ws).encoding, encoding.name,
'label for encoding with surrounding whitespace should match');
});
});
}, label + ' => ' + encoding.name);
});
});
});
tests.forEach(function(t) {
var input = t[0], output = t[1];
test(function() {
assert_equals(new TextDecoder(input).encoding, output,
'label for encoding should match');
assert_equals(new TextDecoder(input.toUpperCase()).encoding, output,
'label matching should be case-insensitive');
}, format_value(input) + " => " + format_value(output));
});
</script>