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

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

Merge "Fix dispatchers in tests using settings" into main

parents 92ef098c ee2e34ae
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.systemui.util.settings.FakeGlobalSettings
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
@@ -60,7 +61,8 @@ import org.mockito.Mockito.`when` as whenever
@RunWith(AndroidJUnit4::class)
@RunWithLooper
class FooterActionsViewModelTest : SysuiTestCase() {
    private val testScope = TestScope()
    private val testDispatcher = StandardTestDispatcher()
    private val testScope = TestScope(testDispatcher)
    private lateinit var utils: FooterActionsTestUtils

    private val themedContext = ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings)
@@ -127,7 +129,7 @@ class FooterActionsViewModelTest : SysuiTestCase() {
    fun userSwitcher() = runTest {
        val picture: Drawable = mock()
        val userInfoController = FakeUserInfoController(FakeInfo(picture = picture))
        val settings = FakeGlobalSettings()
        val settings = FakeGlobalSettings(testDispatcher)
        val userId = 42
        val userSwitcherControllerWrapper =
            MockUserSwitcherControllerWrapper(currentUserName = "foo")
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ class AirplaneModeRepositoryImplTest : SysuiTestCase() {
    fun setUp() {
        MockitoAnnotations.initMocks(this)

        settings = FakeGlobalSettings()
        settings = FakeGlobalSettings(testContext)

        whenever(telephonyManager.emergencyCallbackMode).thenReturn(false)
        whenever(subscriptionManager.activeSubscriptionIdList).thenReturn(intArrayOf())