# IdlingResourceOwner

Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/IdlingResourceOwner.kt+class:androidx.compose.ui.test.IdlingResourceOwner) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface IdlingResourceOwner
  ```
Known direct subclasses [AndroidComposeUiTest](https://developer.android.com/reference/kotlin/androidx/compose/ui/test/AndroidComposeUiTest)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/AndroidComposeUiTest` | Variant of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTest` for when you want to have access the current `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/AndroidComposeUiTest#activity()` of type `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/AndroidComposeUiTest`. |

*** ** * ** ***

An interface for `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTest` implementations that support registering and unregistering `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource`s.

Implementing this interface indicates that the test environment allows synchronization with asynchronous operations via idling resources. While supported on Android and Desktop, this capability is currently not available on all targets (such as Web).

Usage of these APIs should generally be guarded by a check to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.ComposeUiTest).isIdlingResourceSupported()`.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResourceOwner#registerIdlingResource(androidx.compose.ui.test.IdlingResource)(idlingResource: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource)` Registers an `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource` in this test. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResourceOwner#unregisterIdlingResource(androidx.compose.ui.test.IdlingResource)(idlingResource: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource)` Unregisters an `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource` from this test. | Cmn |

## Public functions

### registerIdlingResource

Cmn Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
fun registerIdlingResource(idlingResource: IdlingResource): Unit
```

Registers an `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource` in this test.

### unregisterIdlingResource

Cmn Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
fun unregisterIdlingResource(idlingResource: IdlingResource): Unit
```

Unregisters an `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/IdlingResource` from this test.