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

Commit 3840ec8f authored by Zekan Qian's avatar Zekan Qian
Browse files

Fix test failure.

Use context as fallback when application context is not available

Bug: 256581743
Test: RunSettingsRoboTests
Change-Id: Ifdc37ce2e353ba1433492e8b8e4395a16407b0bb
parent 9fa6872e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ abstract class SpaEnvironment(context: Context) {

    val entryRepository = lazy { SettingsEntryRepository(pageProviderRepository.value) }

    val appContext: Context = context.applicationContext
    // In Robolectric test, applicationContext is not available. Use context as fallback.
    val appContext: Context = context.applicationContext ?: context

    open val browseActivityClass: Class<out Activity>? = null