diff options
author | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 18:25:43 +0000 |
---|---|---|
committer | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 18:25:43 +0000 |
commit | 5377d8975b54512451ab05d4cf3248f8ed8a32c4 (patch) | |
tree | 77722aae9a5ea960c773a4631222d75d6acd1a5c /chrome/test | |
parent | 4031e5d9a92a19a978cef4f3c287e58ab95019cc (diff) | |
download | chromium_src-5377d8975b54512451ab05d4cf3248f8ed8a32c4.zip chromium_src-5377d8975b54512451ab05d4cf3248f8ed8a32c4.tar.gz chromium_src-5377d8975b54512451ab05d4cf3248f8ed8a32c4.tar.bz2 |
Fix IndexedDB race condition during shutdown.
Make sure IndexedDBContext is deleted before returning from
~WebKitContext. Otherwise, UtilityProcessHost may still be in batch mode
when the IO thread is shut down.
BUG=67422
TEST=browser_tests --gtest_filter=IndexedDBBrowserTest.*
Review URL: http://codereview.chromium.org/6209005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/data/indexeddb/object_store_test.js | 5 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/transaction_run_forever.js | 4 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/transaction_test.js | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/chrome/test/data/indexeddb/object_store_test.js b/chrome/test/data/indexeddb/object_store_test.js index 7376658..1f6405f 100644 --- a/chrome/test/data/indexeddb/object_store_test.js +++ b/chrome/test/data/indexeddb/object_store_test.js @@ -15,6 +15,7 @@ function getByDateSuccess() function recordNotFound() { debug('Removed data can no longer be found'); + shouldBe("event.result", "undefined"); debug('Retrieving an index'); shouldBe("objectStore.index('fname_index').name", "'fname_index'"); @@ -36,8 +37,8 @@ function removeSuccess() debug('Data removed'); var result = objectStore.get(1); - result.onsuccess = unexpectedSuccessCallback; - result.onerror = recordNotFound; + result.onsuccess = recordNotFound; + result.onerror = unexpectedSuccessCallback; } function getSuccess() diff --git a/chrome/test/data/indexeddb/transaction_run_forever.js b/chrome/test/data/indexeddb/transaction_run_forever.js index 417323f..311210f 100644 --- a/chrome/test/data/indexeddb/transaction_run_forever.js +++ b/chrome/test/data/indexeddb/transaction_run_forever.js @@ -22,7 +22,7 @@ function newTransactionComplete() { debug('The transaction completed.'); - var finalTransaction = db.transaction([], IDBTransaction.READ_ONLY, 0); + var finalTransaction = db.transaction({objectStoreNames: [], mode: IDBTransaction.READ_ONLY}); finalTransaction.oncomplete = unexpectedCompleteCallback; finalTransaction.onabort = unexpectedErrorCallback; @@ -34,7 +34,7 @@ function newTransactionComplete() function onSetVersionComplete() { debug('Creating new transaction.'); - var newTransaction = db.transaction([], IDBTransaction.READ_WRITE, 0); + var newTransaction = db.transaction({objectStoreNames: [], mode: IDBTransaction.READ_WRITE}); newTransaction.oncomplete = newTransactionComplete; newTransaction.onabort = unexpectedAbortCallback; diff --git a/chrome/test/data/indexeddb/transaction_test.js b/chrome/test/data/indexeddb/transaction_test.js index 0b82e01..23e560e 100644 --- a/chrome/test/data/indexeddb/transaction_test.js +++ b/chrome/test/data/indexeddb/transaction_test.js @@ -13,22 +13,23 @@ function finalTransactionAborted() fail('The final transaction should not abort.'); } -function emplyeeNotFound() +function employeeNotFound() { debug('Employee not found.'); + shouldBe("event.result", "undefined"); } function newTransactionAborted() { debug('The transaction was aborted.'); - var finalTransaction = db.transaction([], IDBTransaction.READ_ONLY, 0); + var finalTransaction = db.transaction({objectStoreNames: [], mode: IDBTransaction.READ_ONLY}); finalTransaction.oncomplete = finalTransactionCompleted; finalTransaction.onabort = finalTransactionAborted; var request = finalTransaction.objectStore('employees').get(0); - request.onsuccess = unexpectedSuccessCallback; - request.onerror = emplyeeNotFound; + request.onsuccess = employeeNotFound; + request.onerror = unexpectedErrorCallback; } function newTransactionCompleted() @@ -44,7 +45,7 @@ function employeeAdded() function onSetVersionComplete() { debug('Creating new transaction.'); - var newTransaction = db.transaction([], IDBTransaction.READ_WRITE, 0); + var newTransaction = db.transaction({objectStoreNames: [], mode: IDBTransaction.READ_WRITE}); newTransaction.oncomplete = newTransactionCompleted; newTransaction.onabort = newTransactionAborted; |