diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /testing/web-platform/tests/fetch/api/response | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fetch/api/response')
-rw-r--r-- | testing/web-platform/tests/fetch/api/response/response-consume-empty.any.js | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/testing/web-platform/tests/fetch/api/response/response-consume-empty.any.js b/testing/web-platform/tests/fetch/api/response/response-consume-empty.any.js index 0fa85ecbcb..a5df356258 100644 --- a/testing/web-platform/tests/fetch/api/response/response-consume-empty.any.js +++ b/testing/web-platform/tests/fetch/api/response/response-consume-empty.any.js @@ -8,23 +8,12 @@ function checkBodyText(test, response) { }); } -function checkBodyBlob(test, response) { - return response.blob().then(function(bodyAsBlob) { - var promise = new Promise(function(resolve, reject) { - var reader = new FileReader(); - reader.onload = function(evt) { - resolve(reader.result) - }; - reader.onerror = function() { - reject("Blob's reader failed"); - }; - reader.readAsText(bodyAsBlob); - }); - return promise.then(function(body) { - assert_equals(body, "", "Resolved value should be empty"); - assert_false(response.bodyUsed); - }); - }); +async function checkBodyBlob(test, response) { + const bodyAsBlob = await response.blob(); + const body = await bodyAsBlob.text(); + + assert_equals(body, "", "Resolved value should be empty"); + assert_false(response.bodyUsed); } function checkBodyArrayBuffer(test, response) { |