mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
parent
fb4f421c8b
commit
296fa2512b
21852 changed files with 2080936 additions and 892894 deletions
|
@ -16,8 +16,17 @@
|
|||
};
|
||||
|
||||
var noBodyConsumed = new Request("");
|
||||
noBodyConsumed.blob();
|
||||
var bodyConsumed = new Request("", initValuesDict);
|
||||
|
||||
test(() => {
|
||||
assert_equals(noBodyConsumed.body, null, "body's default value is null");
|
||||
assert_false(noBodyConsumed.bodyUsed , "bodyUsed is false when request is not disturbed");
|
||||
assert_not_equals(bodyConsumed.body, null, "non-null body");
|
||||
assert_true(bodyConsumed.body instanceof ReadableStream, "non-null body type");
|
||||
assert_false(noBodyConsumed.bodyUsed, "bodyUsed is false when request is not disturbed");
|
||||
}, "Request's body: initial state");
|
||||
|
||||
noBodyConsumed.blob();
|
||||
bodyConsumed.blob();
|
||||
|
||||
test(function() {
|
||||
|
@ -39,13 +48,37 @@
|
|||
assert_throws(new TypeError(), function() { new Request(bodyConsumed); });
|
||||
}, "Check creating a new request from a disturbed request");
|
||||
|
||||
test(function() {
|
||||
promise_test(function() {
|
||||
var bodyRequest = new Request("", initValuesDict);
|
||||
const originalBody = bodyRequest.body;
|
||||
assert_false(bodyRequest.bodyUsed , "bodyUsed is false when request is not disturbed");
|
||||
var requestFromRequest = new Request(bodyRequest);
|
||||
assert_true(bodyRequest.bodyUsed , "bodyUsed is true when request is disturbed");
|
||||
assert_equals(bodyRequest.body, originalBody, "body should not change");
|
||||
assert_not_equals(originalBody, undefined, "body should not be undefined");
|
||||
assert_not_equals(originalBody, null, "body should not be null");
|
||||
assert_not_equals(requestFromRequest.body, originalBody, "new request's body is new");
|
||||
return requestFromRequest.text(text => {
|
||||
assert_equals(text, "Request's body");
|
||||
});
|
||||
}, "Input request used for creating new request became disturbed");
|
||||
|
||||
promise_test(() => {
|
||||
const bodyRequest = new Request("", initValuesDict);
|
||||
const originalBody = bodyRequest.body;
|
||||
assert_false(bodyRequest.bodyUsed , "bodyUsed is false when request is not disturbed");
|
||||
const requestFromRequest = new Request(bodyRequest, { body : "init body" });
|
||||
assert_true(bodyRequest.bodyUsed , "bodyUsed is true when request is disturbed");
|
||||
assert_equals(bodyRequest.body, originalBody, "body should not change");
|
||||
assert_not_equals(originalBody, undefined, "body should not be undefined");
|
||||
assert_not_equals(originalBody, null, "body should not be null");
|
||||
assert_not_equals(requestFromRequest.body, originalBody, "new request's body is new");
|
||||
|
||||
return requestFromRequest.text(text => {
|
||||
assert_equals(text, "init body");
|
||||
});
|
||||
}, "Input request used for creating new request became disturbed even if body is not used");
|
||||
|
||||
promise_test(function(test) {
|
||||
assert_true(bodyConsumed.bodyUsed , "bodyUsed is true when request is disturbed");
|
||||
return promise_rejects(test, new TypeError(), bodyConsumed.blob());
|
||||
|
|
|
@ -26,21 +26,11 @@
|
|||
"Expect TypeError exception");
|
||||
},"Input URL has credentials");
|
||||
|
||||
test(function() {
|
||||
assert_throws(new TypeError() , function() { new Request("", {"mode" : "navigate"}); },
|
||||
"Expect TypeError exception");
|
||||
},"RequestInit's mode is navigate");
|
||||
|
||||
test(function() {
|
||||
assert_throws(new TypeError() , function() { new Request("", {"referrer" : "http://:not a valid URL"}); },
|
||||
"Expect TypeError exception");
|
||||
},"RequestInit's referrer is invalid");
|
||||
|
||||
test(function() {
|
||||
assert_throws(new TypeError() , function() { new Request("", {"referrer" : "http://test.url"}); },
|
||||
"Expect TypeError exception");
|
||||
},"RequestInit's referrer has invalid origin")
|
||||
|
||||
test(function() {
|
||||
assert_throws(new TypeError() , function() { new Request("", {"method" : "IN VALID"}); },
|
||||
"Expect TypeError exception");
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
[NoInterfaceObject,
|
||||
Exposed=(Window,Worker)]
|
||||
interface Body {
|
||||
readonly attribute ReadableStream? body;
|
||||
readonly attribute boolean bodyUsed;
|
||||
[NewObject] Promise<ArrayBuffer> arrayBuffer();
|
||||
[NewObject] Promise<Blob> blob();
|
||||
|
@ -70,7 +71,11 @@
|
|||
enum RequestCredentials { "omit", "same-origin", "include" };
|
||||
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
|
||||
enum RequestRedirect { "follow", "error", "manual" };
|
||||
enum ReferrerPolicy { "", "no-referrer", "no-referrer-when-downgrade", "origin-only", "origin-when-cross-origin", "unsafe-url" };
|
||||
enum ReferrerPolicy {
|
||||
"", "no-referrer", "no-referrer-when-downgrade", "origin",
|
||||
"origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin",
|
||||
"strict-origin-when-cross-origin"
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
var idlsArray = new IdlArray();
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
var referrers = {"givenValues" : ["/relative/ressource",
|
||||
"http://{{host}}:{{ports[http][0]}}/relative/ressource?query=true#fragment",
|
||||
"http://{{host}}:{{ports[http][0]}}/",
|
||||
"http://test.url",
|
||||
"about:client",
|
||||
""
|
||||
],
|
||||
|
@ -23,6 +24,7 @@
|
|||
"http://{{host}}:{{ports[http][0]}}/relative/ressource?query=true#fragment",
|
||||
"http://{{host}}:{{ports[http][0]}}/",
|
||||
"about:client",
|
||||
"about:client",
|
||||
""
|
||||
]
|
||||
};
|
||||
|
@ -31,18 +33,24 @@
|
|||
"no-referrer-when-downgrade",
|
||||
"origin",
|
||||
"origin-when-cross-origin",
|
||||
"unsafe-url"
|
||||
"unsafe-url",
|
||||
"same-origin",
|
||||
"strict-origin",
|
||||
"strict-origin-when-cross-origin"
|
||||
],
|
||||
"expectedValues" : ["",
|
||||
"no-referrer",
|
||||
"no-referrer-when-downgrade",
|
||||
"origin",
|
||||
"origin-when-cross-origin",
|
||||
"unsafe-url"
|
||||
"unsafe-url",
|
||||
"same-origin",
|
||||
"strict-origin",
|
||||
"strict-origin-when-cross-origin"
|
||||
]
|
||||
};
|
||||
var modes = {"givenValues" : ["same-origin", "no-cors", "cors"],
|
||||
"expectedValues" : ["same-origin", "no-cors", "cors"]
|
||||
var modes = {"givenValues" : ["same-origin", "no-cors", "cors", "navigate"],
|
||||
"expectedValues" : ["same-origin", "no-cors", "cors", "same-origin"]
|
||||
};
|
||||
var credentials = {"givenValues" : ["omit", "same-origin", "include"],
|
||||
"expectedValues" : ["omit", "same-origin", "include"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue