Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 4998c17

Browse files
mingycmoz-wptsync-bot
authored andcommitted
Bug 1944489 [wpt PR 50362] - [fetch-later] Fix incorrect quota behavior in same-origin iframes, a=testonly
Automatic update from web-platform-tests [fetch-later] Fix incorrect quota behavior in same-origin iframes This CL incorporate [recent spec changes][1] to solve various issue: - Fix fetchLater requests made in same-origin iframes not respecting pending fetchLater requests from its parent and neighbor iframes. - No longer perform complicated quota calculation in fetchLater algorithms to prevent from taking up [inflightKeepaliveBytes][2]. This is left as an open spec question to solve in the future. As a result, what this CL really changes: - Update `GetAvailableDeferredQuota()` to take source frame instead of control frame, and update related implementation. - Update DeferredLoader's `invoke_state_` to match current spec. [1]: whatwg/fetch@139351f [2]: https://fetch.spec.whatwg.org/#ref-for-request-keepalive-flag%E2%91%A1 NO_IFTTT=changes reflected in tools/metrics/histograms/metadata/blink/enums.xml Bug: 40276121 Change-Id: Ie41ffdf7558860ff34901c547578ebf81189f3a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6193934 Reviewed-by: Adam Rice <[email protected]> Commit-Queue: Ming-Ying Chung <[email protected]> Reviewed-by: Takashi Toyoshima <[email protected]> Cr-Commit-Position: refs/heads/main@{#1412755} -- wpt-commits: e073ec350612006d8ef841a3759226edcd532e20 wpt-pr: 50362
1 parent b9d8edd commit 4998c17

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

testing/web-platform/tests/fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.tentative.https.window.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,32 @@ promise_test(async _ => {
3131
referrer: '',
3232
});
3333

34-
// Queues a max bytes request in the 2nd same-origin iframe.
35-
// TODO(crbug.com/40276121): Confirm whether this should be rejected from
36-
// https://github.com/whatwg/fetch/pull/1647/files#r1919611046
34+
// Queues a max bytes request to `HTTPS_ORIGIN` in the 2nd same-origin iframe,
35+
// which should be rejected because the target URL's origin `HTTPS_ORIGIN`
36+
// already has 64kb pending from 1st request.
3737
await loadFetchLaterIframe(HTTPS_ORIGIN, {
3838
targetUrl: requestUrl,
3939
method: 'POST',
4040
bodyType: dataType,
4141
bodySize: getRemainingQuota(QUOTA_PER_ORIGIN, requestUrl, headers),
4242
// Required, as the size of referrer also take up quota.
4343
referrer: '',
44+
expect: new FetchLaterIframeExpectation(
45+
FetchLaterExpectationType.ERROR_DOM, 'QuotaExceededError'),
4446
});
4547

46-
// Queues a max bytes request in the root document.
47-
// TODO(crbug.com/40276121): Confirm whether this should be rejected from
48-
// https://github.com/whatwg/fetch/pull/1647/files#r1919611046
49-
fetchLater(requestUrl, {
50-
method: 'POST',
51-
body: generatePayload(
52-
getRemainingQuota(QUOTA_PER_ORIGIN, requestUrl, headers), dataType),
53-
// Required, as the size of referrer also take up quota.
54-
referrer: ''
55-
});
48+
// Queues a max bytes request in the root document, which should also be
49+
// rejected, because the target URL's origin `HTTPS_ORIGIN` already has 64kb
50+
// pending from 1st request.
51+
assert_throws_dom(
52+
'QuotaExceededError',
53+
() => fetchLater(requestUrl, {
54+
method: 'POST',
55+
body: generatePayload(
56+
getRemainingQuota(QUOTA_PER_ORIGIN, requestUrl, headers), dataType),
57+
// Required, as the size of referrer also take up quota.
58+
referrer: '',
59+
}));
5660

5761
// Release quota taken by the pending requests for subsequent tests.
5862
for (const element of document.querySelectorAll('iframe')) {

0 commit comments

Comments
 (0)