dom/imported-tests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_clear.html
author Ms2ger <ms2ger@gmail.com>
Sat, 05 May 2012 11:00:04 +0200
changeset 93233 2352cf17e5d40195a3b6a8d176dded7de121bdd1
permissions -rw-r--r--
Bug 740357 - Import W3C WebStorage tests; r=mayhemer

<!DOCTYPE HTML>
<html>
 <head>
  <title>Web Storage</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
    <h1>storage_session_clear</h1>
    <div id="log"></div>
    <script>
        test(function() {
            sessionStorage.clear();
            sessionStorage.setItem("name", "user1");

            assert_not_equals(sessionStorage.getItem("name"), null);
            assert_equals(sessionStorage.length, 1);

            sessionStorage.clear();
            assert_equals(sessionStorage.getItem("name"), null, "sessionStorage.getItem('name')")
            assert_equals(sessionStorage.length, 0, "sessionStorage.length")
        });
    </script>
 </body>
</html>