| android.support.test.espresso.IdlingResource |
|
|
Represents a resource of an application under test which can cause asynchronous background work
to happen during test execution (e.g. an intent service that processes a button click). By
default, ERROR(/Espresso) synchronizes all view operations with the UI thread as well as
AsyncTasks; however, it has no way of doing so with "hand-made" resources. In such cases, test
authors can register the custom resource via IdlingRegistry and ERROR(/Espresso) will wait
for the resource to become idle prior to executing a view operation.
Important Note: it is assumed that the resource stays idle most of the time.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| IdlingResource.ResourceCallback | Registered by an IdlingResource to notify Espresso of a transition to idle. |
||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns the name of the resources (used for logging and idempotency of registration).
| |||||||||||
Returns
true if resource is currently idle. | |||||||||||
Registers the given
IdlingResource.ResourceCallback with the resource. | |||||||||||
Returns the name of the resources (used for logging and idempotency of registration).
| Returns | |
|---|---|
String |
|
Returns true if resource is currently idle. Espresso will always call this
method from the main thread, therefore it should be non-blocking and return immediately.
| Returns | |
|---|---|
boolean |
|
Registers the given IdlingResource.ResourceCallback with the resource. Espresso will call this method:
IdlingResource.ResourceCallback so it can be notified asynchronously
that your resource is idle
| Parameters | |
|---|---|
callback |
IdlingResource.ResourceCallback |