Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ class PagingDataDifferTest(
pagingSourceFactory = {
TestPagingSource(
loadDelay = 0,
loadDispatcher = loadDispatcher,
loadContext = loadDispatcher,
).also { pagingSources.add(it) }
}
),
Expand Down
1 change: 0 additions & 1 deletion testutils/testutils-paging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ plugins {
dependencies {
api(libs.kotlinStdlib)
implementation(project(":paging:paging-common"))
implementation(project(":internal-testutils-ktx"))
implementation(libs.kotlinTest)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package androidx.paging

import androidx.testutils.DirectDispatcher
import kotlinx.coroutines.CoroutineDispatcher
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext

Expand All @@ -33,7 +33,7 @@ class TestPagingSource(
override val jumpingSupported: Boolean = true,
val items: List<Int> = ITEMS,
private val loadDelay: Long = 1000,
private val loadDispatcher: CoroutineDispatcher = DirectDispatcher,
private val loadContext: CoroutineContext = EmptyCoroutineContext,
private val placeholdersEnabled: Boolean = true,
) : PagingSource<Int, Int>() {
var errorNextLoad = false
Expand All @@ -60,7 +60,7 @@ class TestPagingSource(
// execution of events.
delay(loadDelay)

return withContext(loadDispatcher) { getLoadResult(params) }
return withContext(loadContext) { getLoadResult(params) }
}

private fun getLoadResult(params: LoadParams<Int>): LoadResult<Int, Int> {
Expand Down