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

Commit dd1b72ca authored by Behnam Heydarshahi's avatar Behnam Heydarshahi
Browse files

Volume Test: allow and set testable looper as main

Otherwise, when some animations are running, AnimatorTestRule will not
be able to advance time forward.

Bug: b/297573803

Test: atest VolumeDialogImplTest --iterations 4
Change-Id: If90cb8cbad198c47b669b077f3c188932528d420
parent 433adc3e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ import java.util.function.Predicate;

@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@TestableLooper.RunWithLooper(setAsMainLooper = true)
public class VolumeDialogImplTest extends SysuiTestCase {
    VolumeDialogImpl mDialog;
    View mActiveRinger;
@@ -141,6 +141,7 @@ public class VolumeDialogImplTest extends SysuiTestCase {
        getContext().addMockSystemService(KeyguardManager.class, mKeyguard);

        mTestableLooper = TestableLooper.get(this);
        allowTestableLooperAsMainThread();

        when(mPostureController.getDevicePosture())
                .thenReturn(DevicePostureController.DEVICE_POSTURE_CLOSED);