summaryrefslogtreecommitdiffstats
path: root/devtools/client/storage/test/storage-overflow-indexeddb.html
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/storage/test/storage-overflow-indexeddb.html')
-rw-r--r--devtools/client/storage/test/storage-overflow-indexeddb.html49
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>