Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-test-custom-headers.html
blob6b1b49c507373fa2e5a024b33e8451d5767b6a98
1 <html>
2 <head>
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;
8 var xhr;
10 if (window.XMLHttpRequest) {
11 xhr = new XMLHttpRequest();
12 } else {
13 try {
14 xhr = new ActiveXObject("Msxml2.XMLHTTP");
15 } catch (ex) {
16 xhr = new ActiveXObject("Microsoft.XMLHTTP");
20 xhr.open("GET", "resources/custom-headers.php");
21 xhr.send(null);
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");
29 finishJSTest();
33 </script>
34 </head>
36 <body>
37 </body>
38 </html>