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
This commit is contained in:
Selim Cinek
2019-06-10 23:52:32 -07:00
parent 85c951601a
commit 69d11c2e56

View File

@@ -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());
}