Loading packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotExecutor.kt +3 −3 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ constructor( */ suspend fun executeScreenshots( screenshotRequest: ScreenshotRequest, onSaved: (Uri) -> Unit, onSaved: (Uri?) -> Unit, requestCallback: RequestCallback ) { val displayIds = getDisplaysToScreenshot(screenshotRequest.type) Loading @@ -70,7 +70,7 @@ constructor( /** All logging should be triggered only by this method. */ private suspend fun dispatchToController( rawScreenshotData: ScreenshotData, onSaved: (Uri) -> Unit, onSaved: (Uri?) -> Unit, callback: RequestCallback ) { // Let's wait before logging "screenshot requested", as we should log the processed Loading Loading @@ -173,7 +173,7 @@ constructor( /** For java compatibility only. see [executeScreenshots] */ fun executeScreenshotsAsync( screenshotRequest: ScreenshotRequest, onSaved: Consumer<Uri>, onSaved: Consumer<Uri?>, requestCallback: RequestCallback ) { mainScope.launch("TakeScreenshotService#executeScreenshotsAsync") { Loading packages/SystemUI/tests/src/com/android/systemui/screenshot/TakeScreenshotExecutorTest.kt +39 −19 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.systemui.util.mockito.nullable import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import java.lang.IllegalStateException import java.util.function.Consumer import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runCurrent Loading Loading @@ -78,7 +79,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_severalDisplays_callsControllerForEachOne() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) verify(controllerFactory).create(eq(0), any()) Loading Loading @@ -107,7 +108,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_providedImageType_callsOnlyDefaultDisplayController() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots( createScreenshotRequest(TAKE_SCREENSHOT_PROVIDED_IMAGE), onSaved, Loading Loading @@ -136,7 +137,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_onlyVirtualDisplays_noInteractionsWithControllers() = testScope.runTest { setDisplays(display(TYPE_VIRTUAL, id = 0), display(TYPE_VIRTUAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) verifyNoMoreInteractions(controllerFactory) Loading @@ -154,7 +155,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { display(TYPE_OVERLAY, id = 2), display(TYPE_WIFI, id = 3) ) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) verify(controller0, times(4)).handleScreenshot(any(), any(), any()) Loading @@ -165,7 +166,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_reportsOnFinishedOnlyWhenBothFinished() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) val capturer0 = ArgumentCaptor<TakeScreenshotService.RequestCallback>() Loading @@ -190,7 +191,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_oneFinishesOtherFails_reportFailsOnlyAtTheEnd() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) val capturer0 = ArgumentCaptor<TakeScreenshotService.RequestCallback>() Loading @@ -217,7 +218,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_allDisplaysFail_reportsFail() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) val capturer0 = ArgumentCaptor<TakeScreenshotService.RequestCallback>() Loading @@ -244,7 +245,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun onDestroy_propagatedToControllers() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.onDestroy() Loading @@ -256,7 +257,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun removeWindows_propagatedToControllers() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.removeWindows() Loading @@ -270,7 +271,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun onCloseSystemDialogsReceived_propagatedToControllers() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.onCloseSystemDialogsReceived() Loading @@ -286,7 +287,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) whenever(controller0.isPendingSharedTransition).thenReturn(true) whenever(controller1.isPendingSharedTransition).thenReturn(false) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.onCloseSystemDialogsReceived() Loading @@ -304,7 +305,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { val toBeReturnedByProcessor = ScreenshotData.forTesting() requestProcessor.toReturn = toBeReturnedByProcessor val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(screenshotRequest, onSaved, callback) assertThat(requestProcessor.processed) Loading @@ -321,7 +322,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessor_logsScreenshotRequested() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -338,7 +339,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessor_logsUiError() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -355,7 +356,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessorOnDefaultDisplay_showsErrorNotification() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -368,7 +369,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessorOnSecondaryDisplay_showsErrorNotification() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -381,7 +382,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromScreenshotController_reportsRequested() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } whenever(controller0.handleScreenshot(any(), any(), any())) .thenThrow(IllegalStateException::class.java) whenever(controller1.handleScreenshot(any(), any(), any())) Loading @@ -401,7 +402,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromScreenshotController_reportsError() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } whenever(controller0.handleScreenshot(any(), any(), any())) .thenThrow(IllegalStateException::class.java) whenever(controller1.handleScreenshot(any(), any(), any())) Loading @@ -421,7 +422,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromScreenshotController_showsErrorNotification() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } whenever(controller0.handleScreenshot(any(), any(), any())) .thenThrow(IllegalStateException::class.java) whenever(controller1.handleScreenshot(any(), any(), any())) Loading @@ -434,6 +435,25 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { screenshotExecutor.onDestroy() } @Test fun executeScreenshots_finisherCalledWithNullUri_succeeds() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0)) var onSavedCallCount = 0 val onSaved: (Uri?) -> Unit = { assertThat(it).isNull() onSavedCallCount += 1 } whenever(controller0.handleScreenshot(any(), any(), any())).thenAnswer { (it.getArgument(1) as Consumer<Uri?>).accept(null) } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) assertThat(onSavedCallCount).isEqualTo(1) screenshotExecutor.onDestroy() } private suspend fun TestScope.setDisplays(vararg displays: Display) { fakeDisplayRepository.emit(displays.toSet()) runCurrent() Loading Loading
packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotExecutor.kt +3 −3 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ constructor( */ suspend fun executeScreenshots( screenshotRequest: ScreenshotRequest, onSaved: (Uri) -> Unit, onSaved: (Uri?) -> Unit, requestCallback: RequestCallback ) { val displayIds = getDisplaysToScreenshot(screenshotRequest.type) Loading @@ -70,7 +70,7 @@ constructor( /** All logging should be triggered only by this method. */ private suspend fun dispatchToController( rawScreenshotData: ScreenshotData, onSaved: (Uri) -> Unit, onSaved: (Uri?) -> Unit, callback: RequestCallback ) { // Let's wait before logging "screenshot requested", as we should log the processed Loading Loading @@ -173,7 +173,7 @@ constructor( /** For java compatibility only. see [executeScreenshots] */ fun executeScreenshotsAsync( screenshotRequest: ScreenshotRequest, onSaved: Consumer<Uri>, onSaved: Consumer<Uri?>, requestCallback: RequestCallback ) { mainScope.launch("TakeScreenshotService#executeScreenshotsAsync") { Loading
packages/SystemUI/tests/src/com/android/systemui/screenshot/TakeScreenshotExecutorTest.kt +39 −19 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.systemui.util.mockito.nullable import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import java.lang.IllegalStateException import java.util.function.Consumer import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runCurrent Loading Loading @@ -78,7 +79,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_severalDisplays_callsControllerForEachOne() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) verify(controllerFactory).create(eq(0), any()) Loading Loading @@ -107,7 +108,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_providedImageType_callsOnlyDefaultDisplayController() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots( createScreenshotRequest(TAKE_SCREENSHOT_PROVIDED_IMAGE), onSaved, Loading Loading @@ -136,7 +137,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_onlyVirtualDisplays_noInteractionsWithControllers() = testScope.runTest { setDisplays(display(TYPE_VIRTUAL, id = 0), display(TYPE_VIRTUAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) verifyNoMoreInteractions(controllerFactory) Loading @@ -154,7 +155,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { display(TYPE_OVERLAY, id = 2), display(TYPE_WIFI, id = 3) ) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) verify(controller0, times(4)).handleScreenshot(any(), any(), any()) Loading @@ -165,7 +166,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_reportsOnFinishedOnlyWhenBothFinished() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) val capturer0 = ArgumentCaptor<TakeScreenshotService.RequestCallback>() Loading @@ -190,7 +191,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_oneFinishesOtherFails_reportFailsOnlyAtTheEnd() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) val capturer0 = ArgumentCaptor<TakeScreenshotService.RequestCallback>() Loading @@ -217,7 +218,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_allDisplaysFail_reportsFail() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) val capturer0 = ArgumentCaptor<TakeScreenshotService.RequestCallback>() Loading @@ -244,7 +245,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun onDestroy_propagatedToControllers() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.onDestroy() Loading @@ -256,7 +257,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun removeWindows_propagatedToControllers() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.removeWindows() Loading @@ -270,7 +271,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun onCloseSystemDialogsReceived_propagatedToControllers() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.onCloseSystemDialogsReceived() Loading @@ -286,7 +287,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) whenever(controller0.isPendingSharedTransition).thenReturn(true) whenever(controller1.isPendingSharedTransition).thenReturn(false) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) screenshotExecutor.onCloseSystemDialogsReceived() Loading @@ -304,7 +305,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { val toBeReturnedByProcessor = ScreenshotData.forTesting() requestProcessor.toReturn = toBeReturnedByProcessor val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } screenshotExecutor.executeScreenshots(screenshotRequest, onSaved, callback) assertThat(requestProcessor.processed) Loading @@ -321,7 +322,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessor_logsScreenshotRequested() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -338,7 +339,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessor_logsUiError() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -355,7 +356,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessorOnDefaultDisplay_showsErrorNotification() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -368,7 +369,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromProcessorOnSecondaryDisplay_showsErrorNotification() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } requestProcessor.shouldThrowException = true screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) Loading @@ -381,7 +382,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromScreenshotController_reportsRequested() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } whenever(controller0.handleScreenshot(any(), any(), any())) .thenThrow(IllegalStateException::class.java) whenever(controller1.handleScreenshot(any(), any(), any())) Loading @@ -401,7 +402,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromScreenshotController_reportsError() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } whenever(controller0.handleScreenshot(any(), any(), any())) .thenThrow(IllegalStateException::class.java) whenever(controller1.handleScreenshot(any(), any(), any())) Loading @@ -421,7 +422,7 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { fun executeScreenshots_errorFromScreenshotController_showsErrorNotification() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0), display(TYPE_EXTERNAL, id = 1)) val onSaved = { _: Uri -> } val onSaved = { _: Uri? -> } whenever(controller0.handleScreenshot(any(), any(), any())) .thenThrow(IllegalStateException::class.java) whenever(controller1.handleScreenshot(any(), any(), any())) Loading @@ -434,6 +435,25 @@ class TakeScreenshotExecutorTest : SysuiTestCase() { screenshotExecutor.onDestroy() } @Test fun executeScreenshots_finisherCalledWithNullUri_succeeds() = testScope.runTest { setDisplays(display(TYPE_INTERNAL, id = 0)) var onSavedCallCount = 0 val onSaved: (Uri?) -> Unit = { assertThat(it).isNull() onSavedCallCount += 1 } whenever(controller0.handleScreenshot(any(), any(), any())).thenAnswer { (it.getArgument(1) as Consumer<Uri?>).accept(null) } screenshotExecutor.executeScreenshots(createScreenshotRequest(), onSaved, callback) assertThat(onSavedCallCount).isEqualTo(1) screenshotExecutor.onDestroy() } private suspend fun TestScope.setDisplays(vararg displays: Display) { fakeDisplayRepository.emit(displays.toSet()) runCurrent() Loading