From 69d11c2e562aee839aa386052f9dcc712b431a3e Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Mon, 10 Jun 2019 23:52:32 -0700 Subject: [PATCH] Fixed an issue where test had lingering inflations Because we are overriding the mainLooper and certain tests had lingering inflations, when those inflation finished, the main handler had been changed again. We should really look into if this is 100% necessary in the future but this should fix the flakey tests. Fixes: 131413417 Test: atest SystemUITests Change-Id: I761eace99cbedc2fa57e90016152c6d29b351dc2 --- .../notification/row/NotificationContentInflaterTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java index 025296d14da4c..06ff0478a8042 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java @@ -101,7 +101,7 @@ public class NotificationContentInflaterTest extends SysuiTestCase { mNotificationInflater.setUsesIncreasedHeadsUpHeight(true); Notification.Builder builder = spy(mBuilder); mNotificationInflater.inflateNotificationViews( - false /* inflateSynchronously */, + true /* inflateSynchronously */, FLAG_CONTENT_VIEW_ALL, builder, mContext); @@ -113,7 +113,7 @@ public class NotificationContentInflaterTest extends SysuiTestCase { mNotificationInflater.setUsesIncreasedHeight(true); Notification.Builder builder = spy(mBuilder); mNotificationInflater.inflateNotificationViews( - false /* inflateSynchronously */, + true /* inflateSynchronously */, FLAG_CONTENT_VIEW_ALL, builder, mContext); @@ -161,6 +161,7 @@ public class NotificationContentInflaterTest extends SysuiTestCase { @Test public void testRemovedNotInflated() throws Exception { mRow.setRemoved(); + mNotificationInflater.setInflateSynchronously(true); mNotificationInflater.inflateNotificationViews(); Assert.assertNull(mRow.getEntry().getRunningTask()); }