| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>WebStorage Test: localStorage event - key</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_key</h1> |
| 18 <div id="log"></div> |
| 19 <script> |
| 20 var t = async_test("key property test of local event"); |
| 21 |
| 22 test(function() { |
| 23 localStorage.clear(); |
| 24 var expected = ['name', null] |
| 25 function onStorageEvent(event) { |
| 26 t.step(function() { |
| 27 assert_equals(event.key, expected.shift()); |
| 28 }); |
| 29 if (!expected.length) { |
| 30 t.done(); |
| 31 } |
| 32 } |
| 33 |
| 34 window.addEventListener('storage', onStorageEvent, false); |
| 35 |
| 36 var el = document.createElement("iframe"); |
| 37 el.setAttribute('id', 'ifrm'); |
| 38 el.setAttribute('src', 'resources/local_set_item_clear_iframe.html')
; |
| 39 document.body.appendChild(el); |
| 40 }, "Local event is fired due to an invocation of the setItem(), clear()
methods."); |
| 41 </script> |
| 42 </body> |
| 43 </html> |
| OLD | NEW |