Revision a5262d7aa60e518705b129f24b96494aea6428d4 authored by Manuel Rego Casasnovas on 16 March 2018, 08:32:50 UTC, committed by GitHub on 16 March 2018, 08:32:50 UTC
[css-grid] Fix relative path to grid.css file
2 parent s 359dac1 + 6ed279b
Raw File
storage_length.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>WebStorage Test: Storage - length</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();
        assert_equals(storage.length, 0, "storage.length")

        storage["name"] = "user1";
        storage["age"] = "20";

        assert_equals(storage.length, 2, "storage.length")
    }, name + ".length (method access)");

    test(function() {
        var storage = window[name];
        storage.clear();
        assert_equals(storage.length, 0, "storage.length")

        storage.setItem("name", "user1");
        storage.setItem("age", "20");

        assert_equals(storage.length, 2, "storage.length")
    }, name + ".length (proprty access)");
});
</script>
back to top