3 <title>Test XmlHttpRequest onreadystatechange being called for each chunk of data
</title>
5 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=7392">bug
7392</a>:
6 GMAIL: XMLHttpRequest does not correctly report
"Interactive" state on receipt of load data.
</p>
9 if (window
.testRunner
) {
10 testRunner
.dumpAsText();
11 testRunner
.waitUntilDone();
14 var console_messages
= document
.createElement("ol");
15 document
.body
.appendChild(console_messages
);
21 var item
= document
.createElement("li");
22 item
.appendChild(document
.createTextNode(message
));
23 console_messages
.appendChild(item
);
26 function get(url
, async
)
28 if (window
.XMLHttpRequest
) {
29 req
= new XMLHttpRequest();
32 req
= new ActiveXObject("Msxml2.XMLHTTP");
34 req
= new ActiveXObject("Microsoft.XMLHTTP");
38 req
.onreadystatechange
= processStateChange
;
40 req
.open('GET', url
, async
);
43 if (!async
&& req
.status
!= 200)
44 throw ("HTTP request failed, status: " + req
.status
);
49 function processStateChange(){
50 if (req
.readyState
== 3)
52 else if (req
.readyState
== 4) {
53 log((count
> 1) ? "SUCCESS" : "FAILURE (count = " + count
+ ")");
54 if (window
.testRunner
)
55 testRunner
.notifyDone();
60 get('interactive-state.cgi', true);