blob: 40561f8dd62f3e11acc4de90276e8266e5363892 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html lang="en">
<head>
<title>multiple open()s</title>
</head>
<body>
<p>Script did not run.</p>
<script type="text/javascript">
if (window.testRunner)
testRunner.dumpAsText();
var p = document.getElementsByTagName('p')[0];
p.firstChild.data = 'FAIL: Test script failed and window.onerror not supported.';
window.onerror = function (error, file, line) { p.firstChild.data = 'FAIL: ' + error + ' (line ' + line + ')'; }
//window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
var r = new XMLHttpRequest();
if (r.readyState != 0) { throw "readyState wrong after creation: should be 0, was " + r.readyState; }
r.open('GET', '002a.txt', false);
if (r.readyState != 1) { throw "readyState wrong after open(): should be 1, was " + r.readyState; }
r.open('GET', '002b.txt', false);
if (r.readyState != 1) { throw "readyState wrong after second open(): should be 1, was " + r.readyState; }
r.send();
if (r.readyState != 4) { throw "readyState wrong after sync send(): should be 4, was " + r.readyState; }
if (r.responseText != 'TWO') { throw "Wrong file downloaded: " + r.responseText; }
r.open('GET', '002c.txt', false);
if (r.readyState != 1) { throw "readyState wrong after third open(): should be 1, was " + r.readyState; }
r.send();
if (r.readyState != 4) { throw "readyState wrong after second sync send(): should be 4, was " + r.readyState; }
if (r.responseText == 'TWOTHREE') { throw "responseText not cleared by open()"; }
if (r.responseText != 'THREE') { throw "Wrong file downloaded: " + r.responseText; }
p.firstChild.data = 'PASS';
</script>
</body>
</html>