mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb/HTML: Enforce quota limit for local and session storage
Fixes a timeout/crash for the two commited WPT tests.
This commit is contained in:
parent
e767029e24
commit
f3ecd23a21
Notes:
github-actions[bot]
2025-01-02 10:39:50 +00:00
Author: https://github.com/shannonbooth
Commit: f3ecd23a21
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3070
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/konradekk
7 changed files with 74 additions and 8 deletions
|
@ -0,0 +1,22 @@
|
|||
<script src="../../include.js"></script>
|
||||
<script>
|
||||
// FIXME: This should be an import of WPT from webstorage/storage_local_setitem_quotaexceedederr.window.html
|
||||
test(() => {
|
||||
localStorage.clear();
|
||||
|
||||
var index = 0;
|
||||
var key = "name";
|
||||
var val = "x".repeat(1024);
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
index++;
|
||||
localStorage.setItem("" + key + index, "" + val + index);
|
||||
}
|
||||
} catch (e) {
|
||||
println(e);
|
||||
}
|
||||
|
||||
localStorage.clear();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
<script src="../../include.js"></script>
|
||||
<script>
|
||||
// FIXME: This should be an import of WPT from webstorage/storage_session_setitem_quotaexceedederr.window.html
|
||||
test(() => {
|
||||
sessionStorage.clear();
|
||||
|
||||
var index = 0;
|
||||
var key = "name";
|
||||
var val = "x".repeat(1024);
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
index++;
|
||||
sessionStorage.setItem("" + key + index, "" + val + index);
|
||||
}
|
||||
} catch (e) {
|
||||
println(e);
|
||||
}
|
||||
|
||||
sessionStorage.clear();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue