summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webstorage/resources/storage_local_window_open_second.html
blob: 3c8405adcf0575a6cf9dea6038a5c12d95120332 (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
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE HTML>
<html>
<head>
<title>WebStorage Test: localStorage - second page</title>
</head>
<body>
<script>

var storage = window.localStorage;

var assertions = [];

assertions.push({
    actual: storage.getItem("FOO"),
    expected: "BAR",
    message: "storage.getItem('FOO')"
});

storage.setItem("FOO", "BAR-NEWWINDOW");

assertions.push({
    actual: storage.getItem("FOO"),
    expected: "BAR-NEWWINDOW",
    message: "value for FOO after changing"
});
assertions.push({
    actual: window.opener.localStorage.getItem("FOO"),
    expected: "BAR-NEWWINDOW",
    message: "value for FOO in my opening window"
});

window.opener.postMessage(assertions, '*');

</script>
</body>
</html>