Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / web-apps / 018.html
blob691a989a7909b3db6d8c6f7beee7d45f6b76ad32
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2 <html lang="en">
3 <head>
4 <title>XMLHttpRequest and responseXML -- script in the response</title>
5 </head>
6 <body>
7 <p>The following line should say "PASS" twice, and you should not
8 get any alerts or see the word "FAIL" anywhere on the next line.</p>
9 <p>FAIL: Script did not run.</p>
10 <script type="text/javascript">
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 var p = document.getElementsByTagName('p')[1];
15 p.firstChild.data = 'FAIL: Test script did not finish.';
16 window.onerror = function (error, file, line) { p.firstChild.data += ' (ERROR: ' + error + ' (line ' + line + '))'; }
17 if (!window.XMLHttpRequest)
18 window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
19 var r = new XMLHttpRequest();
20 r.open('GET', 'resources/018-test.xml', false);
21 r.send(null);
22 var form = r.responseXML.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'form')[0];
23 form.submit();
24 p.firstChild.data = form.firstChild.data + " " + r.responseXML.title;
25 </script>
26 </body>
27 </html>