Skip to content
File

Blob: src/wpt/fetch/api-test.ts

typescript859 lines
1// Copyright (c) 2017-2022 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4 
5import { type TestRunnerConfig } from 'harness/harness';
6 
7export default {
8 'abort/cache.https.any.js': {
9 comment: 'Not implemented',
10 expectedFailures: [
11 'Signals are not stored in the cache API',
12 "Signals are not stored in the cache API, even if they're already aborted",
13 ],
14 },
15 'abort/general.any.js': {
16 comment: 'See individual tests',
17 disabledTests: [
18 // Flaky since 2025-06-09. To be investigated.
19 'Stream errors once aborted, after reading. Underlying connection closed.',
20 // Flaky since 2025-07-25. To be investigated.
21 'Stream errors once aborted. Underlying connection closed.',
22 ],
23 expectedFailures: [
24 // The fetch promise still resolves for some reason
25 'Aborting rejects with AbortError',
26 'Aborting rejects with abort reason',
27 'Already aborted signal rejects immediately',
28 
29 // Doesn't reject
30 'response.arrayBuffer() rejects if already aborted',
31 'response.blob() rejects if already aborted',
32 'response.bytes() rejects if already aborted',
33 'response.json() rejects if already aborted',
34 'response.text() rejects if already aborted',
35 'Call text() twice on aborted response',
36 
37 // Instead throws TypeError: Parsing a Body as FormData requires a Content-Type header.
38 'response.formData() rejects if already aborted',
39 
40 // ReadableStream.cancel was not called synchronously at the right time
41 'Readable stream synchronously cancels with AbortError if aborted before reading',
42 
43 // Cloned request needs to have a different signal object, that's in the same state as the original
44 'Signal state is cloned',
45 'Signal on request object should also have abort reason',
46 'Signal on request object',
47 ],
48 },
49 'abort/request.any.js': {},
50 
51 'basic/accept-header.any.js': {
52 comment: 'Response.type must be basic',
53 expectedFailures: [
54 "Request through fetch should have 'accept' header with value '*/*'",
55 "Request through fetch should have 'accept' header with value 'custom/*'",
56 "Request through fetch should have 'accept-language' header with value 'bzh'",
57 "Request through fetch should have a 'accept-language' header",
58 ],
59 },
60 'basic/conditional-get.any.js': {
61 comment:
62 "This test is too browser specific. It's assuming a request was served from cache vs received by server.",
63 omittedTests: ['Testing conditional GET with ETags'],
64 },
65 'basic/error-after-response.any.js': {
66 comment:
67 'Stream disconnected prematurely and a dropped promise when faced with intentionally bad chunked encoding from WPT',
68 disabledTests: true,
69 },
70 'basic/gc.any.js': {},
71 'basic/header-value-combining.any.js': {
72 comment:
73 "Stream disconnected prematurely and a dropped promise. Not yet sure what is triggering about WPT's output",
74 disabledTests: true,
75 },
76 'basic/header-value-null-byte.any.js': {
77 comment: 'We should return a nicer TypeError instead of "internal error"',
78 expectedFailures: ['Ensure fetch() rejects null bytes in headers'],
79 },
80 'basic/historical.any.js': {
81 comment: 'This test expects us not to implement getAll',
82 expectedFailures: ['Headers object no longer has a getAll() method'],
83 },
84 'basic/http-response-code.any.js': {},
85 'basic/integrity.sub.any.js': {
86 comment: 'Integrity is not implemented',
87 disabledTests: true,
88 },
89 'basic/keepalive.any.js': {
90 comment: 'Keepalive is not implemented',
91 disabledTests: true,
92 },
93 'basic/mediasource.window.js': {
94 comment: 'MediaSource not implemented. It is DOM-specific',
95 omittedTests: ['Cannot fetch blob: URL from a MediaSource'],
96 },
97 'basic/mode-no-cors.sub.any.js': {
98 comment: 'Request.mode is not relevant to us',
99 disabledTests: true,
100 },
101 'basic/mode-same-origin.any.js': {
102 comment: 'Request.mode is not relevant to us',
103 disabledTests: true,
104 },
105 'basic/referrer.any.js': {
106 comment: 'Referrer is not implemented',
107 omittedTests: true,
108 },
109 'basic/request-forbidden-headers.any.js': {
110 comment: 'We do not have forbidden headers',
111 omittedTests: true,
112 },
113 'basic/request-head.any.js': {},
114 'basic/request-headers-case.any.js': {
115 comment: 'To be investigated',
116 expectedFailures: [
117 'Multiple headers with the same name, different case (THIS-IS-A-TEST first)',
118 'Multiple headers with the same name, different case (THIS-is-A-test first)',
119 ],
120 },
121 'basic/request-headers-nonascii.any.js': {},
122 'basic/request-headers.any.js': {
123 comment: 'Reasons listed per test case',
124 expectedFailures: [
125 // Float16Array not implemented
126 'Fetch with POST with Float16Array body',
127 // Fake HTTP method names not accepted
128 'Fetch with Chicken',
129 'Fetch with Chicken with body',
130 'Fetch with TacO and mode "same-origin" needs an Origin header',
131 'Fetch with TacO and mode "cors" needs an Origin header',
132 // WPT is expecting us to insert some kind of User-Agent
133 'Fetch with POST with Blob body with mime type',
134 'Fetch with PUT without body',
135 'Fetch with POST with URLSearchParams body',
136 'Fetch with POST with FormData body',
137 // WPT expects Origin header but we don't support CORS
138 'Fetch with PUT and mode "same-origin" needs an Origin header',
139 'Fetch with PUT with body',
140 'Fetch with POST and mode "no-cors" needs an Origin header',
141 // WPT is expecting us to insert some kind of User-Agent
142 'Fetch with GET',
143 'Fetch with POST with Blob body',
144 'Fetch with POST with Float64Array body',
145 'Fetch with POST with text body',
146 'Fetch with POST with ArrayBuffer body',
147 'Fetch with POST with Float32Array body',
148 'Fetch with POST with Uint8Array body',
149 'Fetch with POST with Int8Array body',
150 'Fetch with POST without body',
151 'Fetch with HEAD',
152 'Fetch with POST and mode "same-origin" needs an Origin header',
153 'Fetch with POST with DataView body',
154 // Response.type must be basic
155 'Fetch with GET and mode "cors" does not need an Origin header',
156 ],
157 },
158 'basic/request-referrer.any.js': {
159 comment: 'Referrer is not implemented',
160 omittedTests: true,
161 },
162 'basic/request-upload.any.js': {
163 comment: 'Appears to corrupt the state of workerd',
164 disabledTests: true,
165 },
166 'basic/request-upload.h2.any.js': {
167 comment: 'Enable if HTTP/2 is implemented',
168 disabledTests: true,
169 },
170 'basic/response-null-body.any.js': {
171 comment:
172 'Response begins with hello-worldHTTP/1.1 which will lead to invalid protocol errors coming up on other tests later on',
173 disabledTests: true,
174 },
175 'basic/response-url.sub.any.js': {},
176 'basic/scheme-about.any.js': {},
177 'basic/scheme-blob.sub.any.js': {
178 comment: 'URL.createObjectURL() is not implemented',
179 disabledTests: true,
180 },
181 'basic/scheme-data.any.js': {
182 comment: 'Response.type must be basic',
183 expectedFailures: [
184 'Fetching [HEAD] data:,response%27s%20body is OK',
185 'Fetching data:,response%27s%20body is OK',
186 'Fetching data:,response%27s%20body is OK (same-origin)',
187 'Fetching data:,response%27s%20body is OK (cors)',
188 'Fetching data:text/plain;base64,cmVzcG9uc2UncyBib[...] is OK',
189 'Fetching data:image/png;base64,cmVzcG9uc2UncyBib2[...] is OK',
190 'Fetching [POST] data:,response%27s%20body is OK',
191 ],
192 },
193 'basic/scheme-others.sub.any.js': {},
194 'basic/status.h2.any.js': {
195 comment: 'Enable if HTTP/2 is implemented',
196 disabledTests: true,
197 },
198 'basic/stream-response.any.js': {},
199 'basic/stream-safe-creation.any.js': {},
200 'basic/text-utf8.any.js': {},
201 
202 'body/cloned-any.js': {},
203 'body/formdata.any.js': {},
204 'body/mime-type.any.js': {},
205 
206 'cors/cors-basic.any.js': {
207 comment: 'CORS is not implemented',
208 omittedTests: true,
209 },
210 'cors/cors-cookies-redirect.any.js': {
211 comment: 'CORS is not implemented',
212 omittedTests: true,
213 },
214 'cors/cors-cookies.any.js': {
215 comment: 'CORS is not implemented',
216 omittedTests: true,
217 },
218 'cors/cors-expose-star.sub.any.js': {
219 comment: 'CORS is not implemented',
220 omittedTests: true,
221 },
222 'cors/cors-filtering.sub.any.js': {
223 comment: 'CORS is not implemented',
224 omittedTests: true,
225 },
226 'cors/cors-keepalive.any.js': {
227 comment: 'CORS is not implemented',
228 omittedTests: true,
229 },
230 'cors/cors-multiple-origins.sub.any.js': {
231 comment: 'CORS is not implemented',
232 omittedTests: true,
233 },
234 'cors/cors-no-preflight.any.js': {
235 comment: 'CORS is not implemented',
236 omittedTests: true,
237 },
238 'cors/cors-origin.any.js': {
239 comment: 'CORS is not implemented',
240 omittedTests: true,
241 },
242 'cors/cors-preflight-cache.any.js': {
243 comment: 'CORS is not implemented',
244 omittedTests: true,
245 },
246 'cors/cors-preflight-not-cors-safelisted.any.js': {
247 comment: 'CORS is not implemented',
248 omittedTests: true,
249 },
250 'cors/cors-preflight-redirect.any.js': {
251 comment: 'CORS is not implemented',
252 omittedTests: true,
253 },
254 'cors/cors-preflight-referrer.any.js': {
255 comment: 'CORS is not implemented',
256 omittedTests: true,
257 },
258 'cors/cors-preflight-response-validation.any.js': {
259 comment: 'CORS is not implemented',
260 omittedTests: true,
261 },
262 'cors/cors-preflight-star.any.js': {
263 comment: 'CORS is not implemented',
264 omittedTests: true,
265 },
266 'cors/cors-preflight-status.any.js': {
267 comment: 'CORS is not implemented',
268 omittedTests: true,
269 },
270 'cors/cors-preflight.any.js': {
271 comment: 'CORS is not implemented',
272 omittedTests: true,
273 },
274 'cors/cors-redirect-credentials.any.js': {
275 comment: 'CORS is not implemented',
276 omittedTests: true,
277 },
278 'cors/cors-redirect-preflight.any.js': {
279 comment: 'CORS is not implemented',
280 omittedTests: true,
281 },
282 'cors/cors-redirect.any.js': {
283 comment: 'CORS is not implemented',
284 omittedTests: true,
285 },
286 
287 'crashtests/huge-fetch.any.js': {},
288 
289 'credentials/authentication-basic.any.js': {
290 comment: 'Response.type must be basic',
291 expectedFailures: [
292 'User-added Authorization header with include mode',
293 'User-added Authorization header with omit mode',
294 'User-added Authorization header with same-origin mode',
295 'User-added bogus Authorization header with omit mode',
296 ],
297 },
298 'credentials/authentication-redirection.any.js': {
299 comment:
300 'Even though the actual bug was fixed (Authorization now stripped), these tests are failing due to certificate problems',
301 expectedFailures: [
302 'getAuthorizationHeaderValue - same origin redirection',
303 'getAuthorizationHeaderValue - cross origin redirection',
304 ],
305 },
306 'credentials/cookies.any.js': {
307 comment: 'Request.credentials is not implemented',
308 disabledTests: true,
309 },
310 
311 'headers/header-setcookie.any.js': {
312 comment: '(1, 2) To be investigated, (3) CORS is not implemented',
313 expectedFailures: [
314 'Headers iterator is correctly updated with set-cookie changes',
315 'Headers iterator is correctly updated with set-cookie changes #2',
316 'Set-Cookie is a forbidden response header',
317 ],
318 },
319 'headers/header-values-normalize.any.js': {
320 comment: 'XMLHttpRequest is not supported',
321 expectedFailures: [
322 'XMLHttpRequest with value %00',
323 'XMLHttpRequest with value %01',
324 'XMLHttpRequest with value %02',
325 'XMLHttpRequest with value %03',
326 'XMLHttpRequest with value %04',
327 'XMLHttpRequest with value %05',
328 'XMLHttpRequest with value %06',
329 'XMLHttpRequest with value %07',
330 'XMLHttpRequest with value %08',
331 'XMLHttpRequest with value %09',
332 'XMLHttpRequest with value %0A',
333 'XMLHttpRequest with value %0D',
334 'XMLHttpRequest with value %0E',
335 'XMLHttpRequest with value %0F',
336 'XMLHttpRequest with value %10',
337 'XMLHttpRequest with value %11',
338 'XMLHttpRequest with value %12',
339 'XMLHttpRequest with value %13',
340 'XMLHttpRequest with value %14',
341 'XMLHttpRequest with value %15',
342 'XMLHttpRequest with value %16',
343 'XMLHttpRequest with value %17',
344 'XMLHttpRequest with value %18',
345 'XMLHttpRequest with value %19',
346 'XMLHttpRequest with value %1A',
347 'XMLHttpRequest with value %1B',
348 'XMLHttpRequest with value %1C',
349 'XMLHttpRequest with value %1D',
350 'XMLHttpRequest with value %1E',
351 'XMLHttpRequest with value %1F',
352 'XMLHttpRequest with value %20',
353 ],
354 },
355 'headers/header-values.any.js': {
356 comment: 'XMLHTTPRequest is not implemented',
357 expectedFailures: [
358 'XMLHttpRequest with value x%00x needs to throw',
359 'XMLHttpRequest with value x%0Ax needs to throw',
360 'XMLHttpRequest with value x%0Dx needs to throw',
361 'XMLHttpRequest with all valid values',
362 ],
363 },
364 'headers/headers-basic.any.js': {
365 comment: 'Investigate our Headers implementation',
366 expectedFailures: [
367 'Create headers with existing headers with custom iterator',
368 'Iteration skips elements removed while iterating',
369 'Removing elements already iterated over causes an element to be skipped during iteration',
370 'Appending a value pair during iteration causes it to be reached during iteration',
371 'Prepending a value pair before the current element position causes it to be skipped during iteration and adds the current element a second time',
372 ],
373 },
374 'headers/headers-casing.any.js': {},
375 'headers/headers-combine.any.js': {},
376 'headers/headers-errors.any.js': {
377 comment: 'Our validation of header names is too lax',
378 expectedFailures: [
379 'Create headers giving bad header name as init argument',
380 'Create headers giving bad header value as init argument',
381 'Check headers get with an invalid name invalidĀ',
382 'Check headers delete with an invalid name invalidĀ',
383 'Check headers has with an invalid name invalidĀ',
384 'Check headers set with an invalid name invalidĀ',
385 'Check headers set with an invalid value invalidĀ',
386 'Check headers append with an invalid name invalidĀ',
387 'Check headers append with an invalid name [object Object]',
388 'Check headers append with an invalid value invalidĀ',
389 ],
390 },
391 'headers/headers-no-cors.any.js': {
392 comment: 'Request.mode is not relevant',
393 disabledTests: true,
394 },
395 'headers/headers-normalize.any.js': {},
396 'headers/headers-record.any.js': {
397 comment:
398 'This test checks the exact order of operations in JS involved in accessing headers. Our implementation is in C++ instead.',
399 omittedTests: true,
400 },
401 'headers/headers-structure.any.js': {},
402 
403 'idlharness.https.any.js': {
404 comment:
405 'Workers expose globals differently than browsers - these interface tests fail',
406 expectedFailures: [
407 // Headers interface tests
408 /^Headers interface/,
409 // Request interface tests
410 /^Request interface/,
411 // Response interface tests
412 /^Response interface/,
413 // FetchLaterResult interface tests (not implemented)
414 /^FetchLaterResult interface/,
415 // Window interface tests (not applicable to workers)
416 /^Window interface/,
417 ],
418 },
419 
420 'policies/csp-blocked.js': {
421 comment: 'CSP is not implemented',
422 omittedTests: true,
423 },
424 'policies/nested-policy.js': {
425 comment: 'CSP is not implemented',
426 omittedTests: true,
427 },
428 'policies/referrer-no-referrer.js': {
429 comment: 'CSP is not implemented',
430 omittedTests: true,
431 },
432 'policies/referrer-origin-when-cross-origin.js': {
433 comment: 'CSP is not implemented',
434 omittedTests: true,
435 },
436 'policies/referrer-origin.js': {
437 comment: 'CSP is not implemented',
438 omittedTests: true,
439 },
440 'policies/referrer-unsafe-url.js': {
441 comment: 'CSP is not implemented',
442 omittedTests: true,
443 },
444 
445 'redirect/redirect-back-to-original-origin.any.js': {
446 comment: 'CORS is not implemented',
447 omittedTests: true,
448 },
449 'redirect/redirect-count.any.js': {},
450 'redirect/redirect-empty-location.any.js': {
451 comment:
452 'Fix our handling of empty Location header. Even when fixed, tests will still fail due to CORS stuff',
453 expectedFailures: [
454 'redirect response with empty Location, manual mode',
455 'redirect response with empty Location, follow mode',
456 ],
457 },
458 'redirect/redirect-keepalive.any.js': {
459 comment: 'Keepalive is not implemented',
460 disabledTests: true,
461 },
462 'redirect/redirect-keepalive.https.any.js': {
463 comment: 'Keepalive is not implemented',
464 disabledTests: true,
465 },
466 'redirect/redirect-location.any.js': {
467 comment:
468 'Status is expected to be 0 in a browser to avoid leaking info. We do not implement CORS',
469 omittedTests: [/Redirect 3\d\d in "manual" mode .*/],
470 },
471 'redirect/redirect-method.any.js': {
472 comment: 'Reasons listed per case',
473 expectedFailures: [
474 // Made up method name
475 'Redirect 303 with TESTING',
476 // Content-type header not cleared
477 'Redirect 301 with POST',
478 'Redirect 303 with POST',
479 'Redirect 302 with POST',
480 'Redirect 303 with HEAD',
481 // Response.type must be basic
482 'Redirect 302 with GET',
483 'Redirect 307 with HEAD',
484 'Redirect 301 with GET',
485 'Redirect 303 with GET',
486 'Redirect 307 with POST (string body)',
487 'Redirect 307 with POST (blob body)',
488 'Redirect 301 with HEAD',
489 'Redirect 302 with HEAD',
490 'Redirect 307 with GET',
491 ],
492 },
493 'redirect/redirect-mode.any.js': {
494 comment: "This test contains stuff besides CORS. Don't omit it all.",
495 omittedTests: [
496 /(same|cross)-origin redirect 3\d\d in manual redirect and (no-cors|cors) mode/,
497 /cross-origin redirect 3\d\d in follow redirect and no-cors mode/,
498 'manual redirect with a CORS error should be rejected',
499 ],
500 },
501 'redirect/redirect-origin.any.js': {
502 comment: 'CORS is not implemented',
503 omittedTests: true,
504 },
505 'redirect/redirect-referrer-override.any.js': {
506 comment: 'Referer is not implemented',
507 omittedTests: true,
508 },
509 'redirect/redirect-referrer.any.js': {
510 comment: 'Referrer is not implemented',
511 omittedTests: true,
512 },
513 'redirect/redirect-schemes.any.js': {},
514 'redirect/redirect-to-dataurl.any.js': {},
515 'redirect/redirect-upload.h2.any.js': {
516 comment: 'Do we support HTTP 2?',
517 omittedTests: true,
518 },
519 
520 'request/forbidden-method.any.js': {
521 comment: 'We do not have forbidden methods',
522 omittedTests: true,
523 },
524 'request/multi-globals/construct-in-detached-frame.window.js': {
525 comment: "We don't support detached realms",
526 omittedTests: true,
527 },
528 'request/request-bad-port.any.js': {},
529 'request/request-cache-default-conditional.any.js': {
530 comment: 'Unsupported cache mode: default',
531 expectedFailures: [
532 'RequestCache "default" mode with an If-Modified-Since header (following a request without additional headers) is treated similarly to "no-store" with Etag and stale response',
533 'RequestCache "default" mode with an If-Modified-Since header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and stale response',
534 'RequestCache "default" mode with an If-Modified-Since header (following a request without additional headers) is treated similarly to "no-store" with Etag and fresh response',
535 'RequestCache "default" mode with an If-Modified-Since header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and fresh response',
536 'RequestCache "default" mode with an If-Modified-Since header is treated similarly to "no-store" with Etag and stale response',
537 'RequestCache "default" mode with an If-Modified-Since header is treated similarly to "no-store" with Last-Modified and stale response',
538 'RequestCache "default" mode with an If-Modified-Since header is treated similarly to "no-store" with Etag and fresh response',
539 'RequestCache "default" mode with an If-Modified-Since header is treated similarly to "no-store" with Last-Modified and fresh response',
540 'RequestCache "default" mode with an If-None-Match header (following a request without additional headers) is treated similarly to "no-store" with Etag and stale response',
541 'RequestCache "default" mode with an If-None-Match header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and stale response',
542 'RequestCache "default" mode with an If-None-Match header (following a request without additional headers) is treated similarly to "no-store" with Etag and fresh response',
543 'RequestCache "default" mode with an If-None-Match header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and fresh response',
544 'RequestCache "default" mode with an If-None-Match header is treated similarly to "no-store" with Etag and stale response',
545 'RequestCache "default" mode with an If-None-Match header is treated similarly to "no-store" with Last-Modified and stale response',
546 'RequestCache "default" mode with an If-None-Match header is treated similarly to "no-store" with Etag and fresh response',
547 'RequestCache "default" mode with an If-None-Match header is treated similarly to "no-store" with Last-Modified and fresh response',
548 'RequestCache "default" mode with an If-Unmodified-Since header (following a request without additional headers) is treated similarly to "no-store" with Etag and stale response',
549 'RequestCache "default" mode with an If-Unmodified-Since header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and stale response',
550 'RequestCache "default" mode with an If-Unmodified-Since header (following a request without additional headers) is treated similarly to "no-store" with Etag and fresh response',
551 'RequestCache "default" mode with an If-Unmodified-Since header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and fresh response',
552 'RequestCache "default" mode with an If-Unmodified-Since header is treated similarly to "no-store" with Etag and stale response',
553 'RequestCache "default" mode with an If-Unmodified-Since header is treated similarly to "no-store" with Last-Modified and stale response',
554 'RequestCache "default" mode with an If-Unmodified-Since header is treated similarly to "no-store" with Etag and fresh response',
555 'RequestCache "default" mode with an If-Unmodified-Since header is treated similarly to "no-store" with Last-Modified and fresh response',
556 'RequestCache "default" mode with an If-Match header (following a request without additional headers) is treated similarly to "no-store" with Etag and stale response',
557 'RequestCache "default" mode with an If-Match header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and stale response',
558 'RequestCache "default" mode with an If-Match header (following a request without additional headers) is treated similarly to "no-store" with Etag and fresh response',
559 'RequestCache "default" mode with an If-Match header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and fresh response',
560 'RequestCache "default" mode with an If-Match header is treated similarly to "no-store" with Etag and stale response',
561 'RequestCache "default" mode with an If-Match header is treated similarly to "no-store" with Last-Modified and stale response',
562 'RequestCache "default" mode with an If-Match header is treated similarly to "no-store" with Etag and fresh response',
563 'RequestCache "default" mode with an If-Match header is treated similarly to "no-store" with Last-Modified and fresh response',
564 'RequestCache "default" mode with an If-Range header (following a request without additional headers) is treated similarly to "no-store" with Etag and stale response',
565 'RequestCache "default" mode with an If-Range header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and stale response',
566 'RequestCache "default" mode with an If-Range header (following a request without additional headers) is treated similarly to "no-store" with Etag and fresh response',
567 'RequestCache "default" mode with an If-Range header (following a request without additional headers) is treated similarly to "no-store" with Last-Modified and fresh response',
568 'RequestCache "default" mode with an If-Range header is treated similarly to "no-store" with Etag and stale response',
569 'RequestCache "default" mode with an If-Range header is treated similarly to "no-store" with Last-Modified and stale response',
570 'RequestCache "default" mode with an If-Range header is treated similarly to "no-store" with Etag and fresh response',
571 'RequestCache "default" mode with an If-Range header is treated similarly to "no-store" with Last-Modified and fresh response',
572 ],
573 },
574 'request/request-cache-default.any.js': {
575 comment: "All fail with 'Unsupported cache mode: default' even no-store",
576 expectedFailures: [
577 'RequestCache "default" mode checks the cache for previously cached content and goes to the network for stale responses with Etag and stale response',
578 'RequestCache "default" mode checks the cache for previously cached content and goes to the network for stale responses with Last-Modified and stale response',
579 'RequestCache "default" mode checks the cache for previously cached content and avoids going to the network if a fresh response exists with Etag and fresh response',
580 'RequestCache "default" mode checks the cache for previously cached content and avoids going to the network if a fresh response exists with Last-Modified and fresh response',
581 'Responses with the "Cache-Control: no-store" header are not stored in the cache with Etag and stale response',
582 'Responses with the "Cache-Control: no-store" header are not stored in the cache with Last-Modified and stale response',
583 'Responses with the "Cache-Control: no-store" header are not stored in the cache with Etag and fresh response',
584 'Responses with the "Cache-Control: no-store" header are not stored in the cache with Last-Modified and fresh response',
585 ],
586 },
587 'request/request-cache-force-cache.any.js': {
588 comment: 'Unsupported cache mode: default',
589 expectedFailures: [
590 'RequestCache "force-cache" mode checks the cache for previously cached content and avoid revalidation for stale responses with Etag and stale response',
591 'RequestCache "force-cache" mode checks the cache for previously cached content and avoid revalidation for stale responses with Last-Modified and stale response',
592 'RequestCache "force-cache" mode checks the cache for previously cached content and avoid revalidation for fresh responses with Etag and fresh response',
593 'RequestCache "force-cache" mode checks the cache for previously cached content and avoid revalidation for fresh responses with Last-Modified and fresh response',
594 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response is not found with Etag and stale response',
595 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response is not found with Last-Modified and stale response',
596 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response is not found with Etag and fresh response',
597 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response is not found with Last-Modified and fresh response',
598 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response would vary with Etag and stale response',
599 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response would vary with Last-Modified and stale response',
600 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response would vary with Etag and fresh response',
601 'RequestCache "force-cache" mode checks the cache for previously cached content and goes to the network if a cached response would vary with Last-Modified and fresh response',
602 'RequestCache "force-cache" stores the response in the cache if it goes to the network with Etag and stale response',
603 'RequestCache "force-cache" stores the response in the cache if it goes to the network with Last-Modified and stale response',
604 'RequestCache "force-cache" stores the response in the cache if it goes to the network with Etag and fresh response',
605 'RequestCache "force-cache" stores the response in the cache if it goes to the network with Last-Modified and fresh response',
606 ],
607 },
608 'request/request-cache-no-cache.any.js': {
609 comment: 'Unsupported cache mode: default',
610 expectedFailures: [
611 'RequestCache "no-cache" mode revalidates stale responses found in the cache with Etag and stale response',
612 'RequestCache "no-cache" mode revalidates stale responses found in the cache with Last-Modified and stale response',
613 'RequestCache "no-cache" mode revalidates fresh responses found in the cache with Etag and fresh response',
614 'RequestCache "no-cache" mode revalidates fresh responses found in the cache with Last-Modified and fresh response',
615 ],
616 },
617 'request/request-cache-no-store.any.js': {
618 comment: 'Unsupported cache mode: default',
619 expectedFailures: [
620 'RequestCache "no-store" mode does not check the cache for previously cached content and goes to the network regardless with Etag and stale response',
621 'RequestCache "no-store" mode does not check the cache for previously cached content and goes to the network regardless with Last-Modified and stale response',
622 'RequestCache "no-store" mode does not check the cache for previously cached content and goes to the network regardless with Etag and fresh response',
623 'RequestCache "no-store" mode does not check the cache for previously cached content and goes to the network regardless with Last-Modified and fresh response',
624 'RequestCache "no-store" mode does not store the response in the cache with Etag and stale response',
625 'RequestCache "no-store" mode does not store the response in the cache with Last-Modified and stale response',
626 'RequestCache "no-store" mode does not store the response in the cache with Etag and fresh response',
627 'RequestCache "no-store" mode does not store the response in the cache with Last-Modified and fresh response',
628 ],
629 },
630 'request/request-cache-only-if-cached.any.js': {
631 comment: 'Unsupported cache mode: default',
632 expectedFailures: [
633 'RequestCache "only-if-cached" mode checks the cache for previously cached content and avoids revalidation for stale responses with Etag and stale response',
634 'RequestCache "only-if-cached" mode checks the cache for previously cached content and avoids revalidation for stale responses with Last-Modified and stale response',
635 'RequestCache "only-if-cached" mode checks the cache for previously cached content and avoids revalidation for fresh responses with Etag and fresh response',
636 'RequestCache "only-if-cached" mode checks the cache for previously cached content and avoids revalidation for fresh responses with Last-Modified and fresh response',
637 'RequestCache "only-if-cached" (with "same-origin") uses cached same-origin redirects to same-origin content with Etag and fresh response',
638 'RequestCache "only-if-cached" (with "same-origin") uses cached same-origin redirects to same-origin content with Last-Modified and fresh response',
639 'RequestCache "only-if-cached" (with "same-origin") uses cached same-origin redirects to same-origin content with Etag and stale response',
640 'RequestCache "only-if-cached" (with "same-origin") uses cached same-origin redirects to same-origin content with Last-Modified and stale response',
641 'RequestCache "only-if-cached" (with "same-origin") does not follow redirects across origins and rejects with Etag and fresh response',
642 'RequestCache "only-if-cached" (with "same-origin") does not follow redirects across origins and rejects with Last-Modified and fresh response',
643 'RequestCache "only-if-cached" (with "same-origin") does not follow redirects across origins and rejects with Etag and stale response',
644 'RequestCache "only-if-cached" (with "same-origin") does not follow redirects across origins and rejects with Last-Modified and stale response',
645 ],
646 },
647 'request/request-cache-reload.any.js': {
648 comment: 'Unsupported cache mode: default',
649 expectedFailures: [
650 'RequestCache "reload" mode does not check the cache for previously cached content and goes to the network regardless with Etag and stale response',
651 'RequestCache "reload" mode does not check the cache for previously cached content and goes to the network regardless with Last-Modified and stale response',
652 'RequestCache "reload" mode does not check the cache for previously cached content and goes to the network regardless with Etag and fresh response',
653 'RequestCache "reload" mode does not check the cache for previously cached content and goes to the network regardless with Last-Modified and fresh response',
654 'RequestCache "reload" mode does store the response in the cache with Etag and stale response',
655 'RequestCache "reload" mode does store the response in the cache with Last-Modified and stale response',
656 'RequestCache "reload" mode does store the response in the cache with Etag and fresh response',
657 'RequestCache "reload" mode does store the response in the cache with Last-Modified and fresh response',
658 'RequestCache "reload" mode does store the response in the cache even if a previous response is already stored with Etag and stale response',
659 'RequestCache "reload" mode does store the response in the cache even if a previous response is already stored with Last-Modified and stale response',
660 'RequestCache "reload" mode does store the response in the cache even if a previous response is already stored with Etag and fresh response',
661 'RequestCache "reload" mode does store the response in the cache even if a previous response is already stored with Last-Modified and fresh response',
662 ],
663 },
664 'request/request-cache.js': {},
665 'request/request-constructor-init-body-override.any.js': {},
666 'request/request-consume-empty.any.js': {
667 comment:
668 'We seem to be returning the boundary value as text but WPT expects no value',
669 expectedFailures: ['Consume empty FormData request body as text'],
670 },
671 'request/request-consume.any.js': {},
672 'request/request-disturbed.any.js': {
673 comment:
674 "(1) To be investigated, (2) They're literally passing URL, the constructor, as the URL!?!",
675 expectedFailures: [
676 'Input request used for creating new request became disturbed even if body is not used',
677 'Request construction failure should not set "bodyUsed"',
678 ],
679 },
680 'request/request-error.any.js': {
681 comment:
682 'These tests would require us to throw errors for some invalid situations that we just ignore',
683 expectedFailures: [
684 "RequestInit's window is not null",
685 'Input URL has credentials',
686 "RequestInit's mode is navigate",
687 "RequestInit's referrer is invalid",
688 "RequestInit's method is forbidden",
689 "RequestInit's mode is no-cors and method is not simple",
690 'Bad referrerPolicy init parameter value',
691 'Bad mode init parameter value',
692 'Bad credentials init parameter value',
693 'Request with cache mode: only-if-cached and fetch mode: same-origin',
694 ],
695 },
696 'request/request-error.js': {},
697 'request/request-headers.any.js': {
698 comment: 'Neither CORS nor header filtering is implemented',
699 omittedTests: true,
700 },
701 'request/request-init-002.any.js': {},
702 'request/request-init-contenttype.any.js': {},
703 'request/request-init-priority.any.js': {
704 comment: 'Request.priority is not implemented',
705 disabledTests: true,
706 },
707 'request/request-init-stream.any.js': {
708 comment: 'Most of these are because duplex is not implemented',
709 expectedFailures: [
710 'Constructing a Request with a stream holds the original object.',
711 'It is error to omit .duplex when the body is a ReadableStream.',
712 "It is error to set .duplex = 'full' when the body is null.",
713 "It is error to set .duplex = 'full' when the body is a string.",
714 "It is error to set .duplex = 'full' when the body is a Uint8Array.",
715 "It is error to set .duplex = 'full' when the body is a Blob.",
716 "It is error to set .duplex = 'full' when the body is a ReadableStream.",
717 ],
718 },
719 'request/request-keepalive.any.js': {
720 comment: 'keepalive is not implemented',
721 disabledTests: true,
722 },
723 'request/request-structure.any.js': {
724 comment: 'Unimplemented or partially implemented fields',
725 expectedFailures: [
726 'Check destination attribute',
727 'Check referrer attribute',
728 'Check referrerPolicy attribute',
729 'Check mode attribute',
730 'Check credentials attribute',
731 'Check cache attribute',
732 'Check isReloadNavigation attribute',
733 'Check isHistoryNavigation attribute',
734 'Check duplex attribute',
735 ],
736 },
737 
738 'response/json.any.js': {
739 comment:
740 'UTF-16 test requires /xhr/resources/utf16-bom.json which is in a different test module',
741 expectedFailures: ['Ensure UTF-16 results in an error'],
742 },
743 'response/response-arraybuffer-realm.window.js': {
744 comment: 'Skipped because it involves iframes',
745 omittedTests: true,
746 },
747 'response/response-blob-realm.any.js': {
748 comment: 'Skipped because it involves iframes',
749 omittedTests: true,
750 },
751 'response/response-cancel-stream.any.js': {},
752 'response/response-clone-iframe.window.js': {
753 comment: 'Skipped because it involves iframes',
754 omittedTests: true,
755 },
756 'response/response-clone.any.js': {
757 comment: 'TODO Investigate this',
758 expectedFailures: [
759 "Check Response's clone with default values, without body",
760 'Check response clone use structureClone for teed ReadableStreams (Int8Arraychunk)',
761 'Check response clone use structureClone for teed ReadableStreams (Int16Arraychunk)',
762 'Check response clone use structureClone for teed ReadableStreams (Int32Arraychunk)',
763 'Check response clone use structureClone for teed ReadableStreams (ArrayBufferchunk)',
764 'Check response clone use structureClone for teed ReadableStreams (Uint8Arraychunk)',
765 'Check response clone use structureClone for teed ReadableStreams (Uint8ClampedArraychunk)',
766 'Check response clone use structureClone for teed ReadableStreams (Uint16Arraychunk)',
767 'Check response clone use structureClone for teed ReadableStreams (Uint32Arraychunk)',
768 'Check response clone use structureClone for teed ReadableStreams (BigInt64Arraychunk)',
769 'Check response clone use structureClone for teed ReadableStreams (BigUint64Arraychunk)',
770 'Check response clone use structureClone for teed ReadableStreams (Float16Arraychunk)',
771 'Check response clone use structureClone for teed ReadableStreams (Float32Arraychunk)',
772 'Check response clone use structureClone for teed ReadableStreams (Float64Arraychunk)',
773 'Check response clone use structureClone for teed ReadableStreams (DataViewchunk)',
774 ],
775 },
776 'response/response-consume-empty.any.js': {
777 comment:
778 'We seem to be returning the boundary value as text but WPT expects no value',
779 expectedFailures: ['Consume empty FormData response body as text'],
780 },
781 'response/response-consume-stream.any.js': {},
782 'response/response-error-from-stream.any.js': {
783 comment: 'We have TypeError, they want pull Error',
784 expectedFailures: [
785 'ReadableStream start() Error propagates to Response.formData() Promise',
786 'ReadableStream pull() Error propagates to Response.formData() Promise',
787 ],
788 },
789 'response/response-error.any.js': {
790 comment: 'Likely just missing validation',
791 expectedFailures: ["Throws TypeError when responseInit's statusText is Ā"],
792 },
793 'response/response-from-stream.any.js': {
794 comment: 'Missing expected exception (TypeError)',
795 expectedFailures: [
796 'Constructing a Response with a stream on which getReader() is called',
797 ],
798 },
799 'response/response-headers-guard.any.js': {
800 comment: 'Likely just missing validation',
801 expectedFailures: ['Ensure response headers are immutable'],
802 },
803 'response/response-init-001.any.js': {
804 comment: 'statusText should be inited to OK',
805 expectedFailures: ['Check default value for statusText attribute'],
806 },
807 'response/response-init-002.any.js': {},
808 'response/response-init-contenttype.any.js': {},
809 'response/response-static-error.any.js': {
810 comment:
811 'We need to make Headers immutable when constructing Response.error()',
812 expectedFailures: [
813 "the 'guard' of the Headers instance should be immutable",
814 ],
815 },
816 'response/response-static-json.any.js': {
817 comment: 'statusText does not match the status code',
818 expectedFailures: [
819 // For this test specifically: failed to throw on non-encodable data
820 'Check static json() throws when data is not encodable',
821 'Check response returned by static json() with init undefined',
822 'Check response returned by static json() with init {"status":400}',
823 'Check response returned by static json() with init {"headers":{}}',
824 'Check response returned by static json() with init {"headers":{"content-type":"foo/bar"}}',
825 'Check response returned by static json() with init {"headers":{"x-foo":"bar"}}',
826 ],
827 },
828 'response/response-static-redirect.any.js': {
829 comment: 'statusText does not match the status code',
830 expectedFailures: [
831 'Check default redirect response',
832 'Check response returned by static method redirect(), status = 301',
833 'Check response returned by static method redirect(), status = 302',
834 'Check response returned by static method redirect(), status = 303',
835 'Check response returned by static method redirect(), status = 307',
836 'Check response returned by static method redirect(), status = 308',
837 ],
838 },
839 'response/response-stream-bad-chunk.any.js': {},
840 'response/response-stream-disturbed-1.any.js': {},
841 'response/response-stream-disturbed-2.any.js': {},
842 'response/response-stream-disturbed-3.any.js': {},
843 'response/response-stream-disturbed-4.any.js': {},
844 'response/response-stream-disturbed-5.any.js': {},
845 'response/response-stream-disturbed-6.any.js': {},
846 'response/response-stream-disturbed-by-pipe.any.js': {},
847 'response/response-stream-disturbed-util.js': {},
848 'response/response-stream-with-broken-then.any.js': {
849 comment:
850 'Triggers an internal error: promise.h:103: failed: expected Wrappable::tryUnwrapOpaque(isolate, handle) != nullptr',
851 expectedFailures: [
852 'Attempt to inject {done: false, value: bye} via Object.prototype.then.',
853 'Attempt to inject value: undefined via Object.prototype.then.',
854 'Attempt to inject undefined via Object.prototype.then.',
855 'Attempt to inject 8.2 via Object.prototype.then.',
856 ],
857 },
858} satisfies TestRunnerConfig;