Revision 1d8cf99335f45dadb6d8e42d782d51a823045176 authored by Chris Rebert on 12 April 2016, 07:20:12 UTC, committed by Chris Rebert on 12 April 2016, 07:28:17 UTC
* Add `readonly` attribute test
* Test temporal <input>s with range limitations
* Test that <input type="range"> never matches
* Test that <input> types which cannot have range limitations and/or are barred from constraint validation never match
1 parent 8a4c5a9
Raw File
storage_clear.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>WebStorage Test: Storage - clear()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
["localStorage", "sessionStorage"].forEach(function(name) {
    test(function() {
        var storage = window[name];
        storage.clear();

        storage.setItem("name", "user1");
        assert_equals(storage.getItem("name"), "user1");
        assert_equals(storage.name, "user1");
        assert_equals(storage.length, 1);

        storage.clear();
        assert_equals(storage.getItem("name"), null, "storage.getItem('name')");
        assert_equals(storage.name, undefined, "storage.name");
        assert_equals(storage.length, 0, "storage.length");
    }, "Clear in " + name);
});
</script>
back to top