https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 35cbc6de482945340efd33689360d04a29ead057 authored by Ms2ger on 21 July 2015, 11:28:51 UTC
Move the Samsung ProgressEvent tests into place.
Tip revision: 35cbc6d
event_local_oldvalue.html
<!DOCTYPE HTML>
<html>
 <head>
  <title>WebStorage Test: localStorage event - oldValue</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script>
      function fail(msg) {
          t.step(function() {
              assert_unreached(msg);
          });
          t.done();
      }
  </script>
 </head>
 <body>
    <h1>event_local_oldValue</h1>
    <div id="log"></div>
    <script>
        var t = async_test("oldValue property test of local event");

        test(function() {
            localStorage.clear();
            var expected = [null, 'user1', null]
            function onStorageEvent(event) {
                t.step(function() {
                    assert_equals(event.oldValue, expected.shift());
                });
                if (!expected.length) {
                    t.done();
                }
            }

            window.addEventListener('storage', onStorageEvent, false);

            var el = document.createElement("iframe");
            el.setAttribute('id', 'ifrm');
            el.setAttribute('src', 'resources/local_change_item_iframe.html');
            document.body.appendChild(el);
        }, "Local event is fired due to an invocation of the setItem(), clear() methods.");
    </script>
 </body>
</html>
back to top