Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/InternetTileNewImplTest.kt +30 −21 Original line number Diff line number Diff line Loading @@ -26,11 +26,9 @@ import android.testing.TestableLooper import android.testing.TestableLooper.RunWithLooper import androidx.test.filters.SmallTest import com.android.internal.logging.MetricsLogger import com.android.systemui.Flags import com.android.systemui.Flags.FLAG_SCENE_CONTAINER import com.android.systemui.SysuiTestCase import com.android.systemui.classifier.FalsingManagerFake import com.android.systemui.flags.setFlagValue import com.android.systemui.keyguard.KeyguardWmStateRefactor import com.android.systemui.plugins.ActivityStarter import com.android.systemui.plugins.statusbar.StatusBarStateController Loading @@ -42,7 +40,6 @@ import com.android.systemui.qs.logging.QSLogger import com.android.systemui.qs.tiles.dialog.InternetDialogManager import com.android.systemui.qs.tiles.dialog.WifiStateWorker import com.android.systemui.res.R import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.shared.flag.DualShade import com.android.systemui.statusbar.connectivity.AccessPointController import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun Loading @@ -65,6 +62,7 @@ import kotlinx.coroutines.test.StandardTestDispatcher import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.After import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -150,11 +148,18 @@ class InternetTileNewImplTest(flags: FlagsParameterization) : SysuiTestCase() { ) underTest.initialize() underTest.setListening(Object(), true) looper.processAllMessages() } @After fun tearDown() { underTest.destroy() looper.processAllMessages() } @Test fun noDefaultConnection_noNetworkAvailable() = testScope.runTest { Loading Loading @@ -272,7 +277,8 @@ class InternetTileNewImplTest(flags: FlagsParameterization) : SysuiTestCase() { underTest.click(null) looper.processAllMessages() verify(dialogManager, times(1)).create( verify(dialogManager, times(1)) .create( aboveStatusBar = true, accessPointController.canConfigMobileData(), accessPointController.canConfigWifi(), Loading @@ -282,18 +288,21 @@ class InternetTileNewImplTest(flags: FlagsParameterization) : SysuiTestCase() { @Test @EnableFlags( value = [ value = [ QsDetailedView.FLAG_NAME, FLAG_SCENE_CONTAINER, KeyguardWmStateRefactor.FLAG_NAME, NotificationThrottleHun.FLAG_NAME, DualShade.FLAG_NAME] DualShade.FLAG_NAME, ] ) fun click_withQsDetailedViewEnabled() { underTest.click(null) looper.processAllMessages() verify(dialogManager, times(0)).create( verify(dialogManager, times(0)) .create( aboveStatusBar = true, accessPointController.canConfigMobileData(), accessPointController.canConfigWifi(), Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/RecordIssueTileTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import java.util.concurrent.Executors import org.junit.After import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -123,6 +124,12 @@ class RecordIssueTileTest : SysuiTestCase() { ) } @After fun teardown() { tile.destroy() testableLooper.processAllMessages() } @Test fun qsTileUi_shouldLookCorrect_whenInactive() { whenever(issueRecordingState.isRecording).thenReturn(false) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/InternetTileNewImplTest.kt +30 −21 Original line number Diff line number Diff line Loading @@ -26,11 +26,9 @@ import android.testing.TestableLooper import android.testing.TestableLooper.RunWithLooper import androidx.test.filters.SmallTest import com.android.internal.logging.MetricsLogger import com.android.systemui.Flags import com.android.systemui.Flags.FLAG_SCENE_CONTAINER import com.android.systemui.SysuiTestCase import com.android.systemui.classifier.FalsingManagerFake import com.android.systemui.flags.setFlagValue import com.android.systemui.keyguard.KeyguardWmStateRefactor import com.android.systemui.plugins.ActivityStarter import com.android.systemui.plugins.statusbar.StatusBarStateController Loading @@ -42,7 +40,6 @@ import com.android.systemui.qs.logging.QSLogger import com.android.systemui.qs.tiles.dialog.InternetDialogManager import com.android.systemui.qs.tiles.dialog.WifiStateWorker import com.android.systemui.res.R import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.shared.flag.DualShade import com.android.systemui.statusbar.connectivity.AccessPointController import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun Loading @@ -65,6 +62,7 @@ import kotlinx.coroutines.test.StandardTestDispatcher import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.After import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -150,11 +148,18 @@ class InternetTileNewImplTest(flags: FlagsParameterization) : SysuiTestCase() { ) underTest.initialize() underTest.setListening(Object(), true) looper.processAllMessages() } @After fun tearDown() { underTest.destroy() looper.processAllMessages() } @Test fun noDefaultConnection_noNetworkAvailable() = testScope.runTest { Loading Loading @@ -272,7 +277,8 @@ class InternetTileNewImplTest(flags: FlagsParameterization) : SysuiTestCase() { underTest.click(null) looper.processAllMessages() verify(dialogManager, times(1)).create( verify(dialogManager, times(1)) .create( aboveStatusBar = true, accessPointController.canConfigMobileData(), accessPointController.canConfigWifi(), Loading @@ -282,18 +288,21 @@ class InternetTileNewImplTest(flags: FlagsParameterization) : SysuiTestCase() { @Test @EnableFlags( value = [ value = [ QsDetailedView.FLAG_NAME, FLAG_SCENE_CONTAINER, KeyguardWmStateRefactor.FLAG_NAME, NotificationThrottleHun.FLAG_NAME, DualShade.FLAG_NAME] DualShade.FLAG_NAME, ] ) fun click_withQsDetailedViewEnabled() { underTest.click(null) looper.processAllMessages() verify(dialogManager, times(0)).create( verify(dialogManager, times(0)) .create( aboveStatusBar = true, accessPointController.canConfigMobileData(), accessPointController.canConfigWifi(), Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/RecordIssueTileTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import java.util.concurrent.Executors import org.junit.After import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -123,6 +124,12 @@ class RecordIssueTileTest : SysuiTestCase() { ) } @After fun teardown() { tile.destroy() testableLooper.processAllMessages() } @Test fun qsTileUi_shouldLookCorrect_whenInactive() { whenever(issueRecordingState.isRecording).thenReturn(false) Loading