Skip to content

Commit

Permalink
Fix FakeCameraUseCaseTest compilation errors (#262)
Browse files Browse the repository at this point in the history
This test was missed during the concurrent camera refactor.
 Fixed with two changes fixing build failures.
  • Loading branch information
temcguir authored Sep 9, 2024
1 parent 34d4bec commit 8e90b3e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.google.jetpackcamera.settings.model.FlashMode
import com.google.jetpackcamera.settings.model.LensFacing
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.consumeAsFlow
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.StandardTestDispatcher
Expand All @@ -40,7 +41,7 @@ class FakeCameraUseCaseTest {
private val testScope = TestScope()
private val testDispatcher = StandardTestDispatcher(testScope.testScheduler)

private val cameraUseCase = FakeCameraUseCase(testScope)
private val cameraUseCase = FakeCameraUseCase()

@Before
fun setup() {
Expand Down Expand Up @@ -128,7 +129,7 @@ class FakeCameraUseCaseTest {
initAndRunCamera()
val events = mutableListOf<CameraUseCase.ScreenFlashEvent>()
backgroundScope.launch(UnconfinedTestDispatcher(testScheduler)) {
cameraUseCase.getScreenFlashEvents().toList(events)
cameraUseCase.getScreenFlashEvents().consumeAsFlow().toList(events)
}

// FlashMode.ON in front facing camera automatically enables screen flash
Expand Down

0 comments on commit 8e90b3e

Please sign in to comment.