Skip to content
Closed
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 @@ -25,7 +25,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.filterIsInstance
Expand Down Expand Up @@ -221,10 +220,7 @@ class CachingTest {
assertThat(tracker.pageEventFlowCount()).isEqualTo(0)
assertThat(tracker.pageDataFlowCount()).isEqualTo(0)
val items = runBlocking {
pageFlow.collectItemsUntilSize(9) {
// see http://b/146676984
delay(10)
}
pageFlow.collectItemsUntilSize(9)
}
val firstList = buildItems(
version = 0,
Expand All @@ -234,10 +230,7 @@ class CachingTest {
)
assertThat(tracker.pageDataFlowCount()).isEqualTo(1)
val items2 = runBlocking {
pageFlow.collectItemsUntilSize(21) {
// see http://b/146676984
delay(10)
}
pageFlow.collectItemsUntilSize(21)
}
assertThat(items2).isEqualTo(
buildItems(
Expand Down Expand Up @@ -401,7 +394,6 @@ class CachingTest {

private suspend fun Flow<PagingData<Item>>.collectItemsUntilSize(
expectedSize: Int,
onEach: (suspend () -> Unit)? = null
): List<Item> {
return this
.mapLatest { pagingData ->
Expand All @@ -411,9 +403,6 @@ class CachingTest {
val receiver = pagingData.hintReceiver
var loadedPageCount = 0
pagingData.flow.filterIsInstance<PageEvent.Insert<Item>>()
.onEach {
onEach?.invoke()
}
.onEach {
items.addAll(
it.pages.flatMap {
Expand Down