# utilitiesKt

*** ** * ** ***


```
public final class utilitiesKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final void` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/test/utils/utilitiesKt#doBlocking(kotlin.coroutines.CoroutineContext,kotlin.coroutines.SuspendFunction1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html context, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block )` Runs the given `https://developer.android.com/reference/androidx/media3/test/utils/package-summary#doBlocking(kotlin.coroutines.CoroutineContext,kotlin.coroutines.SuspendFunction1)` using `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/index.html` on the current thread for side effect. |

## Public methods

### doBlocking

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/utilities.kt+function:doBlocking)

```
@UnstableApi
public static final void doBlocking(
    @NonNull CoroutineContext context,
    @NonNull SuspendFunction1<@NonNull CoroutineScope, Unit> block
)
```

Runs the given `https://developer.android.com/reference/androidx/media3/test/utils/package-summary#doBlocking(kotlin.coroutines.CoroutineContext,kotlin.coroutines.SuspendFunction1)` using `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/index.html` on the current thread for side effect.

Using this function is like `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/index.html` with default context (which runs the given block on the calling thread) but forces the return type to be `Unit`, which is helpful when implementing suspending tests as expression functions:

```
@Test
fun myTest() = doBlocking {...}
```