3 <p>Test for
<a href=
"rdar://problem/5766352">rdar://problem/
5766352</a>:
4 REGRESSION: XMLHttpRequest.abort() resets response status.
9 if (window
.testRunner
) {
10 testRunner
.dumpAsText();
11 testRunner
.waitUntilDone();
18 document
.getElementById("log").innerHTML
+= message
+ "<br>";
21 function logStatusAndState(comment
)
31 status
= "[exception]";
36 statusText
= req
.statusText
;
39 statusText
= "[exception]";
44 readyState
= req
.readyState
;
47 readyState
= "[exception]";
50 log((comment
? comment
+ ". ": "") + "Response status: " + status
+ "; statusText: '" + statusText
+ "'; readyState: " + readyState
);
53 function callBackFunction()
55 logStatusAndState("Onreadystatechange");
57 if (req
.readyState
== 4)
59 log("Aborting the request...");
61 logStatusAndState("After aborting the request");
63 log("Reopening the request to check that the status is reset...");
64 req
.onreadystatechange
= callBackFunction
;
65 req
.open("GET", "foobar", true);
66 req
.onreadystatechange
= null;
69 if (window
.testRunner
)
70 testRunner
.notifyDone();
74 req
= new XMLHttpRequest();
75 logStatusAndState("A newly created request");
76 req
.onreadystatechange
= callBackFunction
;
78 req
.open("GET","status-after-abort.html",true);
79 logStatusAndState("Opened request");
81 logStatusAndState("Sent request");