Home | History | Annotate | Download | only in localstorage
      1 <html>
      2 <head>
      3 <script src="resources/clearLocalStorage.js"></script>
      4 <script>
      5 
      6 if (window.layoutTestController) {
      7     layoutTestController.dumpAsText();
      8     layoutTestController.setCanOpenWindows();
      9     layoutTestController.waitUntilDone();
     10 }
     11 
     12 function log(a)
     13 {
     14     document.getElementById("logger").innerHTML += a + "<br>";
     15 }
     16 
     17 function runTest()
     18 {
     19     if (!window.localStorage) {
     20         log("window.localStorage DOES NOT exist");
     21         return;
     22     }
     23     
     24     window.log = log;
     25     
     26     window.localStorage.setItem("FOO", "BAR");
     27     log("Value for FOO is " + window.localStorage.getItem("FOO"));    
     28     window.open("resources/window-open-second.html");
     29     
     30 
     31 }
     32 
     33 </script>
     34 </head>
     35 <body onload="runTest();">
     36 This is a test to make sure the localStorage object for multiple windows in the same security origin share the same global storage area.<br>
     37 <div id="logger"></div>
     38 </body>
     39 </html>
     40