5 <p> Test bug
16989 : Add send() flag checks in XmlHttpRequest
</p>
6 <p> You should see PASS two times
</p>
10 <script type=
"text/javascript">
11 function log(message
) {
12 document
.getElementById("ans").appendChild(document
.createTextNode(message
));
13 document
.getElementById("ans").appendChild(document
.createElement("br"));
16 if (window
.testRunner
)
17 testRunner
.dumpAsText();
21 if (window
.XMLHttpRequest
) {
22 xhr
= new XMLHttpRequest();
25 xhr
= new ActiveXObject("Msxml2.XMLHTTP");
27 xhr
= new ActiveXObject("Microsoft.XMLHTTP");
31 // First test : test open method send() flag check
32 xhr
.open("GET", "resources/endlessxml.php", true);
35 if (xhr
.readyState
== 1)
39 // Call abort to prevent triggering some readystate events
44 // Second test : test setResponseHeader method send() flag check
45 xhr
.open("GET", "resources/endlessxml.php", true);
46 xhr
.setRequestHeader("Test1", "Test1");
49 // makes sure readyState is opened (bug in Opera)
50 if (xhr
.readyState
== 1)
51 xhr
.setRequestHeader("Test", "Test");
54 // Call abort to prevent triggering some readystate events
59 if (window
.testRunner
)
60 testRunner
.notifyDone();