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:
Ms2ger 2017-02-06 11:06:12 +01:00
parent fb4f421c8b
commit 296fa2512b
21852 changed files with 2080936 additions and 892894 deletions

View file

@ -18,6 +18,17 @@ function testUpload(desc, url, method, body, expectedBody) {
}, desc);
}
function testUploadFailure(desc, url, method, body) {
const requestInit = {"method": method};
promise_test(test => {
if (typeof body === "function")
body = body();
if (body)
requestInit["body"] = body;
return promise_rejects(new TypeError(), fetch(url, requestInit));
}, desc);
}
var url = RESOURCES_DIR + "echo-content.py"
testUpload("Fetch with PUT with body", url, "PUT", "Request's body", "Request's body");
@ -31,5 +42,30 @@ testUpload("Fetch with POST with Float32Array body", url, "POST", new Float32Arr
testUpload("Fetch with POST with Float64Array body", url, "POST", new Float64Array(1), "\0\0\0\0\0\0\0\0");
testUpload("Fetch with POST with DataView body", url, "POST", new DataView(new ArrayBuffer(8), 0, 4), "\0\0\0\0");
testUpload("Fetch with POST with Blob body with mime type", url, "POST", new Blob(["Test"], { type: "text/maybe" }), "Test");
testUpload("Fetch with POST with ReadableStream", url, "POST", new ReadableStream({start: controller => {
const encoder = new TextEncoder();
controller.enqueue(encoder.encode("Test"));
controller.close();
}}), "Test");
testUploadFailure("Fetch with POST with ReadableStream containing String", url, "POST", new ReadableStream({start: controller => {
controller.enqueue("Test");
controller.close();
}}));
testUploadFailure("Fetch with POST with ReadableStream containing null", url, "POST", new ReadableStream({start: controller => {
controller.enqueue(null);
controller.close();
}}));
testUploadFailure("Fetch with POST with ReadableStream containing number", url, "POST", new ReadableStream({start: controller => {
controller.enqueue(99);
controller.close();
}}));
testUploadFailure("Fetch with POST with ReadableStream containing ArrayBuffer", url, "POST", new ReadableStream({start: controller => {
controller.enqueue(new ArrayBuffer());
controller.close();
}}));
testUploadFailure("Fetch with POST with ReadableStream containing Blob", url, "POST", new ReadableStream({start: controller => {
controller.enqueue(new Blob());
controller.close();
}}));
done();