Update web-platform-tests to revision 04cd5eb8e5c47e4fe341f2fb541d39fa2346f464

This commit is contained in:
WPT Sync Bot 2018-11-16 21:03:13 -05:00
parent 0ab2c3f8a3
commit 1d0624b343
226 changed files with 4495 additions and 903 deletions

View file

@ -1,5 +1,32 @@
promise_test(() => fetch("../cors/resources/not-cors-safelisted.json").then(res => res.json().then(runTests)), "Loading data…");
const longValue = "s".repeat(127);
[
{
"headers": ["accept", "accept-language", "content-language"],
"values": [longValue, "", longValue]
},
{
"headers": ["content-type"],
"values": ["text/plain;" + "s".repeat(116), "text/plain"]
}
].forEach(testItem => {
testItem.headers.forEach(header => {
test(() => {
const noCorsHeaders = new Request("about:blank", { mode: "no-cors" }).headers;
testItem.values.forEach((value) => {
noCorsHeaders.append(header, value);
assert_equals(noCorsHeaders.get(header), testItem.values[0]);
});
noCorsHeaders.set(header, values.join(", "));
assert_equals(noCorsHeaders.get(header), testItem.values[0]);
noCorsHeaders.delete(header);
assert_false(noCorsHeaders.has(header));
}, "\"no-cors\" Headers object cannot have " + header + " set to " + testItem.values.join(", "));
});
});
function runTests(testArray) {
testArray = testArray.concat([
["dpr", "2"],
@ -14,6 +41,8 @@ function runTests(testArray) {
const noCorsHeaders = new Request("about:blank", { mode: "no-cors" }).headers;
noCorsHeaders.append(headerName, headerValue);
assert_false(noCorsHeaders.has(headerName));
noCorsHeaders.set(headerName, headerValue);
assert_false(noCorsHeaders.has(headerName));
}, "\"no-cors\" Headers object cannot have " + headerName + "/" + headerValue + " as header");
});
}