3 <script src=
"/js-test-resources/js-test.js"></script>
4 <script type=
"text/javascript">
5 description('This test verifies that XMLHttpRequest properly handles list-valued headers.');
6 window
.jsTestIsAsync
= true;
10 if (window
.XMLHttpRequest
) {
11 xhr
= new XMLHttpRequest();
14 xhr
= new ActiveXObject("Msxml2.XMLHTTP");
16 xhr
= new ActiveXObject("Microsoft.XMLHTTP");
20 xhr
.open("GET", "resources/custom-headers.php");
23 xhr
.onreadystatechange = function() {
24 if(xhr
.readyState
== 4) {
25 shouldBeGreaterThanOrEqual("xhr.getResponseHeader(\"CONTENT-TYPE\").indexOf(\"text/plain\")", "0");
26 shouldBeEqualToString("xhr.getResponseHeader(\"x-custom-header-single\")", "single");
27 shouldBeEmptyString("xhr.getResponseHeader(\"x-custom-header-empty\")");
28 shouldBeEqualToString("xhr.getResponseHeader(\"x-custom-header-list\")", "one, two");