Bug 613372 - 'IndexedDB: Success event for setVersion request has wrong result'. r=sicking, a=blocking.

This commit is contained in:
Ben Turner 2010-12-15 13:20:59 -08:00
parent f1386fb91c
commit b17dc24412
2 changed files with 6 additions and 6 deletions

View File

@ -885,7 +885,7 @@ SetVersionHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
}
nsresult
SetVersionHelper::GetSuccessResult(nsIWritableVariant* /* aResult */)
SetVersionHelper::GetSuccessResult(nsIWritableVariant* aResult)
{
DatabaseInfo* info;
if (!DatabaseInfo::Get(mDatabase->Id(), &info)) {
@ -894,6 +894,7 @@ SetVersionHelper::GetSuccessResult(nsIWritableVariant* /* aResult */)
}
info->version = mVersion;
aResult->SetAsISupports(static_cast<nsPIDOMEventTarget*>(mTransaction));
return NS_OK;
}

View File

@ -13,9 +13,6 @@
<script type="text/javascript;version=1.7">
function testSteps()
{
const VERSION_CHANGE =
Components.interfaces.nsIIDBTransaction.VERSION_CHANGE;
const name = window.location.pathname;
const description = "My Test Database";
@ -63,7 +60,8 @@
};
event = yield;
is(event.transaction.mode, VERSION_CHANGE, "Correct mode");
ok(event.result === event.transaction, "Good result");
is(event.transaction.mode, IDBTransaction.VERSION_CHANGE, "Correct mode");
request = moz_indexedDB.open(name, description);
request.onerror = errorHandler;
@ -85,7 +83,8 @@
};
event = yield;
is(event.transaction.mode, VERSION_CHANGE, "Correct mode");
ok(event.result === event.transaction, "Good result");
is(event.transaction.mode, IDBTransaction.VERSION_CHANGE, "Correct mode");
is(versionChangeEventCount, 3, "Saw all expected events");