From bc882c587f62a25f24d1a4ffa739bd505c09ce8d Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 30 Jul 2024 19:50:06 +0200 Subject: env, dom: add History stub, basic LocalStorage * History: doesn't really do anything, just adding it to fix some pages * LocalStorage: kind of works, but does lookups with linear search, and the quota limitation is on the number of entries not their size. plus it doesn't actually store anything on disk yet (like cookies). --- test/js/window.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/js/window.html') diff --git a/test/js/window.html b/test/js/window.html index 5aef5186..07b76145 100644 --- a/test/js/window.html +++ b/test/js/window.html @@ -7,5 +7,13 @@ assert_equals(window.toString(), "[object Window]"); const desc = Object.getOwnPropertyDescriptor(window, "window"); assert(desc.enumerable, "window must be enumerable"); assert(!desc.configurable, "window must not be configurable"); +assert_equals(window.history.state, null); +window.localStorage.setItem("a", "x"); +window.localStorage["b"] = "y"; +assert_equals(window.localStorage["b"], "y") +delete window.localStorage.b; +assert_equals(window.localStorage["b"], undefined); +window.localStorage["b"] = "y"; +assert(window.sessionStorage instanceof Storage); document.getElementById("x").textContent = "Success"; -- cgit 1.4.1-2-gfad0