mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Automatic update from web-platform-tests Shared Storage: Change to per-origin byte limit To increase developer ergonomics, we drop the limit on number of key-value pairs per origin, as well as the previous character limits for keys and values. We move instead to a total byte quota for each origin. Note that, strictly speaking, there will still a key and value length limit, in that each key and value must necessarily be less than or equal to the quota, given that the total of all lengths of keys and values must not exceed the quota. We accomplish this by updating the previous feature param `blink::features::kMaxSharedStorageEntriesPerOrigin` to a new feature param `blink::features::kMaxSharedStorageBytesPerOrigin`, deleting the previous feature param `blink::features::kMaxSharedStorageStringLength`, and replacing instances of the later with half of the new value for `blink::features::kMaxSharedStorageBytesPerOrigin` (as we are measuring the length in number of char16_t's). For more information, see https://github.com/WICG/shared-storage/pull/132. Bug: 325352528,1218540 Change-Id: Icf3c390fcdb2893e74d1112c53db0ece2ecefe7b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296983 Reviewed-by: Dominic Farolino <[email protected]> Reviewed-by: Yao Xiao <[email protected]> Reviewed-by: Russ Hamilton <[email protected]> Commit-Queue: Cammie Smith Barnes <[email protected]> Cr-Commit-Position: refs/heads/main@{#1263539} -- wpt-commits: 3d9335836c665aecca0ea89ba80b59b367416fa8 wpt-pr: 44666
45 lines
1.1 KiB
HTML
45 lines
1.1 KiB
HTML
<!doctype html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<body>
|
|
<script>
|
|
'use strict';
|
|
|
|
promise_test(async t => {
|
|
try {
|
|
await sharedStorage.set('a'.repeat(2621441), 'b');
|
|
} catch (e) {
|
|
assert_equals(e.name, 'DataError');
|
|
return;
|
|
}
|
|
assert_unreached("did not reject");
|
|
}, 'sharedStorage.set with key length too big');
|
|
|
|
promise_test(async t => {
|
|
try {
|
|
await sharedStorage.set('a', 'b'.repeat(2621441));
|
|
} catch (e) {
|
|
assert_equals(e.name, 'DataError');
|
|
return;
|
|
}
|
|
assert_unreached("did not reject");
|
|
}, 'sharedStorage.set with value length too big');
|
|
|
|
promise_test(() => {
|
|
return sharedStorage.set('a'.repeat(2621440), '').then(() => {
|
|
// Clean up.
|
|
sharedStorage.delete('a'.repeat(2621440));
|
|
});
|
|
}, 'sharedStorage.set with max allowed key length');
|
|
|
|
promise_test(() => {
|
|
return sharedStorage.set('a', 'b'.repeat(2621439)).then(() => {
|
|
// Clean up.
|
|
sharedStorage.delete('a');
|
|
});
|
|
}, 'sharedStorage.set with max allowed value length');
|
|
|
|
</script>
|
|
</body>
|