Merge into m-c

This commit is contained in:
Ben Turner 2010-10-19 18:23:36 -07:00
commit f89061853a
2 changed files with 8 additions and 6 deletions

View File

@ -148,8 +148,6 @@ IDBTransaction::OnRequestFinished()
if (!mAborted) {
NS_ASSERTION(mReadyState == nsIIDBTransaction::LOADING, "Bad state!");
}
mReadyState = nsIIDBTransaction::DONE;
CommitOrRollback();
}
}
@ -158,7 +156,10 @@ nsresult
IDBTransaction::CommitOrRollback()
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(mReadyState == nsIIDBTransaction::DONE, "Bad readyState!");
if (!mAborted) {
NS_ASSERTION(mReadyState == nsIIDBTransaction::LOADING, "Bad state!");
}
TransactionThreadPool* pool = TransactionThreadPool::GetOrCreate();
NS_ENSURE_STATE(pool);
@ -745,6 +746,8 @@ CommitHelper::Run()
if (NS_IsMainThread()) {
NS_ASSERTION(mDoomedObjects.IsEmpty(), "Didn't release doomed objects!");
mTransaction->mReadyState = nsIIDBTransaction::DONE;
nsCOMPtr<nsIDOMEvent> event;
if (mAborted) {
if (mHaveMetadata) {

View File

@ -59,15 +59,14 @@
is(objectStore.keyPath, "", "Correct keyPath");
is(objectStore.indexNames.length, 0, "Correct indexNames");
SimpleTest.executeSoon(function() { testGenerator.next(); });
yield;
transaction.oncomplete = grabEventAndContinueHandler;
event = yield;
is(transaction.db, db, "Correct database");
is(transaction.readyState, DONE, "Correct readyState");
is(transaction.mode, VERSION_CHANGE, "Correct mode");
is(transaction.objectStoreNames.length, 1, "Correct names length");
is(transaction.objectStoreNames.item(0), "foo", "Correct name");
is(transaction.oncomplete, null, "No complete listener");
is(transaction.onabort, null, "No abort listener");
is(transaction.ontimeout, null, "No timeout listener");