Bug 664029 - 'Make indexeddb mochitests run in fennec'. r=khuey.

This commit is contained in:
Ben Turner 2012-06-11 14:59:27 -07:00
parent 4dc67ea4f8
commit 160db69b19
3 changed files with 30 additions and 0 deletions

View File

@ -1755,5 +1755,24 @@ IndexedDatabaseManager::AsyncDeleteFileRunnable::Run()
return NS_ERROR_FAILURE;
}
// sqlite3_quota_remove won't actually remove anything if we're not tracking
// the quota here. Manually remove the file if it exists.
nsresult rv;
nsCOMPtr<nsIFile> file =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = file->InitWithPath(mFilePath);
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
rv = file->Exists(&exists);
NS_ENSURE_SUCCESS(rv, rv);
if (exists) {
rv = file->Remove(false);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
}

View File

@ -2373,6 +2373,16 @@ DeleteDatabaseHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
NS_WARNING("Failed to delete db file!");
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
// sqlite3_quota_remove won't actually remove anything if we're not tracking
// the quota here. Manually remove the file if it exists.
rv = dbFile->Exists(&exists);
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
if (exists) {
rv = dbFile->Remove(false);
NS_ENSURE_SUCCESS(rv, rv);
}
}
nsCOMPtr<nsIFile> fileManagerDirectory;

View File

@ -4,6 +4,7 @@
"content/xml/document/test": "",
"content/xslt/tests/mochitest": "",
"dom/file/test": "",
"dom/indexedDB/test": "",
"dom/src/json/test": "",
"dom/src/jsurl/test": "",
"dom/tests/mochitest/dom-level0": "", "js": "",