summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/indexeddb/resources/shared.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/indexeddb/resources/shared.js')
-rw-r--r--LayoutTests/storage/indexeddb/resources/shared.js33
1 files changed, 29 insertions, 4 deletions
diff --git a/LayoutTests/storage/indexeddb/resources/shared.js b/LayoutTests/storage/indexeddb/resources/shared.js
index 65da3bf..01ec606 100644
--- a/LayoutTests/storage/indexeddb/resources/shared.js
+++ b/LayoutTests/storage/indexeddb/resources/shared.js
@@ -40,6 +40,12 @@ function verifyAbortEvent(event)
shouldBeEqualToString("event.type", "abort");
}
+function verifyCompleteEvent(event)
+{
+ debug("Complete event fired:");
+ shouldBeEqualToString("event.type", "complete");
+}
+
function verifyResult(result)
{
shouldBeTrue("'onsuccess' in result");
@@ -65,9 +71,28 @@ function unexpectedErrorCallback()
done();
}
-function deleteAllObjectStores(db)
+function unexpectedAbortCallback()
+{
+ testFailed("Abort function called unexpectedly!");
+ debug("");
+ verifyAbortEvent(event);
+ done();
+}
+
+function unexpectedCompleteCallback()
{
- objectStores = db.objectStores;
- for (var i = 0; i < objectStores.length; ++i)
- db.removeObjectStore(objectStores[i]);
+ testFailed("oncomplete function called unexpectedly!");
+ debug("");
+ verifyCompleteEvent(event);
+ done();
+}
+
+// FIXME: remove the onfinished parameter.
+function deleteAllObjectStores(db, onfinished)
+{
+ while (db.objectStores.length)
+ db.removeObjectStore(db.objectStores.item(0));
+
+ debug("Deleted all object stores.");
+ onfinished();
}