commit 7cc5cf4f08bc73c2eeeb67a9a133e60ce0558294 parent fcca0b511ce17e91efb53b91f45177d4f9a4880e Author: Marijn Kruisselbrink <mek@chromium.org> Date: Mon, 8 Dec 2025 12:29:17 +0000 Bug 2004562 [wpt PR 56534] - Revert "Add a fieldtrial testing entry for StaticStorageQuota and update tests.", a=testonly Automatic update from web-platform-tests Revert "Add a fieldtrial testing entry for StaticStorageQuota and update tests." This reverts commit a52bb102111b7abeaee9c3f183732ae1733023fe. Reason for revert: Is causing test failures on fuchsia bots: https://ci.chromium.org/ui/b/8696312973245029489 and https://ci.chromium.org/ui/b/8696310780410051793 Original change's description: > Add a fieldtrial testing entry for StaticStorageQuota and update tests. > > There is no single spec-defined correct value for estimated quota and > the associated WPTs are marked as tentative, so this change relaxes the > related asserts so the WPTs pass with StaticStorageQuota both on and > off. Note that Safari and FF both have their own distinct, but within > spec, behavior for estimated quota and so there might need to be more > relaxation of these WPTs to make them non-tentative. > > Bug: 369865059 > Change-Id: Ifd10f007248760a8278fbb9ecaea165823aa9b54 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7188470 > Reviewed-by: Zainab Rizvi <rizvis@google.com> > Auto-Submit: Brian Lefler <bcl@google.com> > Reviewed-by: Tsuyoshi Horo <horo@chromium.org> > Commit-Queue: Zainab Rizvi <rizvis@google.com> > Cr-Commit-Position: refs/heads/main@{#1554612} Bug: 369865059 No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: I5ddd1e2bea85b23e6f53a6d14ce5dfde3c31c66d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7233014 Auto-Submit: Marijn Kruisselbrink <mek@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Marijn Kruisselbrink <mek@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1554756} -- wpt-commits: dfa46d76755108fa6defcb5e1716591ef05f506e wpt-pr: 56534 Diffstat:
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/testing/web-platform/tests/storage/buckets/buckets_storage_policy.tentative.https.any.js b/testing/web-platform/tests/storage/buckets/buckets_storage_policy.tentative.https.any.js @@ -8,11 +8,11 @@ function sanitizeQuota(quota) { return Math.max(1, Math.min(Number.MAX_SAFE_INTEGER, Math.floor(quota))); } -async function testQuota(quota, name) { +async function testQuota(storageKeyQuota, quota, name) { const safeQuota = sanitizeQuota(quota); const bucket = await navigator.storageBuckets.open(name, { quota: safeQuota }); const estimateQuota = (await bucket.estimate()).quota; - assert_equals(estimateQuota, safeQuota); + assert_equals(estimateQuota, Math.min(safeQuota, storageKeyQuota)); } promise_test(async testCase => { @@ -20,9 +20,13 @@ promise_test(async testCase => { const storageKeyQuota = (await navigator.storage.estimate()).quota; - testQuota(1, 'one'); - testQuota(storageKeyQuota / 4, 'quarter'); - testQuota(storageKeyQuota / 2, 'half'); - testQuota(storageKeyQuota - 1, 'one_less'); - testQuota(storageKeyQuota, 'origin_quota'); -}, 'Bucket quota is properly set as long as it is within the storage quota'); + testQuota(storageKeyQuota, 1, 'one'); + testQuota(storageKeyQuota, storageKeyQuota / 4, 'quarter'); + testQuota(storageKeyQuota, storageKeyQuota / 2, 'half'); + testQuota(storageKeyQuota, storageKeyQuota - 1, 'one_less'); + testQuota(storageKeyQuota, storageKeyQuota, 'origin_quota'); + testQuota(storageKeyQuota, storageKeyQuota + 1, 'one_more'); + testQuota(storageKeyQuota, storageKeyQuota * 2, 'twice'); + testQuota(storageKeyQuota, storageKeyQuota * 4, 'four_times'); + testQuota(storageKeyQuota, Number.MAX_SAFE_INTEGER, 'max_safe_int'); +}, 'For an individual bucket, the quota is the minimum of the requested quota and the StorageKey quota.'); diff --git a/testing/web-platform/tests/storage/buckets/storage_bucket_object.tentative.https.any.js b/testing/web-platform/tests/storage/buckets/storage_bucket_object.tentative.https.any.js @@ -31,7 +31,7 @@ promise_test(async testCase => { await inboxCache.put(cacheKey, new Response('bread x 2')) const estimate2 = await bucket.estimate(); - assert_greater_than(estimate2.quota, 0); + assert_equals(estimate.quota, estimate2.quota); assert_less_than(estimate.usage, estimate2.usage); }, 'estimate() should retrieve quota usage');