haikuwebkit/LayoutTests/storage/indexeddb/transaction-and-objectstore...

168 lines
7.1 KiB
Plaintext
Raw Permalink Normal View History

Modern IDB: Add private-browsing variant for many IDB tests, and enable private browsing in Modern IDB. https://bugs.webkit.org/show_bug.cgi?id=153179 Reviewed by Darin Adler. Source/WebCore: Tests: Many private-browsing copies of existing IDB tests. * Modules/indexeddb/client/IDBFactoryImpl.cpp: (WebCore::IDBClient::shouldThrowSecurityException): Allow IDB access in private browsing. LayoutTests: Update many expectations files to skip some of the new tests on some platforms: * TestExpectations: * platform/mac-wk1/TestExpectations: * platform/wk2/TestExpectations: Add a special case for URLs that end with "-private.html" to enable private browsing: * resources/js-test.js: Add a whole bunch of -private.html wrappers along with new test expectations, along with some minor test changes to remove unnecessary ambiguity due to .html filename: * storage/indexeddb/aborted-versionchange-closes-private-expected.txt: Added. * storage/indexeddb/aborted-versionchange-closes-private.html: Added. * storage/indexeddb/basics-private-expected.txt: Added. * storage/indexeddb/basics-private.html: Added. * storage/indexeddb/create-and-remove-object-store-private-expected.txt: Added. * storage/indexeddb/create-and-remove-object-store-private.html: Added. * storage/indexeddb/create-object-store-options-private-expected.txt: Added. * storage/indexeddb/create-object-store-options-private.html: Added. * storage/indexeddb/createIndex-after-failure-private-expected.txt: Added. * storage/indexeddb/createIndex-after-failure-private.html: Added. * storage/indexeddb/createObjectStore-name-argument-required-private-expected.txt: Added. * storage/indexeddb/createObjectStore-name-argument-required-private.html: Added. * storage/indexeddb/createObjectStore-null-name-private-expected.txt: Added. * storage/indexeddb/createObjectStore-null-name-private.html: Added. * storage/indexeddb/cursor-added-bug-private-expected.txt: Added. * storage/indexeddb/cursor-added-bug-private.html: Added. * storage/indexeddb/cursor-advance-private-expected.txt: Added. * storage/indexeddb/cursor-advance-private.html: Added. * storage/indexeddb/cursor-basics-private-expected.txt: Added. * storage/indexeddb/cursor-basics-private.html: Added. * storage/indexeddb/cursor-continue-dir-private-expected.txt: Added. * storage/indexeddb/cursor-continue-dir-private.html: Added. * storage/indexeddb/cursor-continue-private-expected.txt: Added. * storage/indexeddb/cursor-continue-private.html: Added. * storage/indexeddb/cursor-continue-validity-private-expected.txt: Added. * storage/indexeddb/cursor-continue-validity-private.html: Added. * storage/indexeddb/cursor-delete-private-expected.txt: Added. * storage/indexeddb/cursor-delete-private.html: Added. * storage/indexeddb/cursor-finished-private-expected.txt: Added. * storage/indexeddb/cursor-finished-private.html: Added. * storage/indexeddb/cursor-inconsistency-private-expected.txt: Added. * storage/indexeddb/cursor-inconsistency-private.html: Added. * storage/indexeddb/cursor-index-delete-private-expected.txt: Added. * storage/indexeddb/cursor-index-delete-private.html: Added. * storage/indexeddb/cursor-key-order-private-expected.txt: Added. * storage/indexeddb/cursor-key-order-private.html: Added. * storage/indexeddb/cursor-prev-no-duplicate-private-expected.txt: Added. * storage/indexeddb/cursor-prev-no-duplicate-private.html: Added. * storage/indexeddb/cursor-primary-key-order-private-expected.txt: Added. * storage/indexeddb/cursor-primary-key-order-private.html: Added. * storage/indexeddb/cursor-properties-private-expected.txt: Added. * storage/indexeddb/cursor-properties-private.html: Added. * storage/indexeddb/cursor-reverse-bug-private-expected.txt: Added. * storage/indexeddb/cursor-reverse-bug-private.html: Added. * storage/indexeddb/cursor-skip-deleted-private-expected.txt: Added. * storage/indexeddb/cursor-skip-deleted-private.html: Added. * storage/indexeddb/cursor-update-private-expected.txt: Added. * storage/indexeddb/cursor-update-private.html: Added. * storage/indexeddb/cursor-update-value-argument-required-private-expected.txt: Added. * storage/indexeddb/cursor-update-value-argument-required-private.html: Added. * storage/indexeddb/cursor-value-private-expected.txt: Added. * storage/indexeddb/cursor-value-private.html: Added. * storage/indexeddb/database-basics-private-expected.txt: Added. * storage/indexeddb/database-basics-private.html: Added. * storage/indexeddb/database-close-private-expected.txt: Added. * storage/indexeddb/database-close-private.html: Added. * storage/indexeddb/database-closepending-flag-private-expected.txt: Added. * storage/indexeddb/database-closepending-flag-private.html: Added. * storage/indexeddb/database-deletepending-flag-private-expected.txt: Added. * storage/indexeddb/database-deletepending-flag-private.html: Added. * storage/indexeddb/database-name-undefined-private-expected.txt: Added. * storage/indexeddb/database-name-undefined-private.html: Added. * storage/indexeddb/database-odd-names-private-expected.txt: Added. * storage/indexeddb/database-odd-names-private.html: Added. * storage/indexeddb/database-quota-private-expected.txt: Added. * storage/indexeddb/database-quota-private.html: Added. * storage/indexeddb/database-wrapper-private-expected.txt: Added. * storage/indexeddb/database-wrapper-private.html: Added. * storage/indexeddb/delete-closed-database-object-private-expected.txt: Added. * storage/indexeddb/delete-closed-database-object-private.html: Added. * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-private-expected.txt: Added. * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-private.html: Added. * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-private-expected.txt: Added. * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-private.html: Added. * storage/indexeddb/delete-range-private-expected.txt: Added. * storage/indexeddb/delete-range-private.html: Added. * storage/indexeddb/deleteIndex-private-expected.txt: Added. * storage/indexeddb/deleteIndex-private.html: Added. * storage/indexeddb/deleteObjectStore-name-argument-required-private-expected.txt: Added. * storage/indexeddb/deleteObjectStore-name-argument-required-private.html: Added. * storage/indexeddb/deleteObjectStore-null-name-private-expected.txt: Added. * storage/indexeddb/deleteObjectStore-null-name-private.html: Added. * storage/indexeddb/deleted-objects-private-expected.txt: Added. * storage/indexeddb/deleted-objects-private.html: Added. * storage/indexeddb/deletedatabase-blocked-private-expected.txt: Added. * storage/indexeddb/deletedatabase-blocked-private.html: Added. * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-private-expected.txt: Added. * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-private.html: Added. * storage/indexeddb/deletedatabase-delayed-by-versionchange-private-expected.txt: Added. * storage/indexeddb/deletedatabase-not-blocked-private-expected.txt: Added. * storage/indexeddb/deletedatabase-not-blocked-private.html: Added. * storage/indexeddb/dont-wedge-private-expected.txt: Added. * storage/indexeddb/dont-wedge-private.html: Added. * storage/indexeddb/duplicates-private-expected.txt: Added. * storage/indexeddb/duplicates-private.html: Added. * storage/indexeddb/error-causes-abort-by-default-private-expected.txt: Added. * storage/indexeddb/error-causes-abort-by-default-private.html: Added. * storage/indexeddb/events-private-expected.txt: Added. * storage/indexeddb/events-private.html: Added. * storage/indexeddb/exception-in-event-aborts-private-expected.txt: Added. * storage/indexeddb/exception-in-event-aborts-private.html: Added. * storage/indexeddb/exceptions-private-expected.txt: Added. * storage/indexeddb/exceptions-private.html: Added. * storage/indexeddb/factory-cmp-private-expected.txt: Added. * storage/indexeddb/factory-cmp-private.html: Added. * storage/indexeddb/factory-deletedatabase-private-expected.txt: Added. * storage/indexeddb/factory-deletedatabase-private.html: Added. * storage/indexeddb/get-keyrange-private-expected.txt: Added. * storage/indexeddb/get-keyrange-private.html: Added. * storage/indexeddb/index-basics-private-expected.txt: Added. * storage/indexeddb/index-basics-private.html: Added. * storage/indexeddb/index-count-private-expected.txt: Added. * storage/indexeddb/index-count-private.html: Added. * storage/indexeddb/index-cursor-private-expected.txt: Added. * storage/indexeddb/index-cursor-private.html: Added. * storage/indexeddb/index-duplicate-keypaths-private-expected.txt: Added. * storage/indexeddb/index-duplicate-keypaths-private.html: Added. * storage/indexeddb/index-get-key-argument-required-private-expected.txt: Added. * storage/indexeddb/index-get-key-argument-required-private.html: Added. * storage/indexeddb/index-multientry-private-expected.txt: Added. * storage/indexeddb/index-multientry-private.html: Added. * storage/indexeddb/index-population-private-expected.txt: Added. * storage/indexeddb/index-population-private.html: Added. * storage/indexeddb/index-unique-private-expected.txt: Added. * storage/indexeddb/index-unique-private.html: Added. * storage/indexeddb/interfaces-private-expected.txt: Added. * storage/indexeddb/interfaces-private.html: Added. * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-private-expected.txt: Added. * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-private.html: Added. * storage/indexeddb/intversion-bad-parameters-private-expected.txt: Added. * storage/indexeddb/intversion-bad-parameters-private.html: Added. * storage/indexeddb/intversion-blocked-private-expected.txt: Added. * storage/indexeddb/intversion-blocked-private.html: Added. * storage/indexeddb/intversion-close-between-events-private-expected.txt: Added. * storage/indexeddb/intversion-close-between-events-private.html: Added. * storage/indexeddb/intversion-close-in-oncomplete-private-expected.txt: Added. * storage/indexeddb/intversion-close-in-oncomplete-private.html: Added. * storage/indexeddb/intversion-close-in-upgradeneeded-private-expected.txt: Added. * storage/indexeddb/intversion-close-in-upgradeneeded-private.html: Added. * storage/indexeddb/intversion-encoding-private-expected.txt: Added. * storage/indexeddb/intversion-encoding-private.html: Added. * storage/indexeddb/intversion-gated-on-delete-private-expected.txt: Added. * storage/indexeddb/intversion-gated-on-delete-private.html: Added. * storage/indexeddb/intversion-long-queue-private-expected.txt: Added. * storage/indexeddb/intversion-long-queue-private.html: Added. * storage/indexeddb/intversion-omit-parameter-private-expected.txt: Added. * storage/indexeddb/intversion-omit-parameter-private.html: Added. * storage/indexeddb/intversion-open-in-upgradeneeded-private-expected.txt: Added. * storage/indexeddb/intversion-open-in-upgradeneeded-private.html: Added. * storage/indexeddb/intversion-open-with-version-private-expected.txt: Added. * storage/indexeddb/intversion-open-with-version-private.html: Added. * storage/indexeddb/intversion-pending-version-changes-ascending-private-expected.txt: Added. * storage/indexeddb/intversion-pending-version-changes-ascending-private.html: Added. * storage/indexeddb/intversion-pending-version-changes-descending-private-expected.txt: Added. * storage/indexeddb/intversion-pending-version-changes-descending-private.html: Added. * storage/indexeddb/intversion-pending-version-changes-same-private-expected.txt: Added. * storage/indexeddb/intversion-pending-version-changes-same-private.html: Added. * storage/indexeddb/intversion-persistence-private-expected.txt: Added. * storage/indexeddb/intversion-persistence-private.html: Added. * storage/indexeddb/intversion-revert-on-abort-private-expected.txt: Added. * storage/indexeddb/intversion-revert-on-abort-private.html: Added. * storage/indexeddb/intversion-two-opens-no-versions-private-expected.txt: Added. * storage/indexeddb/intversion-two-opens-no-versions-private.html: Added. * storage/indexeddb/intversion-upgrades-private-expected.txt: Added. * storage/indexeddb/intversion-upgrades-private.html: Added. * storage/indexeddb/invalid-keys-private-expected.txt: Added. * storage/indexeddb/invalid-keys-private.html: Added. * storage/indexeddb/key-generator-private-expected.txt: Added. * storage/indexeddb/key-generator-private.html: Added. * storage/indexeddb/key-sort-order-across-types-private-expected.txt: Added. * storage/indexeddb/key-sort-order-across-types-private.html: Added. * storage/indexeddb/key-sort-order-date-private-expected.txt: Added. * storage/indexeddb/key-sort-order-date-private.html: Added. * storage/indexeddb/key-type-array-private-expected.txt: Added. * storage/indexeddb/key-type-array-private.html: Added. * storage/indexeddb/key-type-binary-private-expected.txt: Added. * storage/indexeddb/key-type-binary-private.html: Added. * storage/indexeddb/key-type-infinity-private-expected.txt: Added. * storage/indexeddb/key-type-infinity-private.html: Added. * storage/indexeddb/keypath-arrays-private-expected.txt: Added. * storage/indexeddb/keypath-arrays-private.html: Added. * storage/indexeddb/keypath-basics-private-expected.txt: Added. * storage/indexeddb/keypath-basics-private.html: Added. * storage/indexeddb/keypath-edges-private-expected.txt: Added. * storage/indexeddb/keypath-edges-private.html: Added. * storage/indexeddb/keypath-fetch-key-private-expected.txt: Added. * storage/indexeddb/keypath-fetch-key-private.html: Added. * storage/indexeddb/keypath-intrinsic-properties-private-expected.txt: Added. * storage/indexeddb/keypath-intrinsic-properties-private.html: Added. * storage/indexeddb/keyrange-private-expected.txt: Added. * storage/indexeddb/keyrange-private.html: Added. * storage/indexeddb/keyrange-required-arguments-private-expected.txt: Added. * storage/indexeddb/keyrange-required-arguments-private.html: Added. * storage/indexeddb/lazy-index-types-private-expected.txt: Added. * storage/indexeddb/lazy-index-types-private.html: Added. * storage/indexeddb/legacy-constants-private-expected.txt: Added. * storage/indexeddb/legacy-constants-private.html: Added. * storage/indexeddb/list-ordering-private-expected.txt: Added. * storage/indexeddb/list-ordering-private.html: Added. * storage/indexeddb/metadata-private-expected.txt: Added. * storage/indexeddb/metadata-private.html: Added. * storage/indexeddb/mutating-cursor-private-expected.txt: Added. * storage/indexeddb/mutating-cursor-private.html: Added. * storage/indexeddb/objectStore-required-arguments-private-expected.txt: Added. * storage/indexeddb/objectStore-required-arguments-private.html: Added. * storage/indexeddb/objectstore-autoincrement-private-expected.txt: Added. * storage/indexeddb/objectstore-autoincrement-private.html: Added. * storage/indexeddb/objectstore-basics-private-expected.txt: Added. * storage/indexeddb/objectstore-basics-private.html: Added. * storage/indexeddb/objectstore-clear-private-expected.txt: Added. * storage/indexeddb/objectstore-clear-private.html: Added. * storage/indexeddb/objectstore-count-private-expected.txt: Added. * storage/indexeddb/objectstore-count-private.html: Added. * storage/indexeddb/objectstore-cursor-private-expected.txt: Added. * storage/indexeddb/objectstore-cursor-private.html: Added. * storage/indexeddb/objectstore-removeobjectstore-private-expected.txt: Added. * storage/indexeddb/objectstore-removeobjectstore-private.html: Added. * storage/indexeddb/odd-strings-private-expected.txt: Added. * storage/indexeddb/odd-strings-private.html: Added. * storage/indexeddb/open-cursor-private-expected.txt: Added. * storage/indexeddb/open-cursor-private.html: Added. * storage/indexeddb/open-during-transaction-private-expected.txt: Added. * storage/indexeddb/open-during-transaction-private.html: Added. * storage/indexeddb/open-ordering-private-expected.txt: Added. * storage/indexeddb/open-ordering-private.html: Added. * storage/indexeddb/opencursor-key-private-expected.txt: Added. * storage/indexeddb/opencursor-key-private.html: Added. * storage/indexeddb/pending-activity-private-expected.txt: Added. * storage/indexeddb/pending-activity-private.html: Added. * storage/indexeddb/pending-version-change-on-exit-private-expected.txt: Added. * storage/indexeddb/pending-version-change-on-exit-private.html: Added. * storage/indexeddb/pending-version-change-stuck-private-expected.txt: Added. * storage/indexeddb/pending-version-change-stuck-private.html: Added. * storage/indexeddb/persistence-expected.txt: * storage/indexeddb/persistence-private-expected.txt: Copied from LayoutTests/storage/indexeddb/persistence-expected.txt. * storage/indexeddb/persistence-private.html: Added. * storage/indexeddb/prefetch-bugfix-108071-private-expected.txt: Added. * storage/indexeddb/prefetch-bugfix-108071-private.html: Added. * storage/indexeddb/queued-commands-private-expected.txt: Added. * storage/indexeddb/queued-commands-private.html: Added. * storage/indexeddb/readonly-private-expected.txt: Added. * storage/indexeddb/readonly-private.html: Added. * storage/indexeddb/readonly-properties-private-expected.txt: Added. * storage/indexeddb/readonly-properties-private.html: Added. * storage/indexeddb/removed-private-expected.txt: Added. * storage/indexeddb/removed-private.html: Added. * storage/indexeddb/request-continue-abort-private-expected.txt: Added. * storage/indexeddb/request-continue-abort-private.html: Added. * storage/indexeddb/request-event-propagation-private-expected.txt: Added. * storage/indexeddb/request-event-propagation-private.html: Added. * storage/indexeddb/resources/persistence.js: * storage/indexeddb/set_version_blocked-private-expected.txt: Added. * storage/indexeddb/set_version_blocked-private.html: Added. * storage/indexeddb/setversion-blocked-by-versionchange-close-private-expected.txt: Added. * storage/indexeddb/setversion-blocked-by-versionchange-close-private.html: Added. * storage/indexeddb/setversion-not-blocked-private-expected.txt: Added. * storage/indexeddb/setversion-not-blocked-private.html: Added. * storage/indexeddb/transaction-abort-private-expected.txt: Added. * storage/indexeddb/transaction-abort-private.html: Added. * storage/indexeddb/transaction-active-flag-private-expected.txt: Added. * storage/indexeddb/transaction-active-flag-private.html: Added. * storage/indexeddb/transaction-after-close-private-expected.txt: Added. * storage/indexeddb/transaction-after-close-private.html: Added. * storage/indexeddb/transaction-and-objectstore-calls-private-expected.txt: Added. * storage/indexeddb/transaction-and-objectstore-calls-private.html: Added. * storage/indexeddb/transaction-basics-private-expected.txt: Added. * storage/indexeddb/transaction-basics-private.html: Added. * storage/indexeddb/transaction-complete-workers-private-expected.txt: Added. * storage/indexeddb/transaction-complete-workers-private.html: Added. * storage/indexeddb/transaction-coordination-across-databases-private-expected.txt: Added. * storage/indexeddb/transaction-coordination-across-databases-private.html: Added. * storage/indexeddb/transaction-coordination-within-database-private-expected.txt: Added. * storage/indexeddb/transaction-coordination-within-database-private.html: Added. * storage/indexeddb/transaction-crash-on-abort-private-expected.txt: Added. * storage/indexeddb/transaction-crash-on-abort-private.html: Added. * storage/indexeddb/transaction-error-private-expected.txt: Added. * storage/indexeddb/transaction-error-private.html: Added. * storage/indexeddb/transaction-event-propagation-private-expected.txt: Added. * storage/indexeddb/transaction-event-propagation-private.html: Added. * storage/indexeddb/transaction-read-only-private-expected.txt: Added. * storage/indexeddb/transaction-read-only-private.html: Added. * storage/indexeddb/transaction-readwrite-exclusive-private-expected.txt: Added. * storage/indexeddb/transaction-readwrite-exclusive-private.html: Added. * storage/indexeddb/transaction-rollback-private-expected.txt: Added. * storage/indexeddb/transaction-rollback-private.html: Added. * storage/indexeddb/transaction-scope-sequencing-private-expected.txt: Added. * storage/indexeddb/transaction-scope-sequencing-private.html: Added. * storage/indexeddb/transaction-starvation-private-expected.txt: Added. * storage/indexeddb/transaction-storeNames-required-private-expected.txt: Added. * storage/indexeddb/transaction-storeNames-required-private.html: Added. * storage/indexeddb/unblocked-version-changes-private-expected.txt: Added. * storage/indexeddb/unblocked-version-changes-private.html: Added. * storage/indexeddb/unprefix-private-expected.txt: Added. * storage/indexeddb/unprefix-private.html: Added. * storage/indexeddb/value-undefined-private-expected.txt: Added. * storage/indexeddb/value-undefined-private.html: Added. * storage/indexeddb/values-odd-types-private-expected.txt: Added. * storage/indexeddb/values-odd-types-private.html: Added. * storage/indexeddb/version-change-abort-private-expected.txt: Added. * storage/indexeddb/version-change-abort-private.html: Added. * storage/indexeddb/version-change-exclusive-private-expected.txt: Added. * storage/indexeddb/version-change-exclusive-private.html: Added. * storage/indexeddb/versionchangerequest-activedomobject-private-expected.txt: Added. * storage/indexeddb/versionchangerequest-activedomobject-private.html: Added. Canonical link: https://commits.webkit.org/171290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-19 06:02:30 +00:00
Test IndexedDB's transaction and objectStore calls
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)
db.createObjectStore('a')
db.createObjectStore('b')
db.createObjectStore('store').createIndex('index', 'some_path')
trans = db.transaction(['a'])
trans.objectStore('a')
Expecting exception from trans.objectStore('b')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
Expecting exception from trans.objectStore('x')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
trans = db.transaction(['a'])
trans.objectStore('a')
Expecting exception from trans.objectStore('b')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
Expecting exception from trans.objectStore('x')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
trans = db.transaction(['b'])
trans.objectStore('b')
Expecting exception from trans.objectStore('a')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
Expecting exception from trans.objectStore('x')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
trans = db.transaction(['a', 'b'])
trans.objectStore('a')
trans.objectStore('b')
Expecting exception from trans.objectStore('x')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
trans = db.transaction(['b', 'a'])
trans.objectStore('a')
trans.objectStore('b')
Expecting exception from trans.objectStore('x')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
Passing a string as the first argument is a shortcut for just one object store:
trans = db.transaction('a')
trans.objectStore('a')
Expecting exception from trans.objectStore('b')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
Expecting exception from trans.objectStore('x')
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
PASS trans = db.transaction() threw exception TypeError: Not enough arguments.
Expecting exception from db.transaction(['x'])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Expecting exception from db.transaction(['x'])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Expecting exception from db.transaction(['a', 'x'])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Expecting exception from db.transaction(['x', 'x'])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Expecting exception from db.transaction(['a', 'x', 'b'])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Exception thrown when no stores specified:
Expecting exception from db.transaction([])
PASS Exception was thrown.
PASS code is DOMException.INVALID_ACCESS_ERR
Exception message: Failed to execute 'transaction' on 'IDBDatabase': The storeNames parameter was empty.
{} coerces to a string - so no match, but not a type error:
Expecting exception from db.transaction({})
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Expecting exception from db.transaction({mode:0})
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Overriding the default string coercion makes these work:
db.transaction({toString:function(){return 'a';}})
db.transaction([{toString:function(){return 'a';}}])
... but you still need to specify a real store:
Expecting exception from db.transaction([{toString:function(){return 'x';}}])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
Expecting exception from db.transaction([{toString:function(){return 'x';}}])
PASS Exception was thrown.
PASS code is DOMException.NOT_FOUND_ERR
PASS ename is 'NotFoundError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
trans = db.transaction(['store'])
PASS trans is non-null.
store = trans.objectStore('store')
PASS store is non-null.
store.get('some_key')
transaction complete, ensuring methods fail
PASS trans is non-null.
PASS store is non-null.
Expecting exception from trans.objectStore('store')
PASS Exception was thrown.
PASS code is 11
PASS ename is 'InvalidStateError'
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The transaction finished.
Expecting exception from store.index('index')
PASS Exception was thrown.
PASS code is 11
PASS ename is 'InvalidStateError'
Exception message: Failed to execute 'index' on 'IDBObjectStore': The transaction is finished.
PASS successfullyParsed is true
TEST COMPLETE