blob: 4952a81c445d712bc435800275937c217258ea5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>localStorage cookies settings test</title>
</head>
<body>
<script type="text/javascript">
function ok(what, msg) {
parent.postMessage({ type: "ok", what: !!what, msg }, "*");
}
function is(a, b, msg) {
ok(a === b, msg);
}
try {
localStorage.setItem("contentkey", "test-value");
ok(false, "Setting localStorageItem should throw a security exception");
} catch(ex) {
is(ex.name, "SecurityError", "Got security exception");
}
parent.postMessage({ type: "finish" }, "*");
</script>
</body>
</html>
|