Update web-platform-tests to revision b'b3615436df24bedfdc4f14f959428307a86f74ce'

This commit is contained in:
WPT Sync Bot 2023-02-21 01:36:20 +00:00
parent 883dcbda45
commit 496ae4e174
66 changed files with 771 additions and 173 deletions

View file

@ -129,6 +129,23 @@ test(function () {
assert_true(iterator.next().done);
}, "Headers iterator is correctly updated with set-cookie changes");
test(function () {
const headers = new Headers([
["set-cookie", "a"],
["set-cookie", "b"],
["set-cookie", "c"]
]);
const iterator = headers[Symbol.iterator]();
assert_array_equals(iterator.next().value, ["set-cookie", "a"]);
headers.delete("set-cookie");
headers.append("set-cookie", "d");
headers.append("set-cookie", "e");
headers.append("set-cookie", "f");
assert_array_equals(iterator.next().value, ["set-cookie", "e"]);
assert_array_equals(iterator.next().value, ["set-cookie", "f"]);
assert_true(iterator.next().done);
}, "Headers iterator is correctly updated with set-cookie changes #2");
test(function () {
const headers = new Headers(headerList);
assert_true(headers.has("sEt-cOoKiE"));
@ -215,6 +232,31 @@ test(function () {
assert_array_equals(headers.getSetCookie(), ["z=z", "a=a", "n=n"]);
}, "Headers.prototype.getSetCookie preserves header ordering");
test(function () {
const headers = new Headers({"Set-Cookie": " a=b\n"});
headers.append("set-cookie", "\n\rc=d ");
assert_nested_array_equals([...headers], [
["set-cookie", "a=b"],
["set-cookie", "c=d"]
]);
headers.set("set-cookie", "\te=f ");
assert_nested_array_equals([...headers], [["set-cookie", "e=f"]]);
}, "Adding Set-Cookie headers normalizes their value");
test(function () {
assert_throws_js(TypeError, () => {
new Headers({"set-cookie": "\0"});
});
const headers = new Headers();
assert_throws_js(TypeError, () => {
headers.append("Set-Cookie", "a\nb");
});
assert_throws_js(TypeError, () => {
headers.set("Set-Cookie", "a\rb");
});
}, "Adding invalid Set-Cookie headers throws");
test(function () {
const response = new Response();
response.headers.append("Set-Cookie", "foo=bar");