OSDN Git Service

Fixed a flakey test
authorSelim Cinek <cinek@google.com>
Fri, 8 Sep 2017 20:24:21 +0000 (13:24 -0700)
committerSelim Cinek <cinek@google.com>
Fri, 8 Sep 2017 20:24:21 +0000 (13:24 -0700)
Since the test could be off the UI thread, cancelling
would not be synchronized properly.

Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
Change-Id: Icfb02b637b76cdfb853c88130eabddf75203909b
Fixes: 65031224

packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java

index 12a4399..f8fd53d 100644 (file)
@@ -185,7 +185,9 @@ public class NotificationInflaterTest extends SysuiTestCase {
         countDownLatch.await();
     }
 
+    /* Cancelling requires us to be on the UI thread otherwise we might have a race */
     @Test
+    @UiThreadTest
     public void testSupersedesExistingTask() throws Exception {
         mNotificationInflater.inflateNotificationViews();
         mNotificationInflater.setIsLowPriority(true);