summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yunfan Chen <yunfanc@google.com> 2019-03-07 10:08:08 +0900
committer Yunfan Chen <yunfanc@google.com> 2019-03-07 10:08:08 +0900
commitc1f3e3787027c40e402b7e27aa3ac0eb3ef73f92 (patch)
tree59e887cb48c3c5b525848dd8d3db11167917d836
parent756bbab5d0503486848e7870eed52d9ec53a088f (diff)
Fixed flaky testTaskChangeCallbacks and promote three tests to presubmit
The testTaskChangeCallbacks was flaky because the callback onTaskRemoved can be called after finishAndRemoveTask is called. However, the original test will assert the callback was not called after calling the finishAndRemoveTask and wait for the callback afterwards. To fix it, only ensure the callback was not called before the finishAndRemoveTask get called. The other three tests are no longer flaky and promote them to pre-submit. Test: atest TaskStackChangedListenerTest Bug: 123654474 Bug: 74078662 Change-Id: Ie064ae00a4b2493e5aa0f47e1418ce2d25b503de
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java2
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java4
2 files changed, 1 insertions, 5 deletions
diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
index 763ea6293fcc..a03d28b47057 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
@@ -40,7 +40,6 @@ import android.util.SparseBooleanArray;
import android.view.IRecentsAnimationRunner;
import android.view.SurfaceControl;
-import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
@@ -113,7 +112,6 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
}
@Test
- @FlakyTest(bugId = 117117823)
public void testIncludedApps_expectTargetAndVisible() {
mWm.setRecentsAnimationController(mController);
final AppWindowToken homeAppWindow = createAppWindowToken(mDisplayContent,
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
index 42a205a2fb3d..b140da501c38 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
@@ -100,7 +100,6 @@ public class TaskStackChangedListenerTest {
}
@Test
- @FlakyTest(detail = "Promote to presubmit when shown to be stable.")
public void testTaskDescriptionChanged() throws Exception {
final Object[] params = new Object[2];
final CountDownLatch latch = new CountDownLatch(1);
@@ -133,7 +132,6 @@ public class TaskStackChangedListenerTest {
}
@Test
- @FlakyTest(detail = "Promote to presubmit when shown to be stable.")
public void testActivityRequestedOrientationChanged() throws Exception {
final int[] params = new int[2];
final CountDownLatch latch = new CountDownLatch(1);
@@ -214,6 +212,7 @@ public class TaskStackChangedListenerTest {
// Test for onTaskRemovalStarted.
assertEquals(1, taskRemovalStartedLatch.getCount());
+ assertEquals(1, taskRemovedLatch.getCount());
activity.finishAndRemoveTask();
waitForCallback(taskRemovalStartedLatch);
// onTaskRemovalStarted happens before the activity's window is removed.
@@ -221,7 +220,6 @@ public class TaskStackChangedListenerTest {
assertEquals(id, params[0]);
// Test for onTaskRemoved.
- assertEquals(1, taskRemovedLatch.getCount());
waitForCallback(taskRemovedLatch);
assertEquals(id, params[0]);
waitForCallback(onDetachedFromWindowLatch);