diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /devtools/client/storage/test/storage-overflow-indexeddb.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/storage/test/storage-overflow-indexeddb.html')
-rw-r--r-- | devtools/client/storage/test/storage-overflow-indexeddb.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/devtools/client/storage/test/storage-overflow-indexeddb.html b/devtools/client/storage/test/storage-overflow-indexeddb.html new file mode 100644 index 0000000000..68bc6522b0 --- /dev/null +++ b/devtools/client/storage/test/storage-overflow-indexeddb.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML> +<html> +<!-- +Bug 1171903 - Storage Inspector endless scrolling +--> +<head> + <meta charset="utf-8"> + <title>Storage inspector endless scrolling test</title> +</head> +<body> +<script type="text/javascript"> +"use strict"; + +window.setup = async function() { + await new Promise(resolve => { + const open = indexedDB.open("database", 1); + open.onupgradeneeded = function() { + const db = open.result; + const store = db.createObjectStore("store", {keyPath: "id"}); + store.transaction.oncomplete = () => { + const transaction = db.transaction(["store"], "readwrite"); + for (let i = 1; i < 150; i++) { + transaction.objectStore("store").add({id: i}); + } + + transaction.oncomplete = function() { + db.close(); + resolve(); + }; + }; + }; + }); +}; + +function deleteDB(dbName) { + return new Promise(resolve => { + indexedDB.deleteDatabase(dbName).onsuccess = resolve; + }); +} + +window.clear = async function() { + await deleteDB("database"); + + dump(`removed indexedDB data from ${document.location}\n`); +}; + +</script> +</body> +</html> |