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

Commit 36321786 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Remove dismiss animation in tests

Sets the dismiss runnable of the dialog to null to guarantee that there
are no dismiss animations that could trigger code outside of the test.

Test: atest GlobalActionsDialogLitTest
Fixes: 402561781
Flag: EXEMPT test bugfix
Change-Id: Idd827cdc60425da68244e6acafcabc3a46b32269
parent d04635b1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -618,6 +618,8 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase {
        when(mKeyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(true);
        mGlobalActionsDialogLite.showOrHideDialog(true, true, null /* view */,
                Display.DEFAULT_DISPLAY);
        // Clear the dismiss override so we don't have behavior after dismissing the dialog
        mGlobalActionsDialogLite.mDialog.setDismissOverride(null);

        // Then smart lock will be disabled
        verify(mLockPatternUtils).requireCredentialEntry(eq(expectedUser));
@@ -739,6 +741,8 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase {

        // Show dialog with keyguard showing
        mGlobalActionsDialogLite.showOrHideDialog(true, true, null, Display.DEFAULT_DISPLAY);
        // Clear the dismiss override so we don't have behavior after dismissing the dialog
        mGlobalActionsDialogLite.mDialog.setDismissOverride(null);

        assertOneItemOfType(mGlobalActionsDialogLite.mItems,
                GlobalActionsDialogLite.SystemUpdateAction.class);
@@ -764,12 +768,15 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase {

        // Show dialog with keyguard showing
        mGlobalActionsDialogLite.showOrHideDialog(false, false, null, Display.DEFAULT_DISPLAY);
        // Clear the dismiss override so we don't have behavior after dismissing the dialog
        mGlobalActionsDialogLite.mDialog.setDismissOverride(null);

        assertNoItemsOfType(mGlobalActionsDialogLite.mItems,
                GlobalActionsDialogLite.SystemUpdateAction.class);

        // Hide dialog
        mGlobalActionsDialogLite.showOrHideDialog(false, false, null, Display.DEFAULT_DISPLAY);

    }

    @Test
@@ -783,6 +790,8 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase {

        mGlobalActionsDialogLite.showOrHideDialog(false, true, null, Display.DEFAULT_DISPLAY);
        mTestableLooper.processAllMessages();
        // Clear the dismiss override so we don't have behavior after dismissing the dialog
        mGlobalActionsDialogLite.mDialog.setDismissOverride(null);

        assertThat(mGlobalActionsDialogLite.mDialog.isShowing()).isTrue();