commit f9d699f4c46d39f2d3a778e5db58aa03b59208d4 parent 942666c2dacc6ef6bd4884f130e69af490c14482 Author: Brian Lefler <bcl@google.com> Date: Fri, 19 Dec 2025 09:14:21 +0000 Bug 2006228 [wpt PR 56767] - Reland "Add a fieldtrial testing entry for StaticStorageQuota and update tests.", a=testonly Automatic update from web-platform-tests Reland "Add a fieldtrial testing entry for StaticStorageQuota and update tests." This is a reland of commit a52bb102111b7abeaee9c3f183732ae1733023fe This reland addresses a test overflow bug when disk size was INT64_MAX, which turned out to be the case for fuchsia arm64. 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 Change-Id: I195585c3a1a39ac4b22af1528359edb3d9529129 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7232332 Reviewed-by: Zainab Rizvi <rizvis@google.com> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Commit-Queue: Zainab Rizvi <rizvis@google.com> Cr-Commit-Position: refs/heads/main@{#1559053} -- wpt-commits: 18aa1cb34df7c65170a0ec3e64db6f58217ee2f6 wpt-pr: 56767 Diffstat:
2 files changed, 9 insertions(+), 13 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(storageKeyQuota, quota, name) { +async function testQuota(quota, name) { const safeQuota = sanitizeQuota(quota); const bucket = await navigator.storageBuckets.open(name, { quota: safeQuota }); const estimateQuota = (await bucket.estimate()).quota; - assert_equals(estimateQuota, Math.min(safeQuota, storageKeyQuota)); + assert_equals(estimateQuota, safeQuota); } promise_test(async testCase => { @@ -20,13 +20,9 @@ promise_test(async testCase => { const storageKeyQuota = (await navigator.storage.estimate()).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.'); + 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'); 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_equals(estimate.quota, estimate2.quota); + assert_greater_than(estimate2.quota, 0); assert_less_than(estimate.usage, estimate2.usage); }, 'estimate() should retrieve quota usage');