| OLD | NEW |
| 1 description("Verify that storage events fire even when only the case of the valu
e changes."); | 1 description("Verify that storage events fire even when only the case of the valu
e changes."); |
| 2 | 2 |
| 3 function test(storageString, callback) | 3 function test(storageString, callback) |
| 4 { | 4 { |
| 5 window.completionCallback = callback; | 5 window.completionCallback = callback; |
| 6 window.storage = eval(storageString); | 6 window.storage = eval(storageString); |
| 7 if (!storage) { | 7 if (!storage) { |
| 8 testFailed(storageString + " DOES NOT exist"); | 8 testFailed(storageString + " DOES NOT exist"); |
| 9 return; | 9 return; |
| 10 } | 10 } |
| 11 | 11 |
| 12 debug("Testing " + storageString); | 12 debug("Testing " + storageString); |
| 13 | 13 |
| 14 storageEventList = new Array(); | 14 storageEventList = new Array(); |
| 15 evalAndLog("storage.clear()"); | 15 evalAndLog("storage.clear()"); |
| 16 shouldBe("storage.length", "0"); | 16 shouldBe("storage.length", "0"); |
| 17 | 17 |
| 18 iframe.onload = onload; |
| 19 iframe.src = "about:blank"; |
| 20 } |
| 21 |
| 22 function onload() |
| 23 { |
| 24 iframe.contentWindow.onstorage = function (e) { |
| 25 window.parent.storageEventList.push(e); |
| 26 }; |
| 27 |
| 18 debug(""); | 28 debug(""); |
| 19 debug("Verify storage events are case sensitive"); | 29 debug("Verify storage events are case sensitive"); |
| 20 evalAndLog("storage.foo = 'test'"); | 30 evalAndLog("storage.foo = 'test'"); |
| 21 | 31 |
| 22 runAfterNStorageEvents(step1, 1); | 32 runAfterNStorageEvents(step1, 1); |
| 23 } | 33 } |
| 24 | 34 |
| 25 function step1() | 35 function step1() |
| 26 { | 36 { |
| 27 debug("Reset storage event list"); | 37 debug("Reset storage event list"); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 function step3() | 52 function step3() |
| 43 { | 53 { |
| 44 shouldBe("storageEventList.length", "1"); | 54 shouldBe("storageEventList.length", "1"); |
| 45 | 55 |
| 46 completionCallback(); | 56 completionCallback(); |
| 47 } | 57 } |
| 48 | 58 |
| 49 testStorages(test); | 59 testStorages(test); |
| 50 | 60 |
| 51 var successfullyParsed = true; | 61 var successfullyParsed = true; |
| OLD | NEW |