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

Commit 52ee635e authored by Behnam Heydarshahi's avatar Behnam Heydarshahi
Browse files

Add AnimatorTestRule to volume tests

Bug: b/290612381
Test: atest com.android.systemui.volume --iterations 10
Change-Id: I03127947635f6eb347d192aa1f9224fc20f123be
parent 9109717b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import com.android.internal.jank.InteractionJankMonitor;
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.animation.AnimatorTestRule;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.media.dialog.MediaOutputDialogFactory;
@@ -71,6 +72,7 @@ import com.android.systemui.statusbar.policy.FakeConfigurationController;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -129,6 +131,9 @@ public class VolumeDialogImplTest extends SysuiTestCase {
    private FakeFeatureFlags mFeatureFlags;
    private int mLongestHideShowAnimationDuration = 250;

    @Rule
    public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();

    @Before
    public void setup() throws Exception {
        MockitoAnnotations.initMocks(this);
@@ -234,7 +239,6 @@ public class VolumeDialogImplTest extends SysuiTestCase {
                | AccessibilityManager.FLAG_CONTENT_TEXT);
    }


    @Test
    public void testComputeTimeout_withHovering() {
        Mockito.reset(mAccessibilityMgr);
@@ -648,6 +652,7 @@ public class VolumeDialogImplTest extends SysuiTestCase {
    @After
    public void teardown() {
        setOrientation(mOriginalOrientation);
        mAnimatorTestRule.advanceTimeBy(mLongestHideShowAnimationDuration);
        mTestableLooper.moveTimeForward(mLongestHideShowAnimationDuration);
        mTestableLooper.processAllMessages();
        reset(mPostureController);