gecko-dev/dom/indexedDB/test/unit
Bevis Tseng 44deb08f5c Bug 1151017 - Support the 'close' Event on Databases. r=khuey
Outline of this patch:

1. Define a new ipdl message called |CloseAfterInvalidationComplete| to trigger the close event after all transactions are complete only if the database is invalidated by the user agent.
2. Make sure the following event sequence is consistent during invalidation according to the steps in |5.2. Closing a database| by the following 2 solutions:
     IDBRequest.onerror -> IDBTransaction.onerror -> IDBTransaction.onabort -> IDBDatabase.onclose.
   2.1. In parent process, do not force to abort the transactions after invalidation but wait for all the transactions in its child process are complete.
   2.2. In child process, make sure that each IDBTransaction will notify its completion to the parent after all its pending IDBRequests are finished.
3. Add test_database_onclose.js to test the close event especially when read/write operation is ongoing.
4. Add test_database_close_without_onclose.js as a XPCShell test because setTimeout() is not preferred in Mochitest to ensure that the IDBDatabase.onclose event won't be sent after closed normally.
2016-05-31 18:08:20 +08:00
..
GlobalObjectsChild.js Bug 921478 - Remove BackstagePass IDB constructor resolve hook and use Cu.importGlobalProperties. r=bholley,bent 2013-11-19 08:36:12 +01:00
GlobalObjectsComponent.js Bug 921478 - Remove BackstagePass IDB constructor resolve hook and use Cu.importGlobalProperties. r=bholley,bent 2013-11-19 08:36:12 +01:00
GlobalObjectsComponent.manifest Bug 832883 - Move IDBKeyRange to WebIDL and define indexedDB/IDBKeyRange in all the spots. r=khuey,bent (initial work done by Ms2ger) 2013-09-28 13:25:46 +02:00
GlobalObjectsModule.jsm Bug 921478 - Remove BackstagePass IDB constructor resolve hook and use Cu.importGlobalProperties. r=bholley,bent 2013-11-19 08:36:12 +01:00
GlobalObjectsSandbox.js Bug 832883 - Move IDBKeyRange to WebIDL and define indexedDB/IDBKeyRange in all the spots. r=khuey,bent (initial work done by Ms2ger) 2013-09-28 13:25:46 +02:00
bug1056939_profile.zip Bug 1083927 - IndexedDB: Subdomain Quota Management; r=bent,ehsan 2014-11-28 09:44:12 +01:00
defaultStorageUpgrade_profile.zip Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
idbSubdirUpgrade1_profile.zip Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
idbSubdirUpgrade2_profile.zip Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
metadata2Restore_profile.zip Bug 1195930 - Part 11: Unified SQLite database schema and storage version, major and minor version support; r=asuth 2016-06-05 21:43:09 +02:00
metadataRestore_profile.zip Bug 1162624 - Add support for restoring corrupted or missing metadata files; r=bent 2015-05-08 21:05:30 +02:00
mutableFileUpgrade_profile.zip Bug 771288 - Multiprocess FileHandle support (FileHandle on PBackground); r=baku 2015-09-09 13:15:05 +02:00
oldDirectories_profile.zip Bug 1195930 - Part 9: Remove old directories (fixes bug 1273717); r=asuth 2016-06-05 21:42:55 +02:00
schema18upgrade_profile.zip Bug 1131776 - Use WITHOUT ROWID tables for IndexedDB, r=janv. 2015-02-16 09:48:14 -08:00
schema21upgrade_profile.zip Bug 1204183 - Test the object_data upgrade from bug 1202788. r=janv 2015-09-12 12:51:21 -03:00
schema23upgrade_profile.zip Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
storagePersistentUpgrade_profile.zip Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
test_add_put.js Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent 2015-01-23 20:56:48 +01:00
test_add_twice_failure.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_advance.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_autoIncrement.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_autoIncrement_indexes.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_blob_file_backed.js Bug 1243577, part 3 - Make test_blob_file_backed.js use SpecialPowers.createFiles(). r=khuey 2016-02-18 09:09:28 -08:00
test_blocked_order.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_bug1056939.js Bug 1083927 - IndexedDB: Subdomain Quota Management; r=bent,ehsan 2014-11-28 09:44:12 +01:00
test_cleanup_transaction.js Bug 1182987 - Part 5: Change mode of "readwrite" transaction to "cleanup" after QuotaExceeded is fired; r=baku 2016-04-21 06:53:30 +02:00
test_clear.js Bug 1112702 - Make IndexedDB transactions non-durable by default, r=khuey. 2015-01-25 22:30:09 -08:00
test_complex_keyPaths.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_count.js Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent 2015-01-23 20:56:48 +01:00
test_create_index.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_create_index_with_integer_keys.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_create_locale_aware_index.js Bug 871846 - Tests for locale aware indexes. r=janv 2014-07-20 14:29:54 -07:00
test_create_objectStore.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_cursor_cycle.js Bug 927782 - Part 4: Generators allocate all locals on the scope chain. r=luke 2013-12-06 18:22:06 +01:00
test_cursor_mutation.js Bug 927782 - Part 4: Generators allocate all locals on the scope chain. r=luke 2013-12-06 18:22:06 +01:00
test_cursor_update_updates_indexes.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_cursors.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_database_close_without_onclose.js Bug 1151017 - Support the 'close' Event on Databases. r=khuey 2016-05-31 18:08:20 +08:00
test_database_onclose.js Bug 1151017 - Support the 'close' Event on Databases. r=khuey 2016-05-31 18:08:20 +08:00
test_defaultStorageUpgrade.js Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
test_deleteDatabase.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_deleteDatabase_interactions.js Bug 949614 - Use === for SimpleTest.is; r=Waldo 2015-04-14 15:28:13 +02:00
test_deleteDatabase_onblocked.js Bug 823371 - Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey 2016-05-11 16:36:52 +08:00
test_deleteDatabase_onblocked_duringVersionChange.js Bug 823371 - Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey 2016-05-11 16:36:52 +08:00
test_event_source.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_filehandle_append_read_data.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_getAll.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_globalObjects_ipc.js Bug 832883 - Move IDBKeyRange to WebIDL and define indexedDB/IDBKeyRange in all the spots. r=khuey,bent (initial work done by Ms2ger) 2013-09-28 13:25:46 +02:00
test_globalObjects_other.js Bug 921478 - Remove BackstagePass IDB constructor resolve hook and use Cu.importGlobalProperties. r=bholley,bent 2013-11-19 08:36:12 +01:00
test_globalObjects_xpc.js Bug 921478 - Remove BackstagePass IDB constructor resolve hook and use Cu.importGlobalProperties. r=bholley,bent 2013-11-19 08:36:12 +01:00
test_global_data.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_idbSubdirUpgrade.js Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
test_idle_maintenance.js Bug 1248550 - Part 7: Improve the test for idle maintenance to trigger interference between database maintenance and normal database operations; r=khuey 2016-03-01 10:45:17 +01:00
test_index_empty_keyPath.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_index_getAll.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_index_getAllObjects.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_index_object_cursors.js Bug 927782 - Part 4: Generators allocate all locals on the scope chain. r=luke 2013-12-06 18:22:06 +01:00
test_index_update_delete.js Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent 2015-01-23 20:56:48 +01:00
test_indexes.js Bug 994190 - 'Modify main-thread IndexedDB to use PBackground', r=khuey. 2014-09-26 16:21:57 -07:00
test_indexes_bad_values.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_indexes_funny_things.js Bug 1178803. Fix the handling of the 'length' key in IDB keypaths when operating on a string. r=bent 2015-07-01 00:15:30 -04:00
test_invalid_cursor.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_invalid_version.js Bug 785884 - Implement support for temporary storage (aka shared pool). r=ehsan, r=bent 2013-09-11 06:18:36 +02:00
test_invalidate.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_key_requirements.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_keys.js Bug 949614 - Use === for SimpleTest.is; r=Waldo 2015-04-14 15:28:13 +02:00
test_locale_aware_index_getAll.js Bug 871846 - Tests for locale aware indexes. r=janv 2014-07-20 14:29:54 -07:00
test_locale_aware_index_getAllObjects.js Bug 871846 - Tests for locale aware indexes. r=janv 2014-07-20 14:29:54 -07:00
test_locale_aware_indexes.js Bug 871846 - Tests for locale aware indexes. r=janv 2014-07-20 14:29:54 -07:00
test_lowDiskSpace.js Bug 1273833 - Always return AbortError of the Open DB Request if the Upgrade Transaction is aborted. r=khuey 2016-05-19 15:05:31 +08:00
test_metadata2Restore.js Bug 1195930 - Part 7: New test for metadata v2 restoring (also tests userContextId origin attribute); r=asuth 2016-06-05 21:42:40 +02:00
test_metadataRestore.js Bug 1165272 - Part 2: replace getNoAppCodebasePrincipal. r=bholley 2015-08-18 15:01:42 +08:00
test_multientry.js Bug 949614 - Use === for SimpleTest.is; r=Waldo 2015-04-14 15:28:13 +02:00
test_mutableFileUpgrade.js Bug 771288 - Multiprocess FileHandle support (FileHandle on PBackground); r=baku 2015-09-09 13:15:05 +02:00
test_names_sorted.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_objectCursors.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_objectStore_getAllKeys.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_objectStore_inline_autoincrement_key_added_on_put.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_objectStore_openKeyCursor.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_objectStore_remove_values.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_object_identity.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_odd_result_order.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_oldDirectories.js Bug 1195930 - Part 9: Remove old directories (fixes bug 1273717); r=asuth 2016-06-05 21:42:55 +02:00
test_open_empty_db.js Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent 2015-01-23 20:56:48 +01:00
test_open_for_principal.js Bug 1165272 - Part 2: replace getNoAppCodebasePrincipal. r=bholley 2015-08-18 15:01:42 +08:00
test_open_objectStore.js Bug 888597 - Move IDBObjectStore to WebIDL, r=janv 2013-07-31 17:48:36 +02:00
test_optionalArguments.js Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent 2015-01-23 20:56:48 +01:00
test_overlapping_transactions.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_persistenceType.js Bug 949614 - Use === for SimpleTest.is; r=Waldo 2015-04-14 15:28:13 +02:00
test_put_get_values.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_put_get_values_autoIncrement.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_quotaExceeded_recovery.js Bug 1182987 - Part 5: Change mode of "readwrite" transaction to "cleanup" after QuotaExceeded is fired; r=baku 2016-04-21 06:53:30 +02:00
test_readonly_transactions.js Bug 701634 - Support IndexedDB in Workers, r=khuey+baku. 2014-12-16 22:26:15 -08:00
test_readwriteflush_disabled.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_remove_index.js Bug 701634, Make flaky tests wait for transactions to complete before continuing to the next test 2014-12-17 09:04:06 -08:00
test_remove_objectStore.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_rename_index.js Bug 1118028 - Allow objectStores and indexes to be renamed. r=khuey 2016-03-30 11:04:56 +08:00
test_rename_index_errors.js Bug 1118028 - Allow objectStores and indexes to be renamed. r=khuey 2016-03-30 11:04:56 +08:00
test_rename_objectStore.js Bug 1118028 - Allow objectStores and indexes to be renamed. r=khuey 2016-03-30 11:04:56 +08:00
test_rename_objectStore_errors.js Bug 1118028 - Allow objectStores and indexes to be renamed. r=khuey 2016-03-30 11:04:56 +08:00
test_request_readyState.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_sandbox.js Bug 1176434 - Enabling indexedDB for content JS sandboxes, r=bent 2015-07-02 13:30:15 -07:00
test_schema18upgrade.js Bug 1131776 - Use WITHOUT ROWID tables for IndexedDB, r=janv. 2015-02-16 09:48:14 -08:00
test_schema21upgrade.js Bug 1204183 - Test the object_data upgrade from bug 1202788. r=janv 2015-09-12 12:51:21 -03:00
test_schema23upgrade.js Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
test_setVersion.js Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
test_setVersion_abort.js Bug 949614 - Use === for SimpleTest.is; r=Waldo 2015-04-14 15:28:13 +02:00
test_setVersion_events.js Bug 949614 - Use === for SimpleTest.is; r=Waldo 2015-04-14 15:28:13 +02:00
test_setVersion_exclusion.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_setVersion_throw.js Bug 1133540 - Add Test Coverage for the Assertion. r=khuey 2015-02-16 09:41:00 +08:00
test_storagePersistentUpgrade.js Bug 1285170 - Remove app:// protocol r=valentin 2016-03-16 17:11:12 +01:00
test_success_events_after_abort.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_table_locks.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_table_rollback.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_temporary_storage.js Bug 1273833 - Always return AbortError of the Open DB Request if the Upgrade Transaction is aborted. r=khuey 2016-05-19 15:05:31 +08:00
test_traffic_jam.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_transaction_abort.js Bug 1150737: Make executeSoon work properly on workers, enable tests. r=bent 2016-02-10 22:35:50 -08:00
test_transaction_abort_hang.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
test_transaction_duplicate_store_names.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_transaction_error.js Bug 1268378 - Fire TypeError from IDBDatabase.transaction() if Mode is Invalid. r=khuey 2016-04-28 17:38:21 +08:00
test_transaction_lifetimes.js Bug 1150737: Make executeSoon work properly on workers, enable tests. r=bent 2016-02-10 22:35:50 -08:00
test_transaction_lifetimes_nested.js Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
test_transaction_ordering.js Bug 1001090 - Part 5: Fix errors in tests throughout the tree. (r=robcee,gavin) 2014-09-15 16:30:47 -07:00
test_unique_index_update.js Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent 2015-01-23 20:56:48 +01:00
test_writer_starvation.js Bug 891806 - part 4 - replace 'yield;' with 'yield undefined;' in dom/; r=smaug 2013-07-10 23:52:35 +02:00
xpcshell-child-process.ini Bug 1066735 - Remove root b2g and android specific xpcshell manifests, r=chmanchester 2014-10-07 18:18:28 -04:00
xpcshell-head-child-process.js Bug 994190 - 'Modify main-thread IndexedDB to use PBackground', r=khuey. 2014-09-26 16:21:57 -07:00
xpcshell-head-parent-process.js Bug 1182987 - Part 4: Add a test for QuotaExceededError recovery and the new "cleanup" transaction type; r=baku 2016-03-15 07:00:44 +01:00
xpcshell-parent-process.ini Bug 1151017 - Support the 'close' Event on Databases. r=khuey 2016-05-31 18:08:20 +08:00
xpcshell-shared.ini Bug 823371 - Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey 2016-05-11 16:36:52 +08:00