| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../fast/js/resources/js-test-pre.js"></script> | |
| 4 <script> | |
| 5 if (window.testRunner) { | |
| 6 testRunner.dumpAsText(); | |
| 7 testRunner.waitUntilDone(); | |
| 8 } | |
| 9 | |
| 10 function loadNextPage() | |
| 11 { | |
| 12 location.href = "../../resources/storage-close-idle-localstorage-databases-i
mmediately.html"; | |
| 13 } | |
| 14 | |
| 15 function runTest() | |
| 16 { | |
| 17 if (window.testRunner) { | |
| 18 testRunner.setCacheModel(0); // WebCacheModelDocumentViewer. | |
| 19 } | |
| 20 | |
| 21 // Test to make sure the storage values don't change after the database is c
losed. | |
| 22 if ("localStorage" in window) { | |
| 23 var loadCount = window.sessionStorage['testPageLoadCount']; | |
| 24 if (loadCount !== undefined) | |
| 25 loadCount++; | |
| 26 else | |
| 27 loadCount = 1; | |
| 28 | |
| 29 window.sessionStorage['testPageLoadCount'] = loadCount; | |
| 30 | |
| 31 if (loadCount == 1) { | |
| 32 window.localStorage.clear(); | |
| 33 window.localStorage['foo'] = 'FOO'; | |
| 34 window.localStorage['bar'] = 'BAR'; | |
| 35 | |
| 36 setTimeout("loadNextPage()", 0); | |
| 37 } else { | |
| 38 // Test if we still have the right values. | |
| 39 if (window.localStorage['foo'] === 'FOO') | |
| 40 testPassed("foo"); | |
| 41 else | |
| 42 testFailed("foo"); | |
| 43 | |
| 44 if (window.localStorage['bar'] === 'BAR') | |
| 45 testPassed("bar"); | |
| 46 else | |
| 47 testFailed("bar"); | |
| 48 | |
| 49 window.sessionStorage.removeItem('testPageLoadCount'); | |
| 50 | |
| 51 if (window.testRunner) { | |
| 52 window.testRunner.notifyDone(); | |
| 53 } | |
| 54 } | |
| 55 } | |
| 56 } | |
| 57 | |
| 58 </script> | |
| 59 </head> | |
| 60 <body onload="runTest();"> | |
| 61 <p id="description"></p> | |
| 62 <div id="console"></div> | |
| 63 </body> | |
| 64 </html> | |
| 65 | |
| OLD | NEW |