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

Commit 9b436547 authored by Liam, Lee Pong Lam's avatar Liam, Lee Pong Lam
Browse files

[smartspace] Fixes unit test threading

When rolling out the flag to staging, the test failed on threading so
making the test running on main looper.

Details: ag/27422442

Flag: com.android.systemui.smartspace_lockscreen_viewmodel
Test: Unit tests
Bug: 331451011
Change-Id: Iaecb0996d36418202ec33f794d791eb1576da552
parent c5149ac9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.Handler
import android.os.UserHandle
import android.platform.test.annotations.DisableFlags
import android.provider.Settings
import android.testing.TestableLooper.RunWithLooper
import android.view.View
import android.widget.FrameLayout
import androidx.test.filters.SmallTest
@@ -84,6 +85,7 @@ import java.util.Optional
import java.util.concurrent.Executor

@SmallTest
@RunWithLooper(setAsMainLooper = true)
class LockscreenSmartspaceControllerTest : SysuiTestCase() {
    companion object {
        const val SMARTSPACE_TIME_TOO_EARLY = 1000L
@@ -778,6 +780,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() {
    }

    @Test
    @RunWithLooper(setAsMainLooper = false)
    fun testConnectAttemptBeforeInitializationShouldNotCreateSession() {
        // GIVEN an uninitalized smartspaceView
        // WHEN the device is provisioned