From 3d7de94ee749068fe9b8e24141a9453e4060a9e2 Mon Sep 17 00:00:00 2001 From: Khafra <42794878+KhafraDev@users.noreply.github.com> Date: Wed, 26 Oct 2022 02:28:07 -0400 Subject: [PATCH] wpt: update scheme-blob.sub.any.js (#1731) --- test/wpt/status/fetch.status.json | 6 ------ .../fetch/api/basic/scheme-blob.sub.any.js | 17 +++++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json index 7c37163c35a..1c5692bcc7c 100644 --- a/test/wpt/status/fetch.status.json +++ b/test/wpt/status/fetch.status.json @@ -46,12 +46,6 @@ "Object.prototype.highWaterMark accessor returning invalid value should not affect stream creation by 'fetch'" ] }, - "scheme-blob.sub.any.js": { - "fail": [ - "Set content type to the empty string for slice with invalid content type", - "Set content type to the empty string for slice with no content type " - ] - }, "header-value-combining.any.js": { "fail": [ "response.headers.get('content-length') expects 0, 0", diff --git a/test/wpt/tests/fetch/api/basic/scheme-blob.sub.any.js b/test/wpt/tests/fetch/api/basic/scheme-blob.sub.any.js index 228574f25a3..a6059ea93d9 100644 --- a/test/wpt/tests/fetch/api/basic/scheme-blob.sub.any.js +++ b/test/wpt/tests/fetch/api/basic/scheme-blob.sub.any.js @@ -75,31 +75,32 @@ let xml_blob_no_type = new Blob([simple_xml_string]); checkFetchResponse(URL.createObjectURL(xml_blob_no_type), simple_xml_string, "", 45, "Blob content is not sniffed for a content type [text/xml]"); +let simple_text_string = 'Hello, World!'; promise_test(function(test) { - let blob = new Blob([], {"type": "text/plain"}); - let slice = blob.slice(8, 25, "\0"); + let blob = new Blob([simple_text_string], {"type": "text/plain"}); + let slice = blob.slice(7, simple_text_string.length, "\0"); return fetch(URL.createObjectURL(slice)).then(function (resp) { assert_equals(resp.status, 200, "HTTP status is 200"); assert_equals(resp.type, "basic", "response type is basic"); assert_equals(resp.headers.get("Content-Type"), ""); - assert_equals(resp.headers.get("Content-Length"), "17"); + assert_equals(resp.headers.get("Content-Length"), "6"); return resp.text(); }).then(function(bodyAsText) { - assert_equals(bodyAsText, "type with invalid"); + assert_equals(bodyAsText, "World!"); }); }, "Set content type to the empty string for slice with invalid content type"); promise_test(function(test) { - let blob = new Blob([], {"type": "text/plain"}); - let slice = blob.slice(8, 20); + let blob = new Blob([simple_text_string], {"type": "text/plain"}); + let slice = blob.slice(7, simple_text_string.length, "\0"); return fetch(URL.createObjectURL(slice)).then(function (resp) { assert_equals(resp.status, 200, "HTTP status is 200"); assert_equals(resp.type, "basic", "response type is basic"); assert_equals(resp.headers.get("Content-Type"), ""); - assert_equals(resp.headers.get("Content-Length"), "12"); + assert_equals(resp.headers.get("Content-Length"), "6"); return resp.text(); }).then(function(bodyAsText) { - assert_equals(bodyAsText, "type that is"); + assert_equals(bodyAsText, "World!"); }); }, "Set content type to the empty string for slice with no content type ");