mirror of
https://github.com/servo/servo.git
synced 2025-10-02 09:39:14 +01:00
Implement the Request API for the Fetch API.
This commit adds new files related to implementing the [Request API](https://fetch.spec.whatwg.org/#request-class). This commit also changes the expected web platform tests results. It also modifies the following files: components/net_traits/request.rs HeapSizeOf is implemented in net_traits/request so that dom::request can be used as a wrapper around net_traits::request::Request. components/script/dom/headers.rs Several methods are added to Headers so that request can access and modify some of the headers fields.
This commit is contained in:
parent
b7facf41cb
commit
fabe2b8f7e
13 changed files with 1070 additions and 359 deletions
|
@ -1,62 +1,5 @@
|
|||
[request-error.html]
|
||||
type: testharness
|
||||
[RequestInit's window is not null]
|
||||
expected: FAIL
|
||||
|
||||
[Input URL is not valid]
|
||||
expected: FAIL
|
||||
|
||||
[Input URL has credentials]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's mode is navigate]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's referrer is invalid]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's referrer has invalid origin]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's method is invalid]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's method is forbidden]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's mode is no-cors and method is not simple]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's mode is no-cors and integrity is not empty]
|
||||
expected: FAIL
|
||||
|
||||
[RequestInit's cache mode is only-if-cached and mode is not same-origin]
|
||||
expected: FAIL
|
||||
|
||||
[Request should get its content-type from the init request]
|
||||
expected: FAIL
|
||||
|
||||
[Request should not get its content-type from the init request if init headers are provided]
|
||||
expected: FAIL
|
||||
|
||||
[Request should get its content-type from the body if none is provided]
|
||||
expected: FAIL
|
||||
|
||||
[Request should get its content-type from init headers if one is provided]
|
||||
expected: FAIL
|
||||
|
||||
[Bad referrerPolicy init parameter value]
|
||||
expected: FAIL
|
||||
|
||||
[Bad mode init parameter value]
|
||||
expected: FAIL
|
||||
|
||||
[Bad credentials init parameter value]
|
||||
expected: FAIL
|
||||
|
||||
[Bad cache init parameter value]
|
||||
expected: FAIL
|
||||
|
||||
[Bad redirect init parameter value]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,110 +1,5 @@
|
|||
[request-headers.html]
|
||||
type: testharness
|
||||
[Adding valid request header "Content-Type: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid request header "Potato: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid request header "proxy: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid request header "proxya: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid request header "sec: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid request header "secb: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Accept-Charset: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "accept-charset: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "ACCEPT-ENCODING: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Accept-Encoding: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Access-Control-Request-Headers: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Access-Control-Request-Method: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Connection: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Content-Length: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Cookie: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Cookie2: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Date: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "DNT: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Expect: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Host: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Keep-Alive: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Origin: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Referer: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "TE: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Trailer: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Transfer-Encoding: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Upgrade: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Via: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Proxy-: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "proxy-a: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "Sec-: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid request header "sec-b: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid no-cors request header "Accept: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid no-cors request header "Accept-Language: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid no-cors request header "content-language: OK"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding valid no-cors request header "content-type: application/x-www-form-urlencoded"]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -123,42 +18,6 @@
|
|||
[Adding valid no-cors request header "CONTENT-type: text/plain;charset=UTF-8"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid no-cors request header "Content-Type: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid no-cors request header "Potato: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid no-cors request header "proxy: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid no-cors request header "proxya: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid no-cors request header "sec: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Adding invalid no-cors request header "secb: KO"]
|
||||
expected: FAIL
|
||||
|
||||
[Check that request constructor is filtering headers provided as init parameter]
|
||||
expected: FAIL
|
||||
|
||||
[Check that no-cors request constructor is filtering headers provided as init parameter]
|
||||
expected: FAIL
|
||||
|
||||
[Check that no-cors request constructor is filtering headers provided as part of request parameter]
|
||||
expected: FAIL
|
||||
|
||||
[Request should get its content-type from the init request]
|
||||
expected: FAIL
|
||||
|
||||
[Request should not get its content-type from the init request if init headers are provided]
|
||||
expected: FAIL
|
||||
|
||||
[Request should get its content-type from the body if none is provided]
|
||||
expected: FAIL
|
||||
|
||||
[Request should get its content-type from init headers if one is provided]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,35 +1,5 @@
|
|||
[request-init-001.sub.html]
|
||||
type: testharness
|
||||
[Check method init value of GET and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check method init value of HEAD and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check method init value of POST and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check method init value of PUT and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check method init value of DELETE and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check method init value of OPTIONS and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check method init value of head and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrer init value of /relative/ressource and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrer init value of http://web-platform.test:8000/relative/ressource?query=true#fragment and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrer init value of http://web-platform.test:8000/ and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrer init value of about:client and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -39,69 +9,3 @@
|
|||
[Check referrerPolicy init value of and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrerPolicy init value of no-referrer and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrerPolicy init value of no-referrer-when-downgrade and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrerPolicy init value of origin and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrerPolicy init value of origin-when-cross-origin and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrerPolicy init value of unsafe-url and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check mode init value of same-origin and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check mode init value of no-cors and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check mode init value of cors and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check credentials init value of omit and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check credentials init value of same-origin and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check credentials init value of include and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check cache init value of default and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check cache init value of no-store and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check cache init value of reload and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check cache init value of no-cache and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check cache init value of force-cache and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check redirect init value of follow and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check redirect init value of error and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check redirect init value of manual and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check integrity init value of and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check integrity init value of AZERTYUIOP1234567890 and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
[Check window init value of null and associated getter]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,3 +1,23 @@
|
|||
[request-structure.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Request has arrayBuffer method]
|
||||
expected: FAIL
|
||||
|
||||
[Request has blob method]
|
||||
expected: FAIL
|
||||
|
||||
[Request has formData method]
|
||||
expected: FAIL
|
||||
|
||||
[Request has json method]
|
||||
expected: FAIL
|
||||
|
||||
[Request has text method]
|
||||
expected: FAIL
|
||||
|
||||
[Check headers attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Check referrer attribute]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -147,6 +147,7 @@ test_interfaces([
|
|||
"ProgressEvent",
|
||||
"RadioNodeList",
|
||||
"Range",
|
||||
"Request",
|
||||
"Screen",
|
||||
"Storage",
|
||||
"StorageEvent",
|
||||
|
|
|
@ -89,6 +89,7 @@ test_interfaces([
|
|||
"ProgressEvent",
|
||||
"RadioNodeList",
|
||||
"Range",
|
||||
"Request",
|
||||
"Screen",
|
||||
"Storage",
|
||||
"StorageEvent",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue