Files
ladybird/Tests/LibWeb/Text/input/HTML/local-storage-usage-after-nav.html
Tim Ledbetter 121783b45e Tests: Use unique local storage key in local storage test
This ensures it is not possible for tests to interfere with each other.
2026-01-15 09:39:00 +01:00

25 lines
678 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(done => {
const key = `foo_${crypto.randomUUID()}`;
window.onmessage = () => {
try {
println(localStorage.getItem(key));
localStorage.setItem(key, "bar");
println(localStorage.getItem(key));
localStorage.removeItem(key);
} catch (e) {
println(e);
}
done();
};
const frame = document.createElement("iframe");
frame.src = `../../data/local-storage-iframe.html?key=${key}`;
document.body.appendChild(frame);
});
</script>