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

Commit a0bf5b73 authored by Andre Le's avatar Andre Le Committed by Android (Google) Code Review
Browse files

Merge "Flexiglass: Fix QSPanelControllerTest when flexiglass is enabled" into main

parents 07b7339e 042a9a86
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import android.testing.TestableResources
import android.view.ContextThemeWrapper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
import com.android.internal.logging.MetricsLogger
import com.android.internal.logging.UiEventLogger
import com.android.systemui.SysuiTestCase
@@ -27,6 +28,7 @@ import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.tuner.TunerService
import com.google.common.truth.Truth.assertThat
import javax.inject.Provider
import kotlinx.coroutines.flow.MutableStateFlow
import org.junit.After
import org.junit.Before
import org.junit.Test
@@ -116,12 +118,23 @@ class QSPanelControllerTest : SysuiTestCase() {

    @After
    fun tearDown() {
        InstrumentationRegistry.getInstrumentation().runOnMainSync {
            // Ensure destroy() is called on the main thread for `mJavaAdapterDisposableHandle` to
            // run properly.
            controller.destroy()
        }
        reset(mediaHost)
    }

    @Test
    fun onInit_setsMediaAsExpanded() {
    fun onInit_setsMediaAsExpanded() =
        InstrumentationRegistry.getInstrumentation().runOnMainSync {
            // Set up media carousel interactor
            if (SceneContainerFlag.isEnabled) {
                val mockStateFlow = MutableStateFlow(false)
                whenever(mediaCarouselInteractor.hasAnyMedia).thenReturn(mockStateFlow)
            }

            controller.onInit()

            verify(mediaHost).expansion = MediaHostState.EXPANDED