mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -3,12 +3,18 @@ if (this.document === undefined) {
|
|||
importScripts("../resources/utils.js");
|
||||
}
|
||||
|
||||
function checkFetchResponse(url, data, mime) {
|
||||
function checkFetchResponse(url, data, mime, fetchMode) {
|
||||
var cut = (url.length >= 40) ? "[...]" : "";
|
||||
desc = "Fetching " + url.substring(0, 40) + cut + " is OK"
|
||||
desc = "Fetching " + url.substring(0, 40) + cut + " is OK";
|
||||
var init = { };
|
||||
if (fetchMode) {
|
||||
init.mode = fetchMode;
|
||||
desc += " (" + fetchMode + ")";
|
||||
}
|
||||
promise_test(function(test) {
|
||||
return fetch(url).then(function(resp) {
|
||||
return fetch(url, init).then(function(resp) {
|
||||
assert_equals(resp.status, 200, "HTTP status is 200");
|
||||
assert_equals(resp.statusText, "OK", "HTTP statusText is OK");
|
||||
assert_equals(resp.type, "basic", "response type is basic");
|
||||
assert_equals(resp.headers.get("Content-Type"), mime, "Content-Type is " + resp.headers.get("Content-Type"));
|
||||
return resp.text();
|
||||
|
@ -19,6 +25,8 @@ function checkFetchResponse(url, data, mime) {
|
|||
}
|
||||
|
||||
checkFetchResponse("data:,response%27s%20body", "response's body", "text/plain;charset=US-ASCII");
|
||||
checkFetchResponse("data:,response%27s%20body", "response's body", "text/plain;charset=US-ASCII", "same-origin");
|
||||
checkFetchResponse("data:,response%27s%20body", "response's body", "text/plain;charset=US-ASCII", "cors");
|
||||
checkFetchResponse("data:text/plain;base64,cmVzcG9uc2UncyBib2R5", "response's body", "text/plain");
|
||||
checkFetchResponse("data:image/png;base64,cmVzcG9uc2UncyBib2R5",
|
||||
"response's body",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue