| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>WebStorage Test: localStorage event - storageArea</title> |
| 5 <script src="../../../resources/testharness.js"></script> |
| 6 <script src="../../../resources/testharnessreport.js"></script> |
| 7 <script> |
| 8 function fail(msg) { |
| 9 t.step(function() { |
| 10 assert_unreached(msg); |
| 11 }); |
| 12 t.done(); |
| 13 } |
| 14 </script> |
| 15 </head> |
| 16 <body> |
| 17 <h1>event_local_storageArea</h1> |
| 18 <div id="log"></div> |
| 19 <script> |
| 20 var t = async_test("storageArea property test of local event"); |
| 21 |
| 22 test(function() { |
| 23 localStorage.clear(); |
| 24 function onStorageEvent(event) { |
| 25 t.step(function() { |
| 26 assert_equals(event.storageArea.length, 1); |
| 27 var key = event.storageArea.key(0); |
| 28 var value = event.storageArea.getItem(key); |
| 29 assert_equals(key, "name"); |
| 30 assert_equals(value, "user1"); |
| 31 }); |
| 32 t.done(); |
| 33 } |
| 34 |
| 35 window.addEventListener('storage', onStorageEvent, false); |
| 36 |
| 37 var el = document.createElement("iframe"); |
| 38 el.setAttribute('id', 'ifrm'); |
| 39 el.setAttribute('src', 'resources/local_set_item_iframe.html'); |
| 40 document.body.appendChild(el); |
| 41 }, "Local event is fired due to an invocation of the setItem() method.")
; |
| 42 </script> |
| 43 </body> |
| 44 </html> |
| OLD | NEW |