IdlingDispatcher

class IdlingDispatcher(delegate: CoroutineDispatcher) : CoroutineDispatcher

IdlingResource helper for coroutines. This class simply wraps a delegate CoroutineDispatcher and keeps a running count of all coroutines it creates, decrementing the count when they complete.

See also

androidx.test.espresso.IdlingResource
kotlinx.coroutines.CoroutineDispatcher

Constructors

Link copied to clipboard
fun IdlingDispatcher(delegate: CoroutineDispatcher)

Functions

Link copied to clipboard
open override fun dispatch(context: CoroutineContext, block: Runnable)

Counting implementation of the dispatch function.

Link copied to clipboard
open fun dispatchYield(context: CoroutineContext, block: Runnable)
Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
override fun <T> interceptContinuation(continuation: Continuation<T>): Continuation<T>
Link copied to clipboard
open fun isDispatchNeeded(context: CoroutineContext): Boolean
Link copied to clipboard
fun isIdle(): Boolean
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext
operator fun plus(other: CoroutineDispatcher): CoroutineDispatcher
Link copied to clipboard
override fun releaseInterceptedContinuation(continuation: Continuation<*>)

Properties

Link copied to clipboard
val counter: CountingIdlingResource

The CountingIdlingResource which is responsible for Espresso functionality.

Link copied to clipboard
open override val key: CoroutineContext.Key<*>

Sources

Link copied to clipboard