1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN">
4 <title>statusText
</title>
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.';
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() {
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();