Revision 0c81c3f6f4d031c8b977d9c6cacf2f8ed8c936eb authored by Robert Ma on 15 March 2018, 21:39:41 UTC, committed by Michael[tm] Smith on 16 March 2018, 02:43:19 UTC
1 parent b73f249
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>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...