Skip to content

Commit

Permalink
test: fix test to devices with no flash unit
Browse files Browse the repository at this point in the history
  • Loading branch information
ujizin committed Dec 10, 2023
1 parent f802d9d commit 4b362be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ internal class CaptureModeTest : CameraTest() {
}

private companion object {
private const val RECORD_VIDEO_DELAY = 1000L
private const val RECORD_VIDEO_DELAY = 2000L
private const val IMAGE_TEST_FILENAME = "capture_mode_test.jpg"
private const val VIDEO_TEST_FILENAME = "capture_mode_test.mp4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class FlashModeTest : CameraTest() {
@Test
fun test_flashModes() = with(composeTestRule) {
initFlashCamera(camSelector = CamSelector.Back)
if (!cameraState.hasFlashUnit) return

FlashMode.values().forEach { mode ->
flashMode.value = mode
Expand All @@ -39,7 +40,7 @@ internal class FlashModeTest : CameraTest() {
cameraState.hasFlashUnit = false

flashMode.value = FlashMode.On
onNodeWithTag("${flashMode.value}").assertDoesNotExist()
onNodeWithTag("${FlashMode.On}").assertDoesNotExist()
runOnIdle { assertEquals(FlashMode.Off, cameraState.flashMode) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ internal class ImageAnalyzerTest : CameraTest() {
@Test
fun test_imageAnalysisSupported() = with(composeTestRule) {
var expectImageAnalysisSupported: Boolean? = null
initImageAnalyzerCamera(isImageAnalyzeEnabled = true) {
expectImageAnalysisSupported = cameraState.isImageAnalysisSupported()
}
initImageAnalyzerCamera(isImageAnalyzeEnabled = true)

expectImageAnalysisSupported = cameraState.isImageAnalysisSupported()

runOnIdle {
assertEquals(expectImageAnalysisSupported, cameraState.isImageAnalysisSupported)
Expand Down

0 comments on commit 4b362be

Please sign in to comment.