| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> | |
| <html lang="en"> | |
| <head> | |
| <title>Multiple setRequestHeader()s</title> | |
| </head> | |
| <body> | |
| <p>FAIL: Script did not run.</p> | |
| <script type="text/javascript"> | |
| if (window.testRunner) | |
| testRunner.dumpAsText(); | |
| var p = document.getElementsByTagName('p')[0]; | |
| p.firstChild.data = 'FAIL: Test script did not finish.'; | |
| window.onerror = function (error, file, line) { p.firstChild.data = 'ERROR: ' + error + ' (line ' + line + ')'; } | |
| if (!window.XMLHttpRequest) | |
| window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); } | |
| var r = new XMLHttpRequest(); | |
| r.open('GET', '015-test.cgi', false); | |
| r.setRequestHeader('X-Test-Header1', 'A'); | |
| r.setRequestHeader('X-Test-Header2', 'B'); | |
| r.setRequestHeader('X-Test-Header3', 'C'); | |
| r.send(null); | |
| if (r.responseText == 'RESULT:[A][B][C]') { | |
| p.firstChild.data = 'PASS'; | |
| } else { | |
| p.firstChild.data = 'FAIL (' + r.responseText + ')'; | |
| } | |
| </script> | |
| </body> | |
| </html> |