haikuwebkit/LayoutTests/storage/indexeddb/intversion-omit-parameter-e...

20 lines
580 B
Plaintext
Raw Permalink Normal View History

IndexedDB: integer version layout tests https://bugs.webkit.org/show_bug.cgi?id=92560 Reviewed by Nate Chapin. Most of the integer version layout tests are here, with failures in the expected files. This will allow us to incrementally implement upgradeneeded and integer versions and just make the big patch in bug 89505 smaller. There are two added skips to TestExpectations, one test exposes a bug in the current implementation, causing an assert to fail. The other times out in DRT so we will run it as a content_browsertest for the time being. * platform/chromium/TestExpectations: * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html: Added. * storage/indexeddb/intversion-and-setversion-expected.txt: Added. * storage/indexeddb/intversion-and-setversion.html: Added. * storage/indexeddb/intversion-blocked-expected.txt: Added. * storage/indexeddb/intversion-blocked.html: Added. * storage/indexeddb/intversion-close-between-events-expected.txt: Added. * storage/indexeddb/intversion-close-between-events.html: Added. * storage/indexeddb/intversion-close-in-oncomplete-expected.txt: Added. * storage/indexeddb/intversion-close-in-oncomplete.html: Added. * storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-close-in-upgradeneeded.html: Added. * storage/indexeddb/intversion-delete-in-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-delete-in-upgradeneeded.html: Added. * storage/indexeddb/intversion-gated-on-delete-expected.txt: Added. * storage/indexeddb/intversion-gated-on-delete.html: Added. * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt: Added. * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects.html: Added. * storage/indexeddb/intversion-long-queue-expected.txt: Added. * storage/indexeddb/intversion-long-queue.html: Added. * storage/indexeddb/intversion-omit-parameter-expected.txt: Added. * storage/indexeddb/intversion-omit-parameter.html: Added. * storage/indexeddb/intversion-open-with-version-expected.txt: Added. * storage/indexeddb/intversion-open-with-version.html: Added. and their respective js files... * storage/indexeddb/resources/shared.js: (unexpectedVersionChangeCallback): (setDBNameFromPath): (preamble): Canonical link: https://commits.webkit.org/110754@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-01 23:27:13 +00:00
Test that initial version after a successful open of a non-existent db is 1
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
IndexedDB: fire upgradeneeded even without an explicit integer version https://bugs.webkit.org/show_bug.cgi?id=96444 Reviewed by Tony Chang. Source/WebCore: Also of note: - New databases now get a default version of 1 instead of the empty string when they are opened. - We now allow databases with an integer version to revert to a string version by calling setVersion. Implementation detail: we store both an integer version and string version for a particular database. If both are set we give preference to the integer version and assume the db is on the integer track. Test: storage/indexeddb/intversion-two-opens-no-versions.html * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore): (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl): (WebCore::IDBDatabaseBackendImpl::setVersion): (WebCore::IDBDatabaseBackendImpl::setVersionInternal): Now that this can be called even after an int version is set we have to make it revoke the int version. (WebCore::IDBDatabaseBackendImpl::openConnection): Nested ifs were getting deep, so refactor to return early instead. (WebCore::IDBDatabaseBackendImpl::deleteDatabase): (WebCore::IDBDatabaseBackendImpl::resetVersion): Now that an int version could have been set before setVersion was called we have to reset the int version on abort. * Modules/indexeddb/IDBDatabaseBackendImpl.h: (IDBDatabaseBackendImpl): * Modules/indexeddb/IDBLevelDBBackingStore.cpp: (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion): * Modules/indexeddb/IDBOpenDBRequest.cpp: 0 is now a valid integer version to store to leveldb if an idb database is reverting to a string version. (WebCore::IDBOpenDBRequest::onUpgradeNeeded): If the open request did not specify an integer version but upgradeneeded is called, it means the database was given the default version of 1. LayoutTests: Mostly updating expectations about getting an upgradeneeded on a new database and the default version being 1 instead of "". * http/tests/inspector/indexeddb/database-structure-expected.txt: * storage/indexeddb/cursor-overloads-expected.txt: * storage/indexeddb/cursor-overloads.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/factory-deletedatabase-interactions-expected.txt: * storage/indexeddb/intversion-and-setversion-expected.txt: Remove test that setVersion fires an error if an int version is set. Change it to testing that an int version can replace a string version that replaced an int version. * storage/indexeddb/intversion-bad-parameters-expected.txt: * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt: Removed. setVersion is no longer invalid so this test can be deleted. * storage/indexeddb/intversion-omit-parameter-expected.txt: We now fully pass this test. * storage/indexeddb/intversion-two-opens-no-versions-expected.txt: Added. * storage/indexeddb/intversion-two-opens-no-versions.html: Renamed from LayoutTests/storage/indexeddb/intversion-invalid-setversion-has-no-side-effects.html. * storage/indexeddb/list-ordering-expected.txt: * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/open-during-transaction-expected.txt: This test had a bug in it AND its behavior is changed. It was trying to open one database twice and another once but was actually opening three different databases. The behavior change is that now the transaction finishes while the last call to open is firing upgradeneeded. * storage/indexeddb/pending-activity-expected.txt: * storage/indexeddb/pending-activity-workers-expected.txt: * storage/indexeddb/resources/intversion-and-setversion.js: (deleteSuccess): (initialUpgradeNeeded): (openSuccess): (firstUpgradeNeeded): (transactionCompleted): (firstOpenWithVersion): (secondSetVersionCallback): (setIntVersion2): (versionChangeGoingFromStringToInt): (version2ConnectionBlocked): (version2ConnectionSuccess): (errorWhenTryingLowVersion): * storage/indexeddb/resources/intversion-invalid-setversion-has-no-side-effects.js: Removed. * storage/indexeddb/resources/intversion-two-opens-no-versions.js: Added. (test): (deleteSuccess): (connection1UpgradeNeeded): (connection1OpenSuccess): (connection2UpgradeNeeded): (connection2OpenSuccess): * storage/indexeddb/resources/list-ordering.js: * storage/indexeddb/resources/open-during-transaction.js: (startTransaction.trans.oncomplete): (startTransaction): (tryOpens.openreq3.onsuccess): (tryOpens): * storage/indexeddb/resources/pending-activity.js: * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: Canonical link: https://commits.webkit.org/115089@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-19 20:28:35 +00:00
PASS Got upgradeneeded event
IndexedDB: integer version layout tests https://bugs.webkit.org/show_bug.cgi?id=92560 Reviewed by Nate Chapin. Most of the integer version layout tests are here, with failures in the expected files. This will allow us to incrementally implement upgradeneeded and integer versions and just make the big patch in bug 89505 smaller. There are two added skips to TestExpectations, one test exposes a bug in the current implementation, causing an assert to fail. The other times out in DRT so we will run it as a content_browsertest for the time being. * platform/chromium/TestExpectations: * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html: Added. * storage/indexeddb/intversion-and-setversion-expected.txt: Added. * storage/indexeddb/intversion-and-setversion.html: Added. * storage/indexeddb/intversion-blocked-expected.txt: Added. * storage/indexeddb/intversion-blocked.html: Added. * storage/indexeddb/intversion-close-between-events-expected.txt: Added. * storage/indexeddb/intversion-close-between-events.html: Added. * storage/indexeddb/intversion-close-in-oncomplete-expected.txt: Added. * storage/indexeddb/intversion-close-in-oncomplete.html: Added. * storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-close-in-upgradeneeded.html: Added. * storage/indexeddb/intversion-delete-in-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-delete-in-upgradeneeded.html: Added. * storage/indexeddb/intversion-gated-on-delete-expected.txt: Added. * storage/indexeddb/intversion-gated-on-delete.html: Added. * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt: Added. * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects.html: Added. * storage/indexeddb/intversion-long-queue-expected.txt: Added. * storage/indexeddb/intversion-long-queue.html: Added. * storage/indexeddb/intversion-omit-parameter-expected.txt: Added. * storage/indexeddb/intversion-omit-parameter.html: Added. * storage/indexeddb/intversion-open-with-version-expected.txt: Added. * storage/indexeddb/intversion-open-with-version.html: Added. and their respective js files... * storage/indexeddb/resources/shared.js: (unexpectedVersionChangeCallback): (setDBNameFromPath): (preamble): Canonical link: https://commits.webkit.org/110754@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-01 23:27:13 +00:00
openSuccess():
db = event.target.result
Test line from IDBFactory.open: If no version is specified and no database exists, set database version to 1.
IndexedDB: fire upgradeneeded even without an explicit integer version https://bugs.webkit.org/show_bug.cgi?id=96444 Reviewed by Tony Chang. Source/WebCore: Also of note: - New databases now get a default version of 1 instead of the empty string when they are opened. - We now allow databases with an integer version to revert to a string version by calling setVersion. Implementation detail: we store both an integer version and string version for a particular database. If both are set we give preference to the integer version and assume the db is on the integer track. Test: storage/indexeddb/intversion-two-opens-no-versions.html * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore): (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl): (WebCore::IDBDatabaseBackendImpl::setVersion): (WebCore::IDBDatabaseBackendImpl::setVersionInternal): Now that this can be called even after an int version is set we have to make it revoke the int version. (WebCore::IDBDatabaseBackendImpl::openConnection): Nested ifs were getting deep, so refactor to return early instead. (WebCore::IDBDatabaseBackendImpl::deleteDatabase): (WebCore::IDBDatabaseBackendImpl::resetVersion): Now that an int version could have been set before setVersion was called we have to reset the int version on abort. * Modules/indexeddb/IDBDatabaseBackendImpl.h: (IDBDatabaseBackendImpl): * Modules/indexeddb/IDBLevelDBBackingStore.cpp: (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion): * Modules/indexeddb/IDBOpenDBRequest.cpp: 0 is now a valid integer version to store to leveldb if an idb database is reverting to a string version. (WebCore::IDBOpenDBRequest::onUpgradeNeeded): If the open request did not specify an integer version but upgradeneeded is called, it means the database was given the default version of 1. LayoutTests: Mostly updating expectations about getting an upgradeneeded on a new database and the default version being 1 instead of "". * http/tests/inspector/indexeddb/database-structure-expected.txt: * storage/indexeddb/cursor-overloads-expected.txt: * storage/indexeddb/cursor-overloads.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/factory-deletedatabase-interactions-expected.txt: * storage/indexeddb/intversion-and-setversion-expected.txt: Remove test that setVersion fires an error if an int version is set. Change it to testing that an int version can replace a string version that replaced an int version. * storage/indexeddb/intversion-bad-parameters-expected.txt: * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt: Removed. setVersion is no longer invalid so this test can be deleted. * storage/indexeddb/intversion-omit-parameter-expected.txt: We now fully pass this test. * storage/indexeddb/intversion-two-opens-no-versions-expected.txt: Added. * storage/indexeddb/intversion-two-opens-no-versions.html: Renamed from LayoutTests/storage/indexeddb/intversion-invalid-setversion-has-no-side-effects.html. * storage/indexeddb/list-ordering-expected.txt: * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/open-during-transaction-expected.txt: This test had a bug in it AND its behavior is changed. It was trying to open one database twice and another once but was actually opening three different databases. The behavior change is that now the transaction finishes while the last call to open is firing upgradeneeded. * storage/indexeddb/pending-activity-expected.txt: * storage/indexeddb/pending-activity-workers-expected.txt: * storage/indexeddb/resources/intversion-and-setversion.js: (deleteSuccess): (initialUpgradeNeeded): (openSuccess): (firstUpgradeNeeded): (transactionCompleted): (firstOpenWithVersion): (secondSetVersionCallback): (setIntVersion2): (versionChangeGoingFromStringToInt): (version2ConnectionBlocked): (version2ConnectionSuccess): (errorWhenTryingLowVersion): * storage/indexeddb/resources/intversion-invalid-setversion-has-no-side-effects.js: Removed. * storage/indexeddb/resources/intversion-two-opens-no-versions.js: Added. (test): (deleteSuccess): (connection1UpgradeNeeded): (connection1OpenSuccess): (connection2UpgradeNeeded): (connection2OpenSuccess): * storage/indexeddb/resources/list-ordering.js: * storage/indexeddb/resources/open-during-transaction.js: (startTransaction.trans.oncomplete): (startTransaction): (tryOpens.openreq3.onsuccess): (tryOpens): * storage/indexeddb/resources/pending-activity.js: * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: Canonical link: https://commits.webkit.org/115089@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-19 20:28:35 +00:00
PASS db.version is 1
IndexedDB: integer version layout tests https://bugs.webkit.org/show_bug.cgi?id=92560 Reviewed by Nate Chapin. Most of the integer version layout tests are here, with failures in the expected files. This will allow us to incrementally implement upgradeneeded and integer versions and just make the big patch in bug 89505 smaller. There are two added skips to TestExpectations, one test exposes a bug in the current implementation, causing an assert to fail. The other times out in DRT so we will run it as a content_browsertest for the time being. * platform/chromium/TestExpectations: * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html: Added. * storage/indexeddb/intversion-and-setversion-expected.txt: Added. * storage/indexeddb/intversion-and-setversion.html: Added. * storage/indexeddb/intversion-blocked-expected.txt: Added. * storage/indexeddb/intversion-blocked.html: Added. * storage/indexeddb/intversion-close-between-events-expected.txt: Added. * storage/indexeddb/intversion-close-between-events.html: Added. * storage/indexeddb/intversion-close-in-oncomplete-expected.txt: Added. * storage/indexeddb/intversion-close-in-oncomplete.html: Added. * storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-close-in-upgradeneeded.html: Added. * storage/indexeddb/intversion-delete-in-upgradeneeded-expected.txt: Added. * storage/indexeddb/intversion-delete-in-upgradeneeded.html: Added. * storage/indexeddb/intversion-gated-on-delete-expected.txt: Added. * storage/indexeddb/intversion-gated-on-delete.html: Added. * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt: Added. * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects.html: Added. * storage/indexeddb/intversion-long-queue-expected.txt: Added. * storage/indexeddb/intversion-long-queue.html: Added. * storage/indexeddb/intversion-omit-parameter-expected.txt: Added. * storage/indexeddb/intversion-omit-parameter.html: Added. * storage/indexeddb/intversion-open-with-version-expected.txt: Added. * storage/indexeddb/intversion-open-with-version.html: Added. and their respective js files... * storage/indexeddb/resources/shared.js: (unexpectedVersionChangeCallback): (setDBNameFromPath): (preamble): Canonical link: https://commits.webkit.org/110754@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-01 23:27:13 +00:00
PASS successfullyParsed is true
TEST COMPLETE