diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-02 14:33:20 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-02 14:33:20 +0100 |
commit | 43ddb9b8c08ac148a9b03f16f45ec2cb71243f81 (patch) | |
tree | 263aac81d8f55dab14e4f51cc8b09add3b950287 /devtools/client/storage/test/storage-indexeddb-duplicate-names.html | |
parent | 390894c822f1b163f16744646372a28c0d93a89e (diff) | |
download | UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar.gz UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar.lz UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar.xz UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.zip |
Bug 1276339: Storage inspector doesn't work on chrome:// pages and web extensions
Issue #31
Diffstat (limited to 'devtools/client/storage/test/storage-indexeddb-duplicate-names.html')
-rw-r--r-- | devtools/client/storage/test/storage-indexeddb-duplicate-names.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/devtools/client/storage/test/storage-indexeddb-duplicate-names.html b/devtools/client/storage/test/storage-indexeddb-duplicate-names.html new file mode 100644 index 000000000..d8c76dc2a --- /dev/null +++ b/devtools/client/storage/test/storage-indexeddb-duplicate-names.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html><head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> + <meta charset="utf-8"> + <title>Storage inspector IndexedDBs with duplicate names</title> + + <script type="application/javascript;version=1.7"> + "use strict"; + + function createIndexedDBs() { + createIndexedDB("idb1", "temporary"); + createIndexedDB("idb1", "default"); + createIndexedDB("idb1", "persistent"); + createIndexedDB("idb2", "temporary"); + createIndexedDB("idb2", "default"); + createIndexedDB("idb2", "persistent"); + } + + function createIndexedDB(name, storage) { + let open = indexedDB.open(name, {storage: storage}); + + open.onsuccess = function () { + let db = open.result; + db.close(); + }; + } + + function deleteDB(dbName, storage) { + return new Promise(resolve => { + dump(`removing database ${dbName} (${storage}) from ${document.location}\n`); + indexedDB.deleteDatabase(dbName, { storage: storage }).onsuccess = resolve; + }); + } + + window.clear = function* () { + yield deleteDB("idb1", "temporary"); + yield deleteDB("idb1", "default"); + yield deleteDB("idb1", "persistent"); + yield deleteDB("idb2", "temporary"); + yield deleteDB("idb2", "default"); + yield deleteDB("idb2", "persistent"); + + dump(`removed indexedDB data from ${document.location}\n`); + }; + </script> +</head> +<body onload="createIndexedDBs()"> + <h1>storage-indexeddb-duplicate-names.html</h1> +</body> +</html> |