Process all messages of TestLooper after each test

So that they won't process messages during the next test.

Test: atest SystemUITests
Fixes: 149740127
Change-Id: I082231b8f544f8b71f3404d247e10c3967c1c972
This commit is contained in:
Beverly
2020-02-24 15:18:05 -05:00
committed by Beverly Tai
parent 1e9bda44fc
commit 022e6635d6

View File

@@ -86,7 +86,9 @@ public abstract class SysuiTestCase {
public void SysuiTeardown() {
InstrumentationRegistry.registerInstance(mRealInstrumentation,
InstrumentationRegistry.getArguments());
// Reset the assert's testable looper to null.
if (TestableLooper.get(this) != null) {
TestableLooper.get(this).processAllMessages();
}
disallowTestableLooperAsMainThread();
SystemUIFactory.cleanup();
}