From 2b71f38c8abdedf1909214d00807df3f5cc2d7be Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 15 May 2024 18:42:02 +1000 Subject: [PATCH 01/12] feat(ext/fetch): `Request.bytes()` and `Response.bytes()` --- cli/tsc/dts/lib.dom.d.ts | 1 + cli/tsc/dts/lib.webworker.d.ts | 1 + ext/fetch/22_body.js | 13 ++++++++++++- ext/fetch/lib.deno_fetch.d.ts | 4 ++++ tests/wpt/runner/expectation.json | 2 ++ tests/wpt/suite | 2 +- 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cli/tsc/dts/lib.dom.d.ts b/cli/tsc/dts/lib.dom.d.ts index fab313d11245ed..c4ed55463890ba 100644 --- a/cli/tsc/dts/lib.dom.d.ts +++ b/cli/tsc/dts/lib.dom.d.ts @@ -3156,6 +3156,7 @@ interface Body { arrayBuffer(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ blob(): Promise; + bytes(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ formData(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ diff --git a/cli/tsc/dts/lib.webworker.d.ts b/cli/tsc/dts/lib.webworker.d.ts index 8fd57617a99ac9..b43b0f96b1d1e9 100644 --- a/cli/tsc/dts/lib.webworker.d.ts +++ b/cli/tsc/dts/lib.webworker.d.ts @@ -1029,6 +1029,7 @@ interface Body { arrayBuffer(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ blob(): Promise; + bytes(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ formData(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js index e16fd4c54dc8a8..e9d493658698c6 100644 --- a/ext/fetch/22_body.js +++ b/ext/fetch/22_body.js @@ -296,6 +296,15 @@ function mixinBody(prototype, bodySymbol, mimeTypeSymbol) { configurable: true, enumerable: true, }, + bytes: { + /** @returns {Promise} */ + value: function bytes() { + return consumeBody(this, "bytes"); + }, + writable: true, + configurable: true, + enumerable: true, + }, formData: { /** @returns {Promise} */ value: function formData() { @@ -330,7 +339,7 @@ function mixinBody(prototype, bodySymbol, mimeTypeSymbol) { /** * https://fetch.spec.whatwg.org/#concept-body-package-data * @param {Uint8Array | string} bytes - * @param {"ArrayBuffer" | "Blob" | "FormData" | "JSON" | "text"} type + * @param {"ArrayBuffer" | "Blob" | "FormData" | "JSON" | "text" | "bytes"} type * @param {MimeType | null} [mimeType] */ function packageData(bytes, type, mimeType) { @@ -341,6 +350,8 @@ function packageData(bytes, type, mimeType) { return new Blob([bytes], { type: mimeType !== null ? mimesniff.serializeMimeType(mimeType) : "", }); + case "bytes": + return chunkToU8(bytes); case "FormData": { if (mimeType !== null) { const essence = mimesniff.essence(mimeType); diff --git a/ext/fetch/lib.deno_fetch.d.ts b/ext/fetch/lib.deno_fetch.d.ts index 4eb303e6883f54..c27313903d4eb5 100644 --- a/ext/fetch/lib.deno_fetch.d.ts +++ b/ext/fetch/lib.deno_fetch.d.ts @@ -58,6 +58,10 @@ declare interface Body { * that resolves with a `Blob`. */ blob(): Promise; + /** Takes a `Response` stream and reads it to completion. It returns a promise + * that resolves with a `Uint8Array`. + */ + bytes(): Promise; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `FormData` object. */ diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index f20cd78f110260..8159b751a392ae 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -7112,6 +7112,8 @@ "response": { "json.any.html": true, "json.any.worker.html": true, + "response-blob-realm.any.html": true, + "response-blob-realm.any.worker.html": true, "response-init-001.any.html": true, "response-init-001.any.worker.html": true, "response-init-002.any.html": true, diff --git a/tests/wpt/suite b/tests/wpt/suite index daa07cf3c47652..915d40b37fbd35 160000 --- a/tests/wpt/suite +++ b/tests/wpt/suite @@ -1 +1 @@ -Subproject commit daa07cf3c47652ed67e637f2a39bbc34f91cfe10 +Subproject commit 915d40b37fbd3554548d5cbec9f335f329ccc944 From af55afd47531f169f3effe774823b54b929d1458 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 16 May 2024 08:50:08 +1000 Subject: [PATCH 02/12] tweaks --- cli/tsc/dts/lib.dom.d.ts | 1 + cli/tsc/dts/lib.webworker.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/cli/tsc/dts/lib.dom.d.ts b/cli/tsc/dts/lib.dom.d.ts index c4ed55463890ba..e196df6ab53ebf 100644 --- a/cli/tsc/dts/lib.dom.d.ts +++ b/cli/tsc/dts/lib.dom.d.ts @@ -3156,6 +3156,7 @@ interface Body { arrayBuffer(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ blob(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */ bytes(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ formData(): Promise; diff --git a/cli/tsc/dts/lib.webworker.d.ts b/cli/tsc/dts/lib.webworker.d.ts index b43b0f96b1d1e9..e23a8b736f9a86 100644 --- a/cli/tsc/dts/lib.webworker.d.ts +++ b/cli/tsc/dts/lib.webworker.d.ts @@ -1029,6 +1029,7 @@ interface Body { arrayBuffer(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ blob(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */ bytes(): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ formData(): Promise; From b12ebe6344417c6da40758bdd8d709f7d1cffba3 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 17 May 2024 08:40:17 +1000 Subject: [PATCH 03/12] x --- tests/wpt/suite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/wpt/suite b/tests/wpt/suite index 915d40b37fbd35..5e8f71d73049d4 160000 --- a/tests/wpt/suite +++ b/tests/wpt/suite @@ -1 +1 @@ -Subproject commit 915d40b37fbd3554548d5cbec9f335f329ccc944 +Subproject commit 5e8f71d73049d4fca2a8cbc62d40e821400f1624 From ecf15b4a8853eaa6aeb52cca044ecd9fbf26e344 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 17 May 2024 08:41:32 +1000 Subject: [PATCH 04/12] update --- tests/wpt/suite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/wpt/suite b/tests/wpt/suite index 5e8f71d73049d4..915d40b37fbd35 160000 --- a/tests/wpt/suite +++ b/tests/wpt/suite @@ -1 +1 @@ -Subproject commit 5e8f71d73049d4fca2a8cbc62d40e821400f1624 +Subproject commit 915d40b37fbd3554548d5cbec9f335f329ccc944 From be45fc0553c8b1c4bee5d15fe466e89e3a17455d Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 17 May 2024 09:20:28 +1000 Subject: [PATCH 05/12] work --- ext/canvas/01_image.js | 6 ++-- tests/specs/run/045_proxy/proxy_test.ts | 2 +- tests/testdata/fmt/with_config/subdir/a.ts | 12 ++------ tests/unit/fetch_test.ts | 33 +++++++++++----------- tests/unit/http_test.ts | 8 +++--- tests/unit/serve_test.ts | 17 ++++++----- tests/unit/worker_test.ts | 2 +- tests/unit_node/http_test.ts | 4 +-- 8 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ext/canvas/01_image.js b/ext/canvas/01_image.js index 6fb1ee62fc1226..1bb11d4b96fb93 100644 --- a/ext/canvas/01_image.js +++ b/ext/canvas/01_image.js @@ -230,7 +230,7 @@ function createImageBitmap( } if (ObjectPrototypeIsPrototypeOf(BlobPrototype, image)) { return (async () => { - const data = await image.arrayBuffer(); + const data = await image.bytes(); const mimetype = sniffImage(image.type); if (mimetype !== "image/png") { throw new DOMException( @@ -238,9 +238,7 @@ function createImageBitmap( "InvalidStateError", ); } - const { data: imageData, width, height } = op_image_decode_png( - new Uint8Array(data), - ); + const { data: imageData, width, height } = op_image_decode_png(data); const processedImage = processImage( imageData, width, diff --git a/tests/specs/run/045_proxy/proxy_test.ts b/tests/specs/run/045_proxy/proxy_test.ts index d3386f0d7b3a47..582b0e6387b3c4 100644 --- a/tests/specs/run/045_proxy/proxy_test.ts +++ b/tests/specs/run/045_proxy/proxy_test.ts @@ -23,7 +23,7 @@ async function handler(req: Request): Promise { method: req.method, headers: headers, }); - return new Response(new Uint8Array(await resp.arrayBuffer()), { + return new Response(await resp.bytes(), { status: resp.status, headers: resp.headers, }); diff --git a/tests/testdata/fmt/with_config/subdir/a.ts b/tests/testdata/fmt/with_config/subdir/a.ts index 5474b3aa37cb72..84a378b2751bad 100644 --- a/tests/testdata/fmt/with_config/subdir/a.ts +++ b/tests/testdata/fmt/with_config/subdir/a.ts @@ -21,16 +21,8 @@ Deno.test( response1 .statusText, ) - const u8a = - new Uint8Array( - await response - .arrayBuffer(), - ) - const u8a1 = - new Uint8Array( - await response1 - .arrayBuffer(), - ) + const u8a = await response.bytes() + const u8a1 = await response1.bytes() for ( let i = 0; i < diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts index 3202d40fa73a50..4176f39ace218a 100644 --- a/tests/unit/fetch_test.ts +++ b/tests/unit/fetch_test.ts @@ -243,8 +243,8 @@ Deno.test({ permissions: { net: true } }, async function responseClone() { assert(response !== response1); assertEquals(response.status, response1.status); assertEquals(response.statusText, response1.statusText); - const u8a = new Uint8Array(await response.arrayBuffer()); - const u8a1 = new Uint8Array(await response1.arrayBuffer()); + const u8a = await response.bytes(); + const u8a1 = await response1.bytes(); for (let i = 0; i < u8a.byteLength; i++) { assertEquals(u8a[i], u8a1[i]); } @@ -675,7 +675,7 @@ Deno.test( ["Foo", "Bar"], ], }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -709,7 +709,7 @@ Deno.test( ["Accept-Language", "en-US"], ], }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -743,7 +743,7 @@ Deno.test( ], body, }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -782,7 +782,7 @@ Deno.test( ], body, }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -816,7 +816,7 @@ Deno.test( ["Content-Length", "10"], ], }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -847,7 +847,7 @@ Deno.test( ["Transfer-Encoding", "chunked"], ], }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -933,7 +933,7 @@ Deno.test(function responseRedirectTakeURLObjectAsParameter() { Deno.test(async function responseWithoutBody() { const response = new Response(); - assertEquals(await response.arrayBuffer(), new ArrayBuffer(0)); + assertEquals(await response.bytes(), new Uint8Array(0)); const blob = await response.blob(); assertEquals(blob.size, 0); assertEquals(await blob.arrayBuffer(), new ArrayBuffer(0)); @@ -1214,7 +1214,7 @@ Deno.test( ], body: stream.readable, }); - await response.arrayBuffer(); + await response.body?.cancel(); assertEquals(response.status, 404); assertEquals(response.headers.get("Content-Length"), "2"); @@ -1793,10 +1793,9 @@ Deno.test( const listener = invalidServer(addr, body); const response = await fetch(`http://${addr}/`); - const res = await response.arrayBuffer(); + const res = await response.bytes(); const buf = new TextEncoder().encode(data); - assertEquals(res.byteLength, buf.byteLength); - assertEquals(new Uint8Array(res), buf); + assertEquals(res, buf); listener.close(); }, @@ -1850,10 +1849,10 @@ Deno.test( // If content-length < totalLength, a maximum of content-length bytes // should be returned. - const res = await response.arrayBuffer(); + const res = await response.bytes(); const buf = new TextEncoder().encode(data); assertEquals(res.byteLength, contentLength); - assertEquals(new Uint8Array(res), buf.subarray(contentLength)); + assertEquals(res, buf.subarray(contentLength)); listener.close(); }, @@ -2029,7 +2028,7 @@ Deno.test( Deno.test("Request with subarray TypedArray body", async () => { const body = new Uint8Array([1, 2, 3, 4, 5]).subarray(1); const req = new Request("https://example.com", { method: "POST", body }); - const actual = new Uint8Array(await req.arrayBuffer()); + const actual = await req.bytes(); const expected = new Uint8Array([2, 3, 4, 5]); assertEquals(actual, expected); }); @@ -2037,7 +2036,7 @@ Deno.test("Request with subarray TypedArray body", async () => { Deno.test("Response with subarray TypedArray body", async () => { const body = new Uint8Array([1, 2, 3, 4, 5]).subarray(1); const req = new Response(body); - const actual = new Uint8Array(await req.arrayBuffer()); + const actual = await req.bytes(); const expected = new Uint8Array([2, 3, 4, 5]); assertEquals(actual, expected); }); diff --git a/tests/unit/http_test.ts b/tests/unit/http_test.ts index 607f2fc6e4a2bb..f4fa62fa6b6174 100644 --- a/tests/unit/http_test.ts +++ b/tests/unit/http_test.ts @@ -239,7 +239,7 @@ Deno.test( headers: { "connection": "close" }, }); - await resp.arrayBuffer(); + await resp.body?.cancel(); await promise; }, ); @@ -963,7 +963,7 @@ Deno.test( await respondWith(new Response(f.readable, { status: 200 })); })(); const resp = await fetch(`http://127.0.0.1:${listenPort}/`); - const body = await resp.arrayBuffer(); + const body = await resp.bytes(); assertEquals(body.byteLength, 70 * 1024); await promise; httpConn!.close(); @@ -1293,8 +1293,8 @@ Deno.test( const resp = await fetch(`http://localhost:${listenPort}/`); assertEquals(resp.status, 200); - const body = await resp.arrayBuffer(); - assertEquals(new Uint8Array(body), new Uint8Array([128])); + const body = await resp.bytes(); + assertEquals(body, new Uint8Array([128])); await promise; httpConn!.close(); diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index 74628ace180344..f7f01076bef042 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -340,7 +340,7 @@ Deno.test( }); const resp = await fetch(`http://localhost:${servePort}`); - dataPromise = resp.arrayBuffer(); + dataPromise = resp.bytes(); } assertEquals((await dataPromise).byteLength, 1048576); @@ -358,7 +358,7 @@ Deno.test( const [_, data] = await Promise.all([ server.shutdown(), - resp.arrayBuffer(), + resp.bytes(), ]); assertEquals(data.byteLength, 1048576); @@ -1861,13 +1861,12 @@ Deno.test( signal: ac.signal, }); const response = await fetch(`http://localhost:${servePort}/`); - const body = await response.arrayBuffer(); + const body = await response.bytes(); assertEquals(1024 * 1024, body.byteLength); - const buffer = new Uint8Array(body); for (let i = 0; i < 256; i++) { assertEquals( i, - buffer[i * 4096], + body[i * 4096], `sentinel mismatch at index ${i * 4096}`, ); } @@ -2078,8 +2077,8 @@ Deno.test( await deferred.promise; assertEquals(resp.status, 200); - const body = await resp.arrayBuffer(); - assertEquals(new Uint8Array(body), new Uint8Array([128])); + const body = await resp.bytes(); + assertEquals(body, new Uint8Array([128])); ac.abort(); await server.finished; @@ -2694,7 +2693,7 @@ for (const testCase of compressionTestCases) { headers: testCase.in as HeadersInit, }); await deferred.promise; - const body = await resp.arrayBuffer(); + const body = await resp.bytes(); if (testCase.expect == null) { assertEquals(body.byteLength, testCase.length); assertEquals( @@ -2731,7 +2730,7 @@ Deno.test( const server = Deno.serve({ handler: async (request) => { assertEquals( - new Uint8Array(await request.arrayBuffer()), + await request.bytes(), makeTempData(70 * 1024), ); deferred.resolve(); diff --git a/tests/unit/worker_test.ts b/tests/unit/worker_test.ts index 33e25f70eba344..a66eb69a918afc 100644 --- a/tests/unit/worker_test.ts +++ b/tests/unit/worker_test.ts @@ -689,7 +689,7 @@ Deno.test({ assert(worker); const response = await fetch("http://localhost:4506"); - assert(await response.arrayBuffer()); + assert(await response.bytes()); worker.terminate(); }, }); diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index c57027549c8467..4c4a473083615e 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -174,7 +174,7 @@ Deno.test("[node/http] server can respond with 101, 204, 205, 304 status", async // deno-lint-ignore no-explicit-any `http://127.0.0.1:${(server.address() as any).port}/`, ); - await res.arrayBuffer(); + await res.body?.cancel(); assertEquals(res.status, status); server.close(() => resolve()); }); @@ -198,7 +198,7 @@ Deno.test("[node/http] IncomingRequest socket has remoteAddress + remotePort", a const res = await fetch( `http://127.0.0.1:${port}/`, ); - await res.arrayBuffer(); + await res.body?.cancel(); assertEquals(remoteAddress, "127.0.0.1"); assertEquals(typeof remotePort, "number"); server.close(() => resolve()); From 4255f129d795c035f8f188e80880899dd5f68a16 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 17 May 2024 10:06:23 +1000 Subject: [PATCH 06/12] fix --- ext/canvas/01_image.js | 6 ++++-- tests/testdata/fmt/with_config/subdir/a.ts | 8 ++++++-- tests/unit_node/http_test.ts | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ext/canvas/01_image.js b/ext/canvas/01_image.js index 1bb11d4b96fb93..6fb1ee62fc1226 100644 --- a/ext/canvas/01_image.js +++ b/ext/canvas/01_image.js @@ -230,7 +230,7 @@ function createImageBitmap( } if (ObjectPrototypeIsPrototypeOf(BlobPrototype, image)) { return (async () => { - const data = await image.bytes(); + const data = await image.arrayBuffer(); const mimetype = sniffImage(image.type); if (mimetype !== "image/png") { throw new DOMException( @@ -238,7 +238,9 @@ function createImageBitmap( "InvalidStateError", ); } - const { data: imageData, width, height } = op_image_decode_png(data); + const { data: imageData, width, height } = op_image_decode_png( + new Uint8Array(data), + ); const processedImage = processImage( imageData, width, diff --git a/tests/testdata/fmt/with_config/subdir/a.ts b/tests/testdata/fmt/with_config/subdir/a.ts index 84a378b2751bad..14f22d1b29eafa 100644 --- a/tests/testdata/fmt/with_config/subdir/a.ts +++ b/tests/testdata/fmt/with_config/subdir/a.ts @@ -21,8 +21,12 @@ Deno.test( response1 .statusText, ) - const u8a = await response.bytes() - const u8a1 = await response1.bytes() + const u8a = + await response + .bytes() + const u8a1 = + await response1 + .bytes() for ( let i = 0; i < diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index 4c4a473083615e..0518d935b4b917 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -198,7 +198,7 @@ Deno.test("[node/http] IncomingRequest socket has remoteAddress + remotePort", a const res = await fetch( `http://127.0.0.1:${port}/`, ); - await res.body?.cancel(); + await res.arrayBuffer(); assertEquals(remoteAddress, "127.0.0.1"); assertEquals(typeof remotePort, "number"); server.close(() => resolve()); From c7ec29e4b8ea2051ba8a398a35083bbe23ae139e Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 17 May 2024 11:00:43 +1000 Subject: [PATCH 07/12] fix --- tests/wpt/runner/expectation.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 31f424d04b15c8..27c6ab8e01eab8 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -12809,7 +12809,9 @@ "dedicated-worker": { "eventsource-eventtarget.worker.html": true, "eventsource-constructor-no-new.any.html": true, - "eventsource-constructor-no-new.any.worker.html": true + "eventsource-constructor-no-new.any.worker.html": true, + "eventsource-request-cancellation.window.any.html": true, + "eventsource-request-cancellation.window.any.worker.html": true }, "event-data.any.html": true, "event-data.any.worker.html": true, From 7906cd550fb9738dab134138d4c7667170d3a2a3 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 17 May 2024 13:37:36 +1000 Subject: [PATCH 08/12] work --- tests/wpt/runner/expectation.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 27c6ab8e01eab8..0f6c647e52eae8 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -12887,6 +12887,12 @@ "eventsource-constructor-stringify.window.html": false, "eventsource-cross-origin.window.html": false, "eventsource-reconnect.window.html": false, - "request-status-error.window.html": false + "request-status-error.window.html": false, + "eventsource-constructor-empty-url.any.serviceworker.html": false, + "eventsource-constructor-empty-url.any.sharedworker.html": false, + "eventsource-constructor-url-bogus.any.serviceworker.html": false, + "eventsource-constructor-url-bogus.any.sharedworker.html": false, + "request-credentials.window.html": false, + "request-redirect.window.html": false } -} +} \ No newline at end of file From 56c1c8117423150db7e9c58db86c2656693b5ee8 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 23 May 2024 07:51:48 +1000 Subject: [PATCH 09/12] x --- tests/testdata/fmt/with_config/subdir/a.ts | 8 ++------ tests/wpt/runner/expectation.json | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/testdata/fmt/with_config/subdir/a.ts b/tests/testdata/fmt/with_config/subdir/a.ts index 14f22d1b29eafa..84a378b2751bad 100644 --- a/tests/testdata/fmt/with_config/subdir/a.ts +++ b/tests/testdata/fmt/with_config/subdir/a.ts @@ -21,12 +21,8 @@ Deno.test( response1 .statusText, ) - const u8a = - await response - .bytes() - const u8a1 = - await response1 - .bytes() + const u8a = await response.bytes() + const u8a1 = await response1.bytes() for ( let i = 0; i < diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 0f6c647e52eae8..514b387561bc2e 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -12809,9 +12809,7 @@ "dedicated-worker": { "eventsource-eventtarget.worker.html": true, "eventsource-constructor-no-new.any.html": true, - "eventsource-constructor-no-new.any.worker.html": true, - "eventsource-request-cancellation.window.any.html": true, - "eventsource-request-cancellation.window.any.worker.html": true + "eventsource-constructor-no-new.any.worker.html": true }, "event-data.any.html": true, "event-data.any.worker.html": true, @@ -12829,8 +12827,6 @@ "eventsource-onopen.any.worker.html": true, "eventsource-prototype.any.html": true, "eventsource-prototype.any.worker.html": true, - "eventsource-request-cancellation.window.any.html": false, - "eventsource-request-cancellation.window.any.worker.html": false, "eventsource-url.any.html": true, "eventsource-url.any.worker.html": true, "format-bom-2.any.html": true, From f9baefea395ff93b1ec503dac47e534c553be7ad Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 23 May 2024 08:06:30 +1000 Subject: [PATCH 10/12] fix --- tests/testdata/fmt/with_config/subdir/a.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/testdata/fmt/with_config/subdir/a.ts b/tests/testdata/fmt/with_config/subdir/a.ts index 84a378b2751bad..14f22d1b29eafa 100644 --- a/tests/testdata/fmt/with_config/subdir/a.ts +++ b/tests/testdata/fmt/with_config/subdir/a.ts @@ -21,8 +21,12 @@ Deno.test( response1 .statusText, ) - const u8a = await response.bytes() - const u8a1 = await response1.bytes() + const u8a = + await response + .bytes() + const u8a1 = + await response1 + .bytes() for ( let i = 0; i < From 889c9153f20c14e5cfc19513aeb700e2a8267ba0 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 23 May 2024 08:38:34 +1000 Subject: [PATCH 11/12] fix --- tests/wpt/runner/expectation.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 514b387561bc2e..35c2dfffa2fc7d 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -8150,7 +8150,11 @@ "HTTP/1.1 200 ", "HTTP/1.1 999 DOES IT MATTER " ], - "resources-with-0x00-in-header.window.html": false + "resources-with-0x00-in-header.window.html": [ + "Expect network error for script with 0x00 in a header", + "Expect network error for frame navigation to resource with 0x00 in a header", + "Expect network error for image with 0x00 in a header" + ] }, "range": { "general.any.html": [ From d82ff4cc0d6e4d8f51051e35a95d72dc7762aece Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 23 May 2024 09:24:33 +1000 Subject: [PATCH 12/12] fix --- tests/wpt/runner/expectation.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 35c2dfffa2fc7d..e3f2ac9728fa10 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -7153,8 +7153,12 @@ "response": { "json.any.html": true, "json.any.worker.html": true, - "response-blob-realm.any.html": true, - "response-blob-realm.any.worker.html": true, + "response-blob-realm.any.html": [ + "realm of the Uint8Array from Response bytes()" + ], + "response-blob-realm.any.worker.html": [ + "realm of the Uint8Array from Response bytes()" + ], "response-init-001.any.html": true, "response-init-001.any.worker.html": true, "response-init-002.any.html": true,