summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java12
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java12
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java8
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;
}