auto merge of #3917 : mukilan/servo/xhr-status-async, r=jdm

Fixes #3877
This commit is contained in:
bors-servo 2014-11-06 19:00:29 -07:00
commit 338a9c3f05
9 changed files with 30 additions and 99 deletions

View file

@ -890,8 +890,8 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
}, },
LoadingMsg(_, partial_response) => { LoadingMsg(_, partial_response) => {
// For synchronous requests, this should not fire any events, and just store data // For synchronous requests, this should not fire any events, and just store data
// Part of step 13, send() (processing response body) // Part of step 11, send() (processing response body)
// XXXManishearth handle errors, if any (substep 1) // XXXManishearth handle errors, if any (substep 2)
*self.response.borrow_mut() = partial_response; *self.response.borrow_mut() = partial_response;
if !self.sync.get() { if !self.sync.get() {
@ -903,22 +903,23 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
} }
}, },
DoneMsg(_) => { DoneMsg(_) => {
// Part of step 13, send() (processing response end of file) assert!(self.ready_state.get() == HeadersReceived ||
// XXXManishearth handle errors, if any (substep 1) self.ready_state.get() == Loading ||
self.sync.get());
// Substep 3 // Part of step 11, send() (processing response end of file)
if self.ready_state.get() == Loading || self.sync.get() { // XXXManishearth handle errors, if any (substep 2)
// Subsubsteps 2-4
// Subsubsteps 5-7
self.send_flag.set(false); self.send_flag.set(false);
self.change_ready_state(XHRDone); self.change_ready_state(XHRDone);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
// Subsubsteps 5-7 // Subsubsteps 10-12
self.dispatch_response_progress_event("progress".to_string()); self.dispatch_response_progress_event("progress".to_string());
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_response_progress_event("load".to_string()); self.dispatch_response_progress_event("load".to_string());
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_response_progress_event("loadend".to_string()); self.dispatch_response_progress_event("loadend".to_string());
}
}, },
ErroredMsg(_, e) => { ErroredMsg(_, e) => {
self.send_flag.set(false); self.send_flag.set(false);

View file

@ -1,6 +1,5 @@
[anonymous-mode-unsupported.htm] [anonymous-mode-unsupported.htm]
type: testharness type: testharness
expected: TIMEOUT
[XMLHttpRequest: anonymous mode unsupported] [XMLHttpRequest: anonymous mode unsupported]
expected: TIMEOUT expected: FAIL

View file

@ -1,6 +0,0 @@
[open-after-setrequestheader.htm]
type: testharness
expected: TIMEOUT
[XMLHttpRequest: open() after setRequestHeader()]
expected: TIMEOUT

View file

@ -1,3 +1,8 @@
[response-json.htm] [response-json.htm]
type: testharness type: testharness
expected: TIMEOUT [JSON object roundtrip]
expected: FAIL
[JSON roundtrip with Japanese text]
expected: FAIL

View file

@ -1,9 +1,8 @@
[send-entity-body-get-head-async.htm] [send-entity-body-get-head-async.htm]
type: testharness type: testharness
expected: TIMEOUT
[XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire (GET)] [XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire (GET)]
expected: NOTRUN expected: FAIL
[XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire (HEAD)] [XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire (HEAD)]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +0,0 @@
[send-no-response-event-loadend.htm]
type: testharness
expected: TIMEOUT
[XMLHttpRequest: The send() method: Fire a progress event named loadend (no response entity body)]
expected: TIMEOUT

View file

@ -1,6 +0,0 @@
[send-no-response-event-order.htm]
type: testharness
expected: TIMEOUT
[XMLHttpRequest: The send() method: event order when there is no response entity body]
expected: TIMEOUT

View file

@ -1,3 +1,4 @@
[status-async.htm] [status-async.htm]
type: testharness type: testharness
expected: TIMEOUT disabled: issue 3596

View file

@ -1,60 +1,4 @@
[status-error.htm] [status-error.htm]
type: testharness type: testharness
expected: TIMEOUT disabled: issue 3596
[XMLHttpRequest: status error handling GET 200]
expected: TIMEOUT
[XMLHttpRequest: status error handling GET 400]
expected: TIMEOUT
[XMLHttpRequest: status error handling GET 401]
expected: TIMEOUT
[XMLHttpRequest: status error handling GET 404]
expected: TIMEOUT
[XMLHttpRequest: status error handling GET 410]
expected: TIMEOUT
[XMLHttpRequest: status error handling GET 500]
expected: TIMEOUT
[XMLHttpRequest: status error handling GET 699]
expected: TIMEOUT
[XMLHttpRequest: status error handling HEAD 200]
expected: TIMEOUT
[XMLHttpRequest: status error handling HEAD 404]
expected: TIMEOUT
[XMLHttpRequest: status error handling HEAD 500]
expected: TIMEOUT
[XMLHttpRequest: status error handling HEAD 699]
expected: TIMEOUT
[XMLHttpRequest: status error handling POST 200]
expected: TIMEOUT
[XMLHttpRequest: status error handling POST 404]
expected: TIMEOUT
[XMLHttpRequest: status error handling POST 500]
expected: TIMEOUT
[XMLHttpRequest: status error handling POST 699]
expected: TIMEOUT
[XMLHttpRequest: status error handling PUT 200]
expected: TIMEOUT
[XMLHttpRequest: status error handling PUT 404]
expected: TIMEOUT
[XMLHttpRequest: status error handling PUT 500]
expected: TIMEOUT
[XMLHttpRequest: status error handling PUT 699]
expected: TIMEOUT