1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN">
4 <title>multiple open()s
</title>
7 <p>Script did not run.
</p>
8 <script type=
"text/javascript">
10 testRunner
.dumpAsText();
12 var p
= document
.getElementsByTagName('p')[0];
13 p
.firstChild
.data
= 'FAIL: Test script failed and window.onerror not supported.';
14 window
.onerror = function (error
, file
, line
) { p
.firstChild
.data
= 'FAIL: ' + error
+ ' (line ' + line
+ ')'; }
15 //window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
16 var r
= new XMLHttpRequest();
17 if (r
.readyState
!= 0) { throw "readyState wrong after creation: should be 0, was " + r
.readyState
; }
18 r
.open('GET', '002a.txt', false);
19 if (r
.readyState
!= 1) { throw "readyState wrong after open(): should be 1, was " + r
.readyState
; }
20 r
.open('GET', '002b.txt', false);
21 if (r
.readyState
!= 1) { throw "readyState wrong after second open(): should be 1, was " + r
.readyState
; }
23 if (r
.readyState
!= 4) { throw "readyState wrong after sync send(): should be 4, was " + r
.readyState
; }
24 if (r
.responseText
!= 'TWO') { throw "Wrong file downloaded: " + r
.responseText
; }
25 r
.open('GET', '002c.txt', false);
26 if (r
.readyState
!= 1) { throw "readyState wrong after third open(): should be 1, was " + r
.readyState
; }
28 if (r
.readyState
!= 4) { throw "readyState wrong after second sync send(): should be 4, was " + r
.readyState
; }
29 if (r
.responseText
== 'TWOTHREE') { throw "responseText not cleared by open()"; }
30 if (r
.responseText
!= 'THREE') { throw "Wrong file downloaded: " + r
.responseText
; }
31 p
.firstChild
.data
= 'PASS';