Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / web-apps / 005.html
blobddb6456a5746222f62562def49c53e21ba1b1c2e
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2 <html lang="en">
3 <head>
4 <title>setRequestHeader twice for the same header</title>
5 </head>
6 <body>
7 <p>FAIL: Script did not run.</p>
8 <script type="text/javascript">
9 if (window.testRunner)
10 testRunner.dumpAsText();
12 var p = document.getElementsByTagName('p')[0];
13 p.firstChild.data = 'FAIL: Test script did not finish.';
14 window.onerror = function (error, file, line) { p.firstChild.data = 'ERROR: ' + error + ' (line ' + line + ')'; }
15 if (!window.XMLHttpRequest)
16 window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
17 var r = new XMLHttpRequest();
18 r.open('GET', '005-test.cgi', false);
19 r.setRequestHeader('X-Test-Header', 'ONE');
20 r.setRequestHeader('X-Test-Header', 'TWO');
21 r.send(null);
22 if (r.responseText == 'RESULT:[ONE, TWO]') {
23 p.firstChild.data = 'PASS';
24 } else {
25 p.firstChild.data = 'FAIL (' + r.responseText + ')';
27 </script>
28 </body>
29 </html>