summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webstorage/storage_supported_property_names.window.js
blob: 08c5d77afc2de733484d138b45048adaa46df5b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
["localStorage", "sessionStorage"].forEach(function(name) {
    test(function() {
        var storage = window[name];
        storage.clear();

        storage["name"] = "user1";
        assert_array_equals(Object.getOwnPropertyNames(storage), ['name']);
    }, "Object.getOwnPropertyNames on " + name + " Storage");

    test(function() {
        var storage = window[name];
        storage.clear();
        assert_array_equals(Object.getOwnPropertyNames(storage), []);
    }, "Object.getOwnPropertyNames on " + name + " storage with empty collection");
});