commit f7f890f133be14fdad8d90865eaa7b3f6e01f673
parent 153c787be0bd689caf316840896e911c6b2bf99f
Author: Tim van der Lippe <tvanderlippe@gmail.com>
Date: Wed, 7 Jan 2026 09:19:27 +0000
Bug 2008468 [wpt PR 56978] - script: Fix fetch-later length and quota computation, a=testonly
Automatic update from web-platform-tests
script: Fix fetch-later length and quota computation
The specification isn't complete here and thus we
were missing WPT coverage. Spec will be updated.
Also, we are correctly throwing the QuotaExceededError
with relevant information, while Chrome sets both
fields to `null`. Therefore, the test now allows for
both (since providing relevant information is good
for the developer and recommended in the spec [1]).
[1]: https://webidl.spec.whatwg.org/#ref-for-quotaexceedederror%E2%91%A2
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
--
wpt-commits: 1ecdc3b0d77c50611ecf35246e00d83e7f70cb39
wpt-pr: 56978
Diffstat:
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/testing/web-platform/tests/fetch/fetch-later/quota/accumulated-oversized-payload.https.window.js b/testing/web-platform/tests/fetch/fetch-later/quota/accumulated-oversized-payload.https.window.js
@@ -37,15 +37,21 @@ test(
// Makes the 2nd call (POST) to the same reporting origin that sends
// max bytes, which should be rejected.
- assert_throws_quotaexceedederror(() => {
- fetchLater(requestUrl, {
- method: 'POST',
- signal: controller.signal,
- body: makeBeaconData(generatePayload(quota), dataType),
- // Required, as the size of referrer also take up quota.
- referrer: '',
- });
- }, null, null);
+ assert_throws_quotaexceedederror(
+ () => {
+ fetchLater(requestUrl, {
+ method: 'POST',
+ signal: controller.signal,
+ body: makeBeaconData(generatePayload(quota), dataType),
+ // Required, as the size of referrer also take up quota.
+ referrer: '',
+ });
+ },
+ // Either no information should be provided, or it should exactly
+ // be the expected values
+ (requested) => [QUOTA_PER_ORIGIN, null].includes(requested),
+ (remaining) => [halfQuota - 1, null].includes(remaining)
+ );
// Makes the 3rd call (GET) to the same reporting origin, where its
// request size is len(requestUrl) + headers, which should be accepted.