From 21f336614c41bf872f02aebb5c40c2ec78f61870 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 8 Sep 2017 13:24:21 -0700 Subject: [PATCH] Fixed a flakey test 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 --- .../statusbar/notification/NotificationInflaterTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java index 12a4399fab2e4..f8fd53d9f88da 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java @@ -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);