2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
5 var t
= async_test("XMLHttpRequest: Recover from error by calling open() on the same XHR inside an error handler");
7 var req
= new XMLHttpRequest
;
8 req
.open("GET", "http://localhost:0/", true);
9 req
.onreadystatechange
= t
.step_func(function() {
10 if (req
.readyState
!= XMLHttpRequest
.DONE
)
13 assert_equals(0, req
.status
, "status of the first request should be 0");
15 req
.onreadystatechange
= t
.step_func(function() {
16 if (req
.readyState
!= XMLHttpRequest
.DONE
)
19 assert_equals(200, req
.status
, "status of the second request should be 200");
23 req
.open("GET", "resources/zero-length.txt", true);