mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4'
This commit is contained in:
parent
4401622eb1
commit
b77ad115f6
16832 changed files with 270819 additions and 87621 deletions
|
@ -3,35 +3,54 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var headerDictWS = {"name1": " space ",
|
||||
"name2": "\ttab\t",
|
||||
"name3": " spaceAndTab\t",
|
||||
"name4": "\r\n newLine", //obs-fold cases
|
||||
"name5": "newLine\r\n ",
|
||||
"name6": "\r\n\tnewLine",
|
||||
};
|
||||
const expectations = {
|
||||
"name1": [" space ", "space"],
|
||||
"name2": ["\ttab\t", "tab"],
|
||||
"name3": [" spaceAndTab\t", "spaceAndTab"],
|
||||
"name4": ["\r\n newLine", "newLine"], //obs-fold cases
|
||||
"name5": ["newLine\r\n ", "newLine"],
|
||||
"name6": ["\r\n\tnewLine", "newLine"],
|
||||
"name7": ["\t\f\tnewLine\n", "\f\tnewLine"],
|
||||
"name8": ["newLine\xa0", "newLine\xa0"], // \xa0 == non breaking space
|
||||
};
|
||||
|
||||
test(function() {
|
||||
var headers = new Headers(headerDictWS);
|
||||
for (const name in headerDictWS)
|
||||
assert_equals(headers.get(name), headerDictWS[name].trim(),
|
||||
"name: " + name + " has normalized value: " + headerDictWS[name].trim());
|
||||
test(function () {
|
||||
const headerDict = Object.fromEntries(
|
||||
Object.entries(expectations).map(([name, [actual]]) => [name, actual]),
|
||||
);
|
||||
var headers = new Headers(headerDict);
|
||||
for (const name in expectations) {
|
||||
const expected = expectations[name][1];
|
||||
assert_equals(
|
||||
headers.get(name),
|
||||
expected,
|
||||
"name: " + name + " has normalized value: " + expected,
|
||||
);
|
||||
}
|
||||
}, "Create headers with not normalized values");
|
||||
|
||||
test(function() {
|
||||
test(function () {
|
||||
var headers = new Headers();
|
||||
for (const name in headerDictWS) {
|
||||
headers.append(name, headerDictWS[name]);
|
||||
assert_equals(headers.get(name), headerDictWS[name].trim(),
|
||||
"name: " + name + " has value: " + headerDictWS[name].trim());
|
||||
for (const name in expectations) {
|
||||
headers.append(name, expectations[name][0]);
|
||||
const expected = expectations[name][1];
|
||||
assert_equals(
|
||||
headers.get(name),
|
||||
expected,
|
||||
"name: " + name + " has value: " + expected,
|
||||
);
|
||||
}
|
||||
}, "Check append method with not normalized values");
|
||||
|
||||
test(function() {
|
||||
test(function () {
|
||||
var headers = new Headers();
|
||||
for (const name in headerDictWS) {
|
||||
headers.set(name, headerDictWS[name]);
|
||||
assert_equals(headers.get(name), headerDictWS[name].trim(),
|
||||
"name: " + name + " has value: " + headerDictWS[name].trim());
|
||||
for (const name in expectations) {
|
||||
headers.set(name, expectations[name][0]);
|
||||
const expected = expectations[name][1];
|
||||
assert_equals(
|
||||
headers.get(name),
|
||||
expected,
|
||||
"name: " + name + " has value: " + expected,
|
||||
);
|
||||
}
|
||||
}, "Check set method with not normalized values");
|
||||
|
|
|
@ -49,7 +49,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -75,7 +75,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -100,7 +100,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -133,7 +133,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -158,7 +158,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -182,7 +182,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -222,7 +222,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", lyingProxy, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", lyingProxy]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", lyingProxy, "a"]);
|
||||
|
@ -262,7 +262,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", lyingProxy, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", lyingProxy]);
|
||||
}, "Correct operation ordering with repeated keys");
|
||||
|
||||
|
@ -285,7 +285,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
@ -328,7 +328,7 @@ test(function() {
|
|||
// we're a sequence, during overload resolution.
|
||||
assert_array_equals(log[0], ["get", record, Symbol.iterator, proxy]);
|
||||
// Then we have the [[OwnPropertyKeys]] from
|
||||
// https://heycam.github.io/webidl/#es-to-record step 4.
|
||||
// https://webidl.spec.whatwg.org/#es-to-record step 4.
|
||||
assert_array_equals(log[1], ["ownKeys", record]);
|
||||
// Then the [[GetOwnProperty]] from step 5.1.
|
||||
assert_array_equals(log[2], ["getOwnPropertyDescriptor", record, "a"]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue