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

Commit 90231b0c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adjust test for guts fix flag" into main

parents 0efe15dc 63b1cff5
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.NotificationLockscreenUserManager
import com.android.systemui.statusbar.NotificationLockscreenUserManager.UserChangedListener
@@ -64,7 +65,8 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
    fun setUp() {
        whenever(pipeline.allNotifs).thenReturn(listOf(entry))
        whenever(entry.row).thenReturn(row)
        coordinator = ViewConfigCoordinator(
        coordinator =
            ViewConfigCoordinator(
                configurationController,
                lockscreenUserManager,
                gutsManager,
@@ -95,7 +97,7 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
    fun themeChangePropagatesToEntry() {
        configurationListener.onThemeChanged()
        verify(entry).onDensityOrFontScaleChanged()
        verify(entry).areGutsExposed()
        checkGutsExposedCalled()
        verifyNoMoreInteractions(entry, row)
    }

@@ -103,7 +105,7 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
    fun densityChangePropagatesToEntry() {
        configurationListener.onDensityOrFontScaleChanged()
        verify(entry).onDensityOrFontScaleChanged()
        verify(entry).areGutsExposed()
        checkGutsExposedCalled()
        verifyNoMoreInteractions(entry, row)
    }

@@ -127,7 +129,7 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
        verify(entry).row
        verify(row).onUiModeChanged()
        verify(entry).onDensityOrFontScaleChanged()
        verify(entry).areGutsExposed()
        checkGutsExposedCalled()
        verifyNoMoreInteractions(entry, row)
        clearInvocations(entry, row)

@@ -158,7 +160,7 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
        verify(entry).row
        verify(row).onUiModeChanged()
        verify(entry).onDensityOrFontScaleChanged()
        verify(entry).areGutsExposed()
        checkGutsExposedCalled()
        verifyNoMoreInteractions(entry, row)
        clearInvocations(entry, row)

@@ -194,8 +196,14 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
        verify(entry).row
        verify(row).onUiModeChanged()
        verify(entry).onDensityOrFontScaleChanged()
        verify(entry).areGutsExposed()
        checkGutsExposedCalled()
        verifyNoMoreInteractions(entry, row)
        clearInvocations(entry, row)
    }

    private fun checkGutsExposedCalled() {
        if (!Flags.notificationUndoGutsOnConfigChanged()) {
            verify(entry).areGutsExposed()
        }
    }
}