| <html> |
| <head> |
| <title>Check behaviour when requestiong an invalid header in getReponseHeader </title> |
| </head> |
| <body> |
| |
| <p>Test page for the <a href="http://bugs.webkit.org/show_bug.cgi?id=15356">bug 15356</a> : getResponseHeader and getAllResponseHeaders do not throw exceptions</p> |
| |
| <script type="text/javascript"> |
| |
| if (window.layoutTestController) |
| layoutTestController.dumpAsText(); |
| |
| function log (msg) { |
| document.body.appendChild(document.createTextNode(msg)); |
| document.body.appendChild(document.createElement("br")); |
| } |
| |
| var xhr; |
| |
| if (window.XMLHttpRequest) { |
| xhr = new XMLHttpRequest(); |
| } else { |
| try { |
| xhr = new ActiveXObject("Msxml2.XMLHTTP"); |
| } catch (ex) { |
| xhr = new ActiveXObject("Microsoft.XMLHTTP"); |
| } |
| } |
| |
| xhr.onreadystatechange = function() { |
| var rState = this.readyState; |
| if (rState > 2) { |
| // We expect an empty string or null |
| var header = this.getResponseHeader("(<>@)"); |
| if (header == "") { |
| log("PASSED " + rState); |
| } else { |
| log("FAILED " + rState); |
| } |
| } |
| } |
| xhr.open("GET","resources/1251.html", true); |
| xhr.send(null); |
| </script> |
| </body> |
| </html> |