| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>WebStorage Test: sessionStorage event - url</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_session_url</h1> |
| 18 <div id="log"></div> |
| 19 <script> |
| 20 var t = async_test("url property test of session event"); |
| 21 |
| 22 test(function() { |
| 23 sessionStorage.clear(); |
| 24 function onStorageEvent(event) { |
| 25 t.step(function() { |
| 26 var url = window.location.href; |
| 27 |
| 28 var pos = url.lastIndexOf("/"); |
| 29 if (pos != -1) { |
| 30 url = url.substr(0, pos + 1); |
| 31 url = url + "resources/session_set_item_iframe.html"; |
| 32 } |
| 33 |
| 34 assert_equals(event.url, url); |
| 35 }); |
| 36 t.done(); |
| 37 } |
| 38 |
| 39 window.addEventListener('storage', onStorageEvent, false); |
| 40 |
| 41 var el = document.createElement("iframe"); |
| 42 el.setAttribute('id', 'ifrm'); |
| 43 el.setAttribute('src', 'resources/session_set_item_iframe.html'); |
| 44 document.body.appendChild(el); |
| 45 }, "Session event is fired due to an invocation of the setItem() method.
"); |
| 46 </script> |
| 47 </body> |
| 48 </html> |
| OLD | NEW |