IndexedDB: revert int version when version change transaction aborts
authordgrogan@chromium.org <dgrogan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Aug 2012 23:23:43 +0000 (23:23 +0000)
committerdgrogan@chromium.org <dgrogan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Aug 2012 23:23:43 +0000 (23:23 +0000)
commitafd976337d2533796323c40ec9c3a995b735229b
tree53f61902a910794b936ca709c4c0fc00714f664d
parent442395b7b1551e633a48fbba01ba2c7eca45403f
IndexedDB: revert int version when version change transaction aborts
https://bugs.webkit.org/show_bug.cgi?id=94662

Reviewed by Tony Chang.

Source/WebCore:

Test: storage/indexeddb/intversion-revert-on-abort.html

* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
(WebCore::IDBDatabaseBackendImpl::resetIntVersion):
One-liner modeled after resetVersion.

(WebCore):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):

LayoutTests:

This is tested in some other layout tests but it should have its own,
so add intversion-revert-on-abort.html.

* storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt:
FAIL event.target.result.version should be 0 will be resolved at least
when we figure out if we can make the default version an integer
during the transition period.

* storage/indexeddb/intversion-revert-on-abort-expected.txt: Added.
* storage/indexeddb/intversion-revert-on-abort.html: Added.
* storage/indexeddb/resources/intversion-revert-on-abort.js: Added.
(test):
(deleteSuccess):
(firstUpgradeNeededCallback):
(openSuccess):
(secondUpgradeNeededCallback):
(errorAfterAbortCallback):
(finalSuccessCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt
LayoutTests/storage/indexeddb/intversion-revert-on-abort-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/intversion-revert-on-abort.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/resources/intversion-revert-on-abort.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h