about summary refs log tree commit diff stats
path: root/test/js/window.html
blob: 07b76145ee872d6194a22b461026a56aac6ef366 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!doctype html>
<title>Window test</title>
<div id=x>Fail</div>
<script src=asserts.js></script>
<script>
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>