Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e7d837c authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fail any SysuiTestCase that leaks a Log.wtf

Bug: 381916615
Flag: TEST_ONLY
Test: presubmit
Change-Id: I97552d0a2bc4c437d36e827a1017f60984dcf13c
parent dbd9c5b1
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ import com.android.systemui.flags.DisableSceneContainer;
import com.android.systemui.flags.EnableSceneContainer;
import com.android.systemui.flags.FakeFeatureFlagsClassic;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.log.LogWtfHandlerRule;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.recents.LauncherProxyService;
import com.android.systemui.settings.UserTracker;
@@ -108,7 +107,6 @@ import kotlinx.coroutines.flow.StateFlow;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -207,8 +205,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
    private final FakeExecutor mBackgroundExecutor = new FakeExecutor(mFakeSystemClock);
    private final Executor mMainExecutor = Runnable::run; // Direct executor

    @Rule public final LogWtfHandlerRule wtfHandlerRule = new LogWtfHandlerRule();

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);
+3 −0
Original line number Diff line number Diff line
@@ -2051,6 +2051,9 @@ public class BubblesTest extends SysuiTestCase {

    @Test
    public void testShowStackEdu_isConversationBubble() {
        // TODO(b/401025577): Prevent this test from raising a WTF, and remove this exemption
        mLogWtfRule.addFailureLogExemption(log-> log.getTag().equals("FloatingCoordinator"));

        // Setup
        setPrefBoolean(StackEducationView.PREF_STACK_EDUCATION, false);
        BubbleEntry bubbleEntry = createBubbleEntry();
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import androidx.test.uiautomator.UiDevice;
import com.android.internal.protolog.ProtoLog;
import com.android.systemui.broadcast.FakeBroadcastDispatcher;
import com.android.systemui.flags.SceneContainerRule;
import com.android.systemui.log.LogWtfHandlerRule;

import org.junit.After;
import org.junit.AfterClass;
@@ -127,6 +128,8 @@ public abstract class SysuiTestCase {
    @Rule public final SetFlagsRule mSetFlagsRule =
            isRobolectricTest() ? new SetFlagsRule() : mSetFlagsClassRule.createSetFlagsRule();

    @Rule public final LogWtfHandlerRule mLogWtfRule = new LogWtfHandlerRule();

    @Rule(order = 10)
    public final SceneContainerRule mSceneContainerRule = new SceneContainerRule();