Loading packages/SystemUI/tests/src/com/android/systemui/bluetooth/qsdialog/BluetoothDetailsContentViewModelTest.kt +23 −3 Original line number Diff line number Diff line Loading @@ -17,12 +17,13 @@ package com.android.systemui.bluetooth.qsdialog import android.bluetooth.BluetoothAdapter import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.FlagsParameterization import android.testing.TestableLooper import android.view.View import android.view.View.GONE import android.view.View.VISIBLE import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.settingslib.bluetooth.LocalBluetoothManager import com.android.settingslib.flags.Flags Loading @@ -34,6 +35,7 @@ import com.android.systemui.bluetooth.ui.viewModel.BluetoothDetailsContentViewMo import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope import com.android.systemui.qs.flags.QsDetailedView import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.testKosmos import com.android.systemui.util.FakeSharedPreferences Loading Loading @@ -63,12 +65,18 @@ import org.mockito.kotlin.eq import org.mockito.kotlin.never import org.mockito.kotlin.verify import org.mockito.kotlin.whenever import platform.test.runner.parameterized.ParameterizedAndroidJunit4 import platform.test.runner.parameterized.Parameters @SmallTest @RunWith(AndroidJUnit4::class) @RunWith(ParameterizedAndroidJunit4::class) @TestableLooper.RunWithLooper(setAsMainLooper = true) @EnableFlags(Flags.FLAG_BLUETOOTH_QS_TILE_DIALOG_AUTO_ON_TOGGLE) class BluetoothDetailsContentViewModelTest : SysuiTestCase() { class BluetoothDetailsContentViewModelTest(flags: FlagsParameterization) : SysuiTestCase() { init { mSetFlagsRule.setFlagsParameterization(flags) } @get:Rule val mockitoRule: MockitoRule = MockitoJUnit.rule() private val kosmos = testKosmos() Loading Loading @@ -176,6 +184,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_noAnimation() { testScope.runTest { bluetoothDetailsContentViewModel.showDialog(null) Loading @@ -186,6 +195,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_animated() { testScope.runTest { bluetoothDetailsContentViewModel.showDialog(expandable) Loading @@ -209,6 +219,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_animated_callInBackgroundThread() { testScope.runTest { backgroundExecutor.execute { Loading Loading @@ -236,6 +247,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_fetchDeviceItem() { testScope.runTest { bluetoothDetailsContentViewModel.showDialog(null) Loading Loading @@ -314,6 +326,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testUpdateTitleAndSubtitle() { testScope.runTest { assertThat(bluetoothDetailsContentViewModel.title).isEqualTo("") Loading @@ -326,4 +339,11 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { assertThat(bluetoothDetailsContentViewModel.subTitle).isEqualTo("Bluetooth is off") } } companion object { @JvmStatic @Parameters(name = "{0}") fun flagsParameterization() = FlagsParameterization.allCombinationsOf(QsDetailedView.FLAG_NAME) } } Loading
packages/SystemUI/tests/src/com/android/systemui/bluetooth/qsdialog/BluetoothDetailsContentViewModelTest.kt +23 −3 Original line number Diff line number Diff line Loading @@ -17,12 +17,13 @@ package com.android.systemui.bluetooth.qsdialog import android.bluetooth.BluetoothAdapter import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.FlagsParameterization import android.testing.TestableLooper import android.view.View import android.view.View.GONE import android.view.View.VISIBLE import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.settingslib.bluetooth.LocalBluetoothManager import com.android.settingslib.flags.Flags Loading @@ -34,6 +35,7 @@ import com.android.systemui.bluetooth.ui.viewModel.BluetoothDetailsContentViewMo import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope import com.android.systemui.qs.flags.QsDetailedView import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.testKosmos import com.android.systemui.util.FakeSharedPreferences Loading Loading @@ -63,12 +65,18 @@ import org.mockito.kotlin.eq import org.mockito.kotlin.never import org.mockito.kotlin.verify import org.mockito.kotlin.whenever import platform.test.runner.parameterized.ParameterizedAndroidJunit4 import platform.test.runner.parameterized.Parameters @SmallTest @RunWith(AndroidJUnit4::class) @RunWith(ParameterizedAndroidJunit4::class) @TestableLooper.RunWithLooper(setAsMainLooper = true) @EnableFlags(Flags.FLAG_BLUETOOTH_QS_TILE_DIALOG_AUTO_ON_TOGGLE) class BluetoothDetailsContentViewModelTest : SysuiTestCase() { class BluetoothDetailsContentViewModelTest(flags: FlagsParameterization) : SysuiTestCase() { init { mSetFlagsRule.setFlagsParameterization(flags) } @get:Rule val mockitoRule: MockitoRule = MockitoJUnit.rule() private val kosmos = testKosmos() Loading Loading @@ -176,6 +184,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_noAnimation() { testScope.runTest { bluetoothDetailsContentViewModel.showDialog(null) Loading @@ -186,6 +195,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_animated() { testScope.runTest { bluetoothDetailsContentViewModel.showDialog(expandable) Loading @@ -209,6 +219,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_animated_callInBackgroundThread() { testScope.runTest { backgroundExecutor.execute { Loading Loading @@ -236,6 +247,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testShowDialog_fetchDeviceItem() { testScope.runTest { bluetoothDetailsContentViewModel.showDialog(null) Loading Loading @@ -314,6 +326,7 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QsDetailedView.FLAG_NAME) fun testUpdateTitleAndSubtitle() { testScope.runTest { assertThat(bluetoothDetailsContentViewModel.title).isEqualTo("") Loading @@ -326,4 +339,11 @@ class BluetoothDetailsContentViewModelTest : SysuiTestCase() { assertThat(bluetoothDetailsContentViewModel.subTitle).isEqualTo("Bluetooth is off") } } companion object { @JvmStatic @Parameters(name = "{0}") fun flagsParameterization() = FlagsParameterization.allCombinationsOf(QsDetailedView.FLAG_NAME) } }