summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/localstorage/resources/window-open-second.html
blob: f944d71919b1fd07f481af1086d8c4e54154288d (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
<html>
<head>
<script>

var secondWindowLog = "Logging from second window:<br>";

function log(a)
{
    secondWindowLog += a + "<br>";
}

function runTest()
{
    if (!window.localStorage) {
        log("window.localStorage DOES NOT exist");
        return;
    }
    
    log("Value for FOO is " + window.localStorage.getItem("FOO"));
    window.localStorage.setItem("FOO", "BAR-NEWWINDOW");
    log("Value for FOO after changing my own copy is " + window.localStorage.getItem("FOO"));
    
    log("Value for FOO in my opening window is " + window.opener.localStorage.getItem("FOO"));
    
    window.opener.log(secondWindowLog);
    
    if (window.layoutTestController)
        layoutTestController.notifyDone();
}

</script>
</head>
<body onload="runTest();">
This is a new window to make sure the localStorage object for an origin is shared between multiple windows.<br>
</body>
</html>