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.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/LayoutTests/storage/indexeddb/resources/shared.js b/LayoutTests/storage/indexeddb/resources/shared.js
index e510be1..112bf18 100644
--- a/LayoutTests/storage/indexeddb/resources/shared.js
+++ b/LayoutTests/storage/indexeddb/resources/shared.js
@@ -35,6 +35,12 @@ function verifySuccessEvent(event)
verifyEventCommon(event);
}
+function verifyAbortEvent(event)
+{
+ debug("Abort event fired:");
+ shouldBeEqualToString("event.type", "abort");
+}
+
function verifyResult(result)
{
shouldBeTrue("'onsuccess' in result");
@@ -45,6 +51,14 @@ function verifyResult(result)
debug("");
}
+function unexpectedSuccessCallback()
+{
+ testFailed("Success function called unexpectedly.");
+ debug("");
+ verifySuccessEvent(event);
+ done();
+}
+
function unexpectedErrorCallback()
{
testFailed("Error function called unexpectedly: (" + event.code + ") " + event.message);
@@ -53,3 +67,9 @@ function unexpectedErrorCallback()
done();
}
+function deleteAllObjectStores(db)
+{
+ objectStores = db.objectStores;
+ for (var i = 0; i < objectStores.length; ++i)
+ db.removeObjectStore(objectStores[i]);
+}