Skip to content
This repository
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (23 sloc) 0.733 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<!DOCTYPE HTML>
<html>
 <head>
  <title>Web Storage</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
    <h1>storage_local_clear</h1>
    <div id="log"></div>
    <script>
        test(function() {
            localStorage.clear();
            localStorage.setItem("name", "user1");

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

            localStorage.clear();
            assert_equals(localStorage.getItem("name"), null, "localStorage.getItem('name')")
            assert_equals(localStorage.length, 0, "localStorage.length")
        });
    </script>
 </body>
</html>
Something went wrong with that request. Please try again.