1 <html> 2 <head> 3 <script src="resources/clearSessionStorage.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.sessionStorage) { 20 log("window.sessionStorage DOES NOT exist"); 21 return; 22 } 23 24 window.log = log; 25 26 window.sessionStorage.setItem("FOO", "BAR"); 27 log("Value for FOO is " + window.sessionStorage.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 new window to make sure there is a copy of the previous window's sessionStorage, and that they diverge after a change<br> 37 <div id="logger"></div> 38 </body> 39 </html> 40