summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/indexeddb/resources/shared.js
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-24 11:24:40 +0100
committerBen Murdoch <benm@google.com>2011-06-02 09:53:15 +0100
commit81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch)
tree7a9e5ed86ff429fd347a25153107221543909b19 /LayoutTests/storage/indexeddb/resources/shared.js
parent94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff)
downloadexternal_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'LayoutTests/storage/indexeddb/resources/shared.js')
-rw-r--r--LayoutTests/storage/indexeddb/resources/shared.js75
1 files changed, 8 insertions, 67 deletions
diff --git a/LayoutTests/storage/indexeddb/resources/shared.js b/LayoutTests/storage/indexeddb/resources/shared.js
index 8c56832..9b23cb8 100644
--- a/LayoutTests/storage/indexeddb/resources/shared.js
+++ b/LayoutTests/storage/indexeddb/resources/shared.js
@@ -5,86 +5,29 @@ function done()
layoutTestController.notifyDone()
}
-function verifyEventCommon(event)
-{
- shouldBeTrue("'source' in event");
- shouldBeTrue("event.source != null");
- shouldBeTrue("'onsuccess' in event.target");
- shouldBeTrue("'onerror' in event.target");
- shouldBeTrue("'readyState' in event.target");
- shouldBe("event.target.readyState", "event.target.DONE");
- debug("");
-}
-
-function verifyErrorEvent(event)
-{
- debug("Error event fired:");
- shouldBeFalse("'result' in event");
- shouldBeTrue("'code' in event");
- shouldBeTrue("'message' in event");
- verifyEventCommon(event);
-}
-
-function verifySuccessEvent(event)
-{
- debug("Success event fired:");
- shouldBeTrue("'result' in event");
- shouldBeFalse("'code' in event");
- shouldBeFalse("'message' in event");
- verifyEventCommon(event);
-}
-
-function verifyAbortEvent(event)
-{
- debug("Abort event fired:");
- shouldBeEqualToString("event.type", "abort");
-}
-
-function verifyCompleteEvent(event)
-{
- debug("Complete event fired:");
- shouldBeEqualToString("event.type", "complete");
-}
-
-function verifyResult(result)
-{
- shouldBeTrue("'onsuccess' in result");
- shouldBeTrue("'onerror' in result");
- shouldBeTrue("'readyState' in result");
- debug("An event should fire shortly...");
- debug("");
-}
-
function unexpectedSuccessCallback()
{
testFailed("Success function called unexpectedly.");
- debug("");
- verifySuccessEvent(event);
- done();
}
function unexpectedErrorCallback()
{
- testFailed("Error function called unexpectedly: (" + event.code + ") " + event.message);
- debug("");
- verifyErrorEvent(event);
- done();
+ testFailed("Error function called unexpectedly: (" + event.target.errorCode + ") " + event.target.webkitErrorMessage);
}
function unexpectedAbortCallback()
{
testFailed("Abort function called unexpectedly!");
- debug("");
- verifyAbortEvent(event);
- done();
}
function unexpectedCompleteCallback()
{
testFailed("oncomplete function called unexpectedly!");
- debug("");
- verifyCompleteEvent(event);
- done();
+}
+
+function unexpectedBlockedCallback()
+{
+ testFailed("onblocked called unexpectedly");
}
function evalAndExpectException(cmd, expected)
@@ -95,16 +38,14 @@ function evalAndExpectException(cmd, expected)
testFailed("No exception thrown! Should have been " + expected);
} catch (e) {
code = e.code;
+ testPassed("Exception was thrown.");
shouldBe("code", expected);
}
}
-// FIXME: remove the onfinished parameter.
-function deleteAllObjectStores(db, onfinished)
+function deleteAllObjectStores(db)
{
while (db.objectStoreNames.length)
db.deleteObjectStore(db.objectStoreNames.item(0));
-
debug("Deleted all object stores.");
- onfinished();
}