From 2d2d51adcfeda7bb644e30f9518331da3727cb94 Mon Sep 17 00:00:00 2001 From: George Mount Date: Tue, 16 May 2017 15:12:06 -0700 Subject: Attempt to fix broken/flaky FadeTransitionTest Bug 38349552 This is a blind fix for the test, but it should reduce flakiness by removing the use of Thread.sleep(). Test: ran FadeTransitionTest Change-Id: I3156c354b370c34885dfbfd7ecd1b5908a9dab44 --- .../src/android/transition/FadeTransitionTest.java | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/core/tests/coretests/src/android/transition/FadeTransitionTest.java b/core/tests/coretests/src/android/transition/FadeTransitionTest.java index 7e7e8151cc50..0140a04269b6 100644 --- a/core/tests/coretests/src/android/transition/FadeTransitionTest.java +++ b/core/tests/coretests/src/android/transition/FadeTransitionTest.java @@ -50,7 +50,7 @@ public class FadeTransitionTest extends ActivityInstrumentationTestCase2 0 && transitionAlpha < 1); @@ -77,7 +77,7 @@ public class FadeTransitionTest extends ActivityInstrumentationTestCase2 0) { + mActivity.getWindow().getDecorView().postOnAnimation(this); + } + } + }); + assertTrue(latch.await(1, TimeUnit.SECONDS)); + } + public static class TransitionLatch implements TransitionListener { public CountDownLatch startLatch = new CountDownLatch(1); public CountDownLatch endLatch = new CountDownLatch(1); -- cgit v1.2.3-59-g8ed1b