| <title>Test XmlHttpRequest onreadystatechange being called for each chunk of data</title> |
| <p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7392">bug 7392</a>: |
| GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.</p> |
| if (window.layoutTestController) |
| layoutTestController.dumpAsText(); |
| var console_messages = document.createElement("ol"); |
| document.body.appendChild(console_messages); |
| var item = document.createElement("li"); |
| item.appendChild(document.createTextNode(message)); |
| console_messages.appendChild(item); |
| if (window.XMLHttpRequest) { |
| req = new XMLHttpRequest(); |
| req = new ActiveXObject("Msxml2.XMLHTTP"); |
| req = new ActiveXObject("Microsoft.XMLHTTP"); |
| req.onreadystatechange = processStateChange; |
| req.open('GET', url, async); |
| if (!async && req.status != 200) |
| throw ("HTTP request failed, status: " + req.status); |
| function processStateChange(){ |
| else if (req.readyState == 4) |
| log((count > 1) ? "SUCCESS" : "FAILURE (count = " + count + ")"); |
| get('interactive-state.cgi', true); |