summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js')
-rw-r--r--LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js b/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js
new file mode 100644
index 0000000..418d000
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js
@@ -0,0 +1,12 @@
+function clearLocalStorage()
+{
+ var keys = new Array();
+ for (key in localStorage)
+ keys.push(key);
+
+ for (key in keys)
+ localStorage.removeItem(keys[key]);
+}
+
+if (window.localStorage)
+ clearLocalStorage();