gecko-dev/storage/test/unit
Lina Cambridge 0cdebe20d7 Bug 1539104 - Add a way to detect supported storage connection operations. r=mak
In retrospect, overloading `Connection::connectionReady` to mean
"is ready _and_ supports this operation" wasn't a good idea. This
commit reverts that change (cfd44c936a9b), and adds two new methods:

* `Connection::operationSupported`, to check if a connection supports
  sync or async operations. This method is public.
* `Connection::ensureOperationSupported`, that asserts or returns an
  error if the connection doesn't support an operation. This is
  private.

`operationSupported` is used by callers like `Service::minimizeMemory`
to detect if the connection supports sync operations, since both sync
and async connections implement `mozIStorageConnection` now.

Finally, some callers used `!mDBConn` to check if the connection was
ready, while others used `connectionReady()`. This commit changes them
to use the latter.

Differential Revision: https://phabricator.services.mozilla.com/D24974

--HG--
extra : moz-landing-system : lando
2019-04-02 18:49:21 +00:00
..
corruptDB.sqlite
fakeDB.sqlite
head_storage.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
locale_collation.txt
test_bug-365166.js
test_bug-393952.js
test_bug-429521.js
test_bug-444233.js
test_cache_size.js
test_chunk_growth.js
test_connection_asyncClose.js
test_connection_executeAsync.js
test_connection_executeSimpleSQLAsync.js
test_connection_failsafe_close.js
test_connection_interrupt.js
test_js_helpers.js
test_levenshtein.js
test_like.js
test_like_escape.js
test_locale_collation.js
test_minimizeMemory.js Bug 1539104 - Add a way to detect supported storage connection operations. r=mak 2019-04-02 18:49:21 +00:00
test_page_size_is_32k.js
test_retry_on_busy.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
test_sqlite_secure_delete.js
test_statement_executeAsync.js
test_statement_wrapper_automatically.js
test_storage_aggregates.js
test_storage_connection.js Bug 1482608 - Add basic Rust bindings for mozStorage. r=nika,asuth,mak 2019-03-25 04:49:18 +00:00
test_storage_fulltextindex.js
test_storage_function.js
test_storage_progresshandler.js
test_storage_service.js
test_storage_service_unshared.js
test_storage_statement.js
test_storage_value_array.js
test_telemetry_vfs.js
test_unicode.js
test_vacuum.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
vacuumParticipant.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
vacuumParticipant.manifest
xpcshell.ini Bug 1539104 - Add a way to detect supported storage connection operations. r=mak 2019-04-02 18:49:21 +00:00