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

Commit 845fa16d authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Clean up some AnimatorTestRule usages

Bug: 291645410
Test: atest SystemUITests
Change-Id: I76bdcfce2ec02315b26ac26fa4a9434896fa6d28
parent 8aef12b5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ import com.android.systemui.util.settings.SecureSettings;
import com.android.systemui.util.time.FakeSystemClock;

import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -136,8 +136,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
    private StatusBarWindowStateController mStatusBarWindowStateController;
    @Mock
    private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    @ClassRule
    public static AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
    @Rule
    public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();

    private List<StatusBarWindowStateListener> mStatusBarWindowStateListeners = new ArrayList<>();

+3 −3
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ import com.android.systemui.statusbar.phone.LightBarController;

import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -111,8 +111,8 @@ public class RemoteInputViewTest extends SysuiTestCase {
    private BlockingQueueIntentReceiver mReceiver;
    private final UiEventLoggerFake mUiEventLoggerFake = new UiEventLoggerFake();

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

    @Before
    public void setUp() throws Exception {
+0 −4
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.animation.AnimatorTestRule;
import android.app.KeyguardManager;
import android.content.res.Configuration;
import android.media.AudioManager;
@@ -85,8 +84,6 @@ import java.util.function.Predicate;
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
public class VolumeDialogImplTest extends SysuiTestCase {
    private static final AnimatorTestRule sAnimatorTestRule = new AnimatorTestRule();

    VolumeDialogImpl mDialog;
    View mActiveRinger;
    View mDrawerContainer;
@@ -727,7 +724,6 @@ public class VolumeDialogImplTest extends SysuiTestCase {
    public void teardown() {
        cleanUp(mDialog);
        setOrientation(mOriginalOrientation);
        sAnimatorTestRule.advanceTimeBy(mLongestHideShowAnimationDuration);
        mTestableLooper.moveTimeForward(mLongestHideShowAnimationDuration);
        mTestableLooper.processAllMessages();
        reset(mPostureController);
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ import java.util.function.Consumer;
 * public class SampleAnimatorTest {
 *
 *     {@literal @}Rule
 *     public AnimatorTestRule sAnimatorTestRule = new AnimatorTestRule();
 *     public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
 *
 *     {@literal @}UiThreadTest
 *     {@literal @}Test
@@ -58,7 +58,7 @@ import java.util.function.Consumer;
 *         animator.setDuration(1000L);
 *         assertThat(animator.getAnimatedValue(), is(0));
 *         animator.start();
 *         sAnimatorTestRule.advanceTimeBy(500L);
 *         mAnimatorTestRule.advanceTimeBy(500L);
 *         assertThat(animator.getAnimatedValue(), is(500));
 *     }
 * }