Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-crlf-getAllResponseHeader.html
blob6376058d2dc9c79bc0c539c37da6f17262a2ffd8
1 <html>
2 <head>
3 <title> Page test for bug 14898</title>
4 </head>
5 <body>
6 <p>Test page for the <a href="http://bugs.webkit.org/show_bug.cgi?id=14898">bug 14898</a> : XMLHttpRequest.getAllResponseHeaders should separate headers with CRLF</p>
7 <script type="text/javascript">
9 if (window.testRunner) {
10 testRunner.dumpAsText();
11 testRunner.waitUntilDone();
14 var xhr = new XMLHttpRequest();
15 xhr.onreadystatechange = function() {
16 if (this.readyState == 4) {
17 var responses = this.getAllResponseHeaders();
18 if (responses == null || responses == "") { //Check that headers were received
19 document.body.appendChild(document.createTextNode("No header received !!!! "));
22 if (responses.indexOf('\r\n') == -1) {
23 document.body.appendChild(document.createTextNode("FAILED"));
24 } else {
25 document.body.appendChild(document.createTextNode("PASS"));
28 if (window.testRunner)
29 testRunner.notifyDone();
32 xhr.open("GET", "testPage.html", true);
33 xhr.send(null);
35 </script>
36 </body>
37 </html>