diff options
| author | 2019-02-21 05:03:52 +0000 | |
|---|---|---|
| committer | 2019-02-21 05:03:52 +0000 | |
| commit | 57d03473ea9622a75a14a0ecbc24e4725d94cb07 (patch) | |
| tree | b978bedcea057218a885fa26a608403a4a9de0f0 | |
| parent | 0d40e2de23f5a9da312b3e6883bea7347857ed36 (diff) | |
| parent | f77d53d73b1d61e6a0231aa9024b0dd333657271 (diff) | |
Merge "Fix AppWindowTokenAnimationTests and add them to presubmit"
3 files changed, 25 insertions, 7 deletions
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java b/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java index dd5f32d248b7..108ee180b4b7 100644 --- a/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java @@ -27,10 +27,9 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; +import android.platform.test.annotations.Presubmit; import android.view.SurfaceControl; -import androidx.test.filters.SmallTest; - import com.android.server.wm.WindowTestUtils.TestAppWindowToken; import org.junit.Before; @@ -39,13 +38,18 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import androidx.test.filters.FlakyTest; +import androidx.test.filters.SmallTest; + /** * Animation related tests for the {@link AppWindowToken} class. * * Build/Install/Run: - * atest FrameworksServicesTests:AppWindowTokenAnimationTests + * atest AppWindowTokenAnimationTests */ @SmallTest +@Presubmit +@FlakyTest(bugId = 124357362) public class AppWindowTokenAnimationTests extends WindowTestsBase { private TestAppWindowToken mToken; @@ -60,7 +64,7 @@ public class AppWindowTokenAnimationTests extends WindowTestsBase { MockitoAnnotations.initMocks(this); mToken = createTestAppWindowToken(mDisplayContent, WINDOWING_MODE_FULLSCREEN, - ACTIVITY_TYPE_STANDARD); + ACTIVITY_TYPE_STANDARD, false /* skipOnParentChanged */); mToken.setPendingTransaction(mTransaction); } diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java index 99cbb8185676..5bfa0c6e0885 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java @@ -57,7 +57,14 @@ class WindowTestUtils { static TestAppWindowToken createTestAppWindowToken(DisplayContent dc) { synchronized (dc.mWmService.mGlobalLock) { - return new TestAppWindowToken(dc); + return new TestAppWindowToken(dc, true /* skipOnParentChanged */); + } + } + + static TestAppWindowToken createTestAppWindowToken(DisplayContent dc, + boolean skipOnParentChanged) { + synchronized (dc.mWmService.mGlobalLock) { + return new TestAppWindowToken(dc, skipOnParentChanged); } } @@ -68,7 +75,7 @@ class WindowTestUtils { private Transaction mPendingTransactionOverride; boolean mSkipOnParentChanged = true; - private TestAppWindowToken(DisplayContent dc) { + private TestAppWindowToken(DisplayContent dc, boolean skipOnParentChanged) { super(dc.mWmService, new IApplicationToken.Stub() { @Override public String getName() { @@ -76,6 +83,7 @@ class WindowTestUtils { } }, new ComponentName("", ""), false, dc, true /* fillsParent */); mTargetSdk = Build.VERSION_CODES.CUR_DEVELOPMENT; + mSkipOnParentChanged = skipOnParentChanged; } int getWindowsCount() { diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java index 5ed39b2766e7..0d7d085ab1b4 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java @@ -256,10 +256,16 @@ class WindowTestsBase { WindowTestUtils.TestAppWindowToken createTestAppWindowToken(DisplayContent dc, int windowingMode, int activityType) { + return createTestAppWindowToken(dc, windowingMode, activityType, + true /*skipOnParentChanged */); + } + + WindowTestUtils.TestAppWindowToken createTestAppWindowToken(DisplayContent dc, int + windowingMode, int activityType, boolean skipOnParentChanged) { final TaskStack stack = createTaskStackOnDisplay(windowingMode, activityType, dc); final Task task = createTaskInStack(stack, 0 /* userId */); final WindowTestUtils.TestAppWindowToken appWindowToken = - WindowTestUtils.createTestAppWindowToken(dc); + WindowTestUtils.createTestAppWindowToken(dc, skipOnParentChanged); task.addChild(appWindowToken, 0); return appWindowToken; } |