Tests: let Robolectric read the app's string resources

This commit is contained in:
maxjivi05 committed 2026-10-04 22:31:48 -04:00
1 parent fba2f378be
commit 9c72e3daf7
2 files changed
+3 -2

No files matched your search

+2
View File
@@ -165,6 +165,8 @@ android {
testOptions {
// Plain JVM tests: a stray android.util.Log call returns a default instead of throwing.
unitTests.returnDefaultValues = true
// Robolectric tests start activities whose text is now all string resources.
unitTests.includeAndroidResources = true
}
compileOptions {
@@ -287,8 +287,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
super.onCreate(savedInstanceState)
if (com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.isRemoving()) {
runtimeRemovalBlocked = true
// Best effort: the activity finishes either way, even where its resources cannot be read.
runCatching { android.widget.Toast.makeText(this, R.string.session_wait_removal, android.widget.Toast.LENGTH_SHORT).show() }
android.widget.Toast.makeText(this, R.string.session_wait_removal, android.widget.Toast.LENGTH_SHORT).show()
finish()
return
}