about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-30 19:50:06 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-30 21:49:32 +0200
commitbc882c587f62a25f24d1a4ffa739bd505c09ce8d (patch)
tree4bb1880ae5e56f47018400bd6b5b37fa427042dc /test
parentafec3aabd21d418603a8566393750e789ee6007a (diff)
downloadchawan-bc882c587f62a25f24d1a4ffa739bd505c09ce8d.tar.gz
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).
Diffstat (limited to 'test')
-rw-r--r--test/js/window.html8
1 files changed, 8 insertions, 0 deletions
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";
 </script>