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

Commit 7b576a65 authored by Behnam Heydarshahi's avatar Behnam Heydarshahi Committed by Android (Google) Code Review
Browse files

Merge changes I03127947,Ic25cb02c into udc-qpr-dev

* changes:
  Add AnimatorTestRule to volume tests
  Clean up volume test handler last
parents b3d36e2a 52ee635e
Loading
Loading
Loading
Loading
+7 −2
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);
@@ -647,11 +651,12 @@ public class VolumeDialogImplTest extends SysuiTestCase {

    @After
    public void teardown() {
        cleanUp(mDialog);
        setOrientation(mOriginalOrientation);
        mAnimatorTestRule.advanceTimeBy(mLongestHideShowAnimationDuration);
        mTestableLooper.moveTimeForward(mLongestHideShowAnimationDuration);
        mTestableLooper.processAllMessages();
        reset(mPostureController);
        cleanUp(mDialog);
    }

    private void cleanUp(VolumeDialogImpl dialog) {