Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e904b3ec authored by Jerry Liu's avatar Jerry Liu
Browse files

Remove unnecessary use of argumentCaptor in screen record tests

Bug: 435695695
Test: atest ScreenRecordTileTest
Test: atest ScreenRecordTileUserActionInteractorTest
Flag: EXEMPT test only change
Change-Id: I06d027e6eb4e559a781a6e649ec1afc09e9160b2
parent 990fdf54
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -253,8 +253,7 @@ public class ScreenRecordTileTest extends SysuiTestCase {
        mTile.handleClick(null /* view */);
        mTestableLooper.processAllMessages();

        ArgumentCaptor<Runnable> onStartRecordingClicked = ArgumentCaptor.forClass(Runnable.class);
        verify(mController).createScreenRecordDialog(onStartRecordingClicked.capture());
        verify(mController).createScreenRecordDialog(any());
    }

    // Test that the tile is active and labeled correctly when the controller is recording
+4 −12
Original line number Diff line number Diff line
@@ -106,9 +106,7 @@ class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() {
        underTest.apply { overrideResource(R.bool.config_enableLargeScreenScreencapture, true) }

        underTest.handleInput(QSTileInputTestKtx.click(recordingModel))
        val onStartRecordingClickedCaptor = argumentCaptor<Runnable>()
        verify(screenRecordUxController, never())
            .createScreenRecordDialog(onStartRecordingClickedCaptor.capture())
        verify(screenRecordUxController, never()).createScreenRecordDialog(any())
    }

    // Test that clicking the tile not in large screen opens the recording dialog when the flag is
@@ -119,9 +117,7 @@ class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() {
        val recordingModel = ScreenRecordModel.DoingNothing

        underTest.handleInput(QSTileInputTestKtx.click(recordingModel))
        val onStartRecordingClickedCaptor = argumentCaptor<Runnable>()
        verify(screenRecordUxController)
            .createScreenRecordDialog(onStartRecordingClickedCaptor.capture())
        verify(screenRecordUxController).createScreenRecordDialog(any())
    }

    @Test
@@ -130,9 +126,7 @@ class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() {
        val recordingModel = ScreenRecordModel.DoingNothing

        underTest.handleInput(QSTileInputTestKtx.click(recordingModel))
        val onStartRecordingClickedCaptor = argumentCaptor<Runnable>()
        verify(screenRecordUxController)
            .createScreenRecordDialog(onStartRecordingClickedCaptor.capture())
        verify(screenRecordUxController).createScreenRecordDialog(any())
    }

    @Test
@@ -181,9 +175,7 @@ class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() {
        underTest.handleInput(
            QSTileInputTestKtx.click(recordingModel, UserHandle.CURRENT, expandable)
        )
        val onStartRecordingClickedCaptor = argumentCaptor<Runnable>()
        verify(screenRecordUxController)
            .createScreenRecordDialog(onStartRecordingClickedCaptor.capture())
        verify(screenRecordUxController).createScreenRecordDialog(any())

        val onDismissActionCaptor = argumentCaptor<OnDismissAction>()
        verify(keyguardDismissUtil)