Sync web-platform-tests up to revision a5b95cb31914507088a4eda16f7674bbc6f3313f
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / XMLHttpRequest / getallresponseheaders.htm
1 <!doctype html>
2 <title>XMLHttpRequest: getAllResponseHeaders()</title>
3 <script src=/resources/testharness.js></script>
4 <script src=/resources/testharnessreport.js></script>
5 <div id="log"></div>
6 <script>
7 async_test((t) => {
8   const client = new XMLHttpRequest()
9   client.onload = t.step_func_done(() => {
10     assert_equals(client.getAllResponseHeaders(), "foo-test: 1, 2, 3\r\n")
11   })
12   client.open("GET", "resources/headers-basic.asis")
13   client.send(null)
14 })
15
16 async_test((t) => {
17   const client = new XMLHttpRequest()
18   client.onload = t.step_func_done(() => {
19     assert_equals(client.getAllResponseHeaders(), "also-here: Mr. PB\r\newok: lego\r\nfoo-test: 1, 2\r\n")
20   })
21   client.open("GET", "resources/headers.asis")
22   client.send(null)
23 })
24 </script>