{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
class IdlingRegistry
Handles registering and unregistering of IdlingResources with Espresso from within your application code.
These resources are required by Espresso to provide synchronisation against your application code. All registered resources with this registry will be automatically synchronized against for each Espresso interaction.
This registry along with IdlingResource interface are bundled together in a small light weight module so that it can be pulled in as a dependency of the App under test with close to no overhead.
Constants |
|
|---|---|
const IdlingRegistry! |
|
Public constructors |
|
|---|---|
Public functions |
|
|---|---|
(Mutable)Collection<Looper!>! |
Returns a set of all currently registered |
(Mutable)Collection<IdlingResource!>! |
Returns a set of all currently registered |
Boolean |
register(idlingResources: Array<IdlingResource!>!)Registers one or more |
Unit |
registerLooperAsIdlingResource(looper: Looper!)Registers a |
Boolean |
unregister(idlingResources: Array<IdlingResource!>!)Unregisters one or more |
Boolean |
unregisterLooperAsIdlingResource(looper: Looper!)Unregisters a |
fun getLoopers(): (Mutable)Collection<Looper!>!
Returns a set of all currently registered Loopers.
fun getResources(): (Mutable)Collection<IdlingResource!>!
Returns a set of all currently registered IdlingResources.
fun register(idlingResources: Array<IdlingResource!>!): Boolean
Registers one or more IdlingResources. When registering more than one resource, ensure that each has a unique name returned from getName
| Returns | |
|---|---|
Boolean |
|
fun registerLooperAsIdlingResource(looper: Looper!): Unit
Registers a Looper for idle checking with the framework. This is intended for use with non-UI thread Loopers only.
| Throws | |
|---|---|
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException |
if looper is the main looper. |
java.lang.NullPointerException: java.lang.NullPointerException |
if looper is null. |
fun unregister(idlingResources: Array<IdlingResource!>!): Boolean
Unregisters one or more IdlingResources.
| Returns | |
|---|---|
Boolean |
|
fun unregisterLooperAsIdlingResource(looper: Looper!): Boolean
Unregisters a Looper.
Attempting to unregister a looper that is not registered is a no-op.
| Returns | |
|---|---|
Boolean |
|