diff options
| author | 2023-07-07 06:12:05 +0000 | |
|---|---|---|
| committer | 2023-07-07 06:12:05 +0000 | |
| commit | ba882dbe0545bc76fe4185e5c8014e7c80509abb (patch) | |
| tree | 91bf39428464502a897d6a45be3d14c08f92d550 | |
| parent | 5772ba2b1261cf8156619c809b4b149787a1d976 (diff) | |
| parent | 8be442c96e5e97e3330148ac861aa0b986ab9598 (diff) | |
Merge "fix(#Magnification): fix WindowMagnificationAnimationControllerTest test case fails on cf_x86_64 devices" into main am: 8eb8a95171 am: 3b6bf6842b am: d25f3aa7b2 am: 8be442c96e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2648167
Change-Id: I624f2ca32abc75221dfa53e2818ffcc6cbeb0a75
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationAnimationControllerTest.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationAnimationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationAnimationControllerTest.java index b5e0df5d733c..1ea4460d971f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationAnimationControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationAnimationControllerTest.java @@ -53,7 +53,6 @@ import com.android.systemui.util.settings.SecureSettings; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Answers; @@ -66,7 +65,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -@Ignore @LargeTest @RunWith(AndroidTestingRunner.class) public class WindowMagnificationAnimationControllerTest extends SysuiTestCase { @@ -74,8 +72,11 @@ public class WindowMagnificationAnimationControllerTest extends SysuiTestCase { private static final float DEFAULT_SCALE = 4.0f; private static final float DEFAULT_CENTER_X = 400.0f; private static final float DEFAULT_CENTER_Y = 500.0f; - // The duration couldn't too short, otherwise the ValueAnimator won't work in expectation. - private static final long ANIMATION_DURATION_MS = 300; + // The duration and period can't be too short, otherwise the ValueAnimator and + // Instrumentation.runOnMainSync won't work in expectation. (b/288926821) + private static final long ANIMATION_DURATION_MS = 600; + private static final long WAIT_FULL_ANIMATION_PERIOD = 1000; + private static final long WAIT_INTERMEDIATE_ANIMATION_PERIOD = 250; private AtomicReference<Float> mCurrentScale = new AtomicReference<>((float) 0); private AtomicReference<Float> mCurrentCenterX = new AtomicReference<>((float) 0); @@ -117,8 +118,8 @@ public class WindowMagnificationAnimationControllerTest extends SysuiTestCase { mWindowManager = spy(new TestableWindowManager(wm)); mContext.addMockSystemService(Context.WINDOW_SERVICE, mWindowManager); - mWaitingAnimationPeriod = 2 * ANIMATION_DURATION_MS; - mWaitIntermediateAnimationPeriod = ANIMATION_DURATION_MS / 2; + mWaitingAnimationPeriod = WAIT_FULL_ANIMATION_PERIOD; + mWaitIntermediateAnimationPeriod = WAIT_INTERMEDIATE_ANIMATION_PERIOD; mWindowMagnificationAnimationController = new WindowMagnificationAnimationController( mContext, newValueAnimator()); mController = new SpyWindowMagnificationController(mContext, mHandler, |