Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / web-apps / 013.html
blob4b80f16b4a316b78010289d3fcb7b67d99467f49
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2 <html lang="en-Hixie">
3 <head>
4 <title>statusText</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();
11 testRunner.waitUntilDone();
14 var p = document.getElementsByTagName('p')[0];
15 p.firstChild.data = 'FAIL: Test script did not finish.';
16 if (!window.XMLHttpRequest)
17 window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
18 var r = new XMLHttpRequest();
19 r.open('GET', '013-test.cgi', true);
20 p.firstChild.data = 'FAIL: Test script blocked on async request.';
21 r.send(null);
22 p.firstChild.data = 'FAIL: readyState did not change to 3 (Receiving). (Wait a few seconds, just in case it does.)';
23 setTimeout(function () {
24 r.onreadystatechange = function() {
25 if (r.readyState == 3) {
26 p.firstChild.data = 'FAIL: Exceptions were probably raised while accessing status or statusText.';
27 setTimeout(function() {
28 var c1 = r.status;
29 var c2 = r.statusText;
30 p.firstChild.data = c1 == 400 && c2 == 'Good work' ? 'PASS' : 'FAIL: Status at readyState 3 was: ' + c1 + ', "' + c2 + '"';
32 if (window.testRunner)
33 testRunner.notifyDone();
34 }, 500);
37 }, 1000);
38 </script>
39 </body>
40 </html>