auto merge of #3732 : mukilan/servo/xhr-issue-3630, r=jdm

This fixes issue #3630
A short summary of the changes:
* Use atomic generation id to cancel inflight requests
* Handles nested calls to abort, open, send inside handlers
* Adds XHRReleaseMsg to delay freeing XHR object till all
  inflight events are processed
* Handles both timeout, errors and abort/open in a symmetric fashion
  i.e All inflight events will be cancelled for timeouts, aborts,
    errors and on calling open.
* Change the ErroredMsg enum to be more symmetric with the returned
  Error enum

I noticed a few possible changes that could make the code for fetch task simpler:
* We can remove the additional timer task and let the fetch task manage 
  its own timer (or maybe the resource loader can do this.)
* The CORS related steps could also be moved into the resource loader.
* Right now upload events are not support. This requires some support 
  from resource loader.
This commit is contained in:
bors-servo 2014-11-04 05:06:34 -07:00
commit 4e24e4d8e9
14 changed files with 259 additions and 174 deletions

View file

@ -1,33 +1,32 @@
[data-uri.htm]
type: testharness
expected: TIMEOUT
[XHR method GET with charset text/plain]
expected: TIMEOUT
expected: FAIL
[XHR method GET with charset text/plain (base64)]
expected: TIMEOUT
expected: FAIL
[XHR method GET with charset text/html]
expected: TIMEOUT
expected: FAIL
[XHR method GET with charset image/png]
expected: TIMEOUT
expected: FAIL
[XHR method POST with charset text/plain]
expected: TIMEOUT
expected: FAIL
[XHR method PUT with charset text/plain]
expected: TIMEOUT
expected: FAIL
[XHR method DELETE with charset text/plain]
expected: TIMEOUT
expected: FAIL
[XHR method HEAD with charset text/plain]
expected: TIMEOUT
expected: FAIL
[XHR method UNICORN with charset text/plain]
expected: TIMEOUT
expected: FAIL
[XHR method GET with charset text/html;charset=UTF-8]
expected: TIMEOUT
expected: FAIL

View file

@ -1,6 +0,0 @@
[send-network-error-async-events.sub.htm]
type: testharness
expected: TIMEOUT
[XmlHttpRequest: The send() method: Fire a progress event named error when Network error happens (synchronous flag is unset)]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[send-network-error-sync-events.sub.htm]
type: testharness
[XmlHttpRequest: The send() method: Throw a "throw an "NetworkError" exception when Network error happens (synchronous flag is set)]
expected: FAIL

View file

@ -1,3 +1,3 @@
[xmlhttprequest-timeout-abortedonmain.html]
type: testharness
expected: CRASH
expected: TIMEOUT

View file

@ -1,3 +1,3 @@
[xmlhttprequest-timeout-overrides.html]
type: testharness
expected: CRASH
expected: TIMEOUT

View file

@ -1,3 +1,3 @@
[xmlhttprequest-timeout-overridesexpires.html]
type: testharness
expected: CRASH
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[xmlhttprequest-timeout-worker-aborted.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[xmlhttprequest-timeout-worker-overrides.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +1,6 @@
[xmlhttprequest-timeout-worker-overridesexpires.html]
type: testharness
expected: TIMEOUT
[Timeout test: timeout set to expired value before load fires, original timeout at 1000, reset at 400 to 300]
disabled: racy test

View file

@ -1,3 +0,0 @@
[xmlhttprequest-timeout-worker-simple.html]
type: testharness
expected: TIMEOUT

View file

@ -1,4 +0,0 @@
[xmlhttprequest-timeout-worker-twice.html]
type: testharness
disabled: xhr issue #3630
expected: TIMEOUT