Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444

This commit is contained in:
Josh Matthews 2017-04-17 12:06:02 +10:00 committed by Anthony Ramine
parent 25e8bf69e6
commit 665817d2a6
35333 changed files with 1818077 additions and 16036 deletions

View file

@ -0,0 +1,27 @@
<!doctype html>
<title>Casing of known headers</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
test(() => {
const client = new XMLHttpRequest
client.open("GET", "resources/header-content-length.asis", false)
client.send()
assert_equals(client.getAllResponseHeaders(), "content-length: 0\r\n")
})
test(() => {
const client = new XMLHttpRequest
client.open("GET", "resources/echo-headers.py", false)
client.setRequestHeader("THIS-IS-A-TEST", "1")
client.setRequestHeader("THIS-is-A-test", "2")
client.setRequestHeader("content-TYPE", "x/x")
client.send()
assert_regexp_match(client.responseText, /content-TYPE/)
assert_regexp_match(client.responseText, /THIS-IS-A-TEST: 1, 2/)
})
promise_test(() => {
return fetch("resources/echo-headers.py", {headers: [["THIS-is-A-test", 1], ["THIS-IS-A-TEST", 2]] }).then(res => res.text()).then(body => {
assert_regexp_match(body, /THIS-is-A-test: 1, 2/)
})
})
</script>