mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 01:41:38 +00:00
test(android): remove invalid cold locale probe
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package ai.openclaw.app
|
||||
|
||||
import ai.openclaw.app.i18n.NativeStringResources
|
||||
import ai.openclaw.app.i18n.nativeString
|
||||
import android.app.Notification
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
@@ -175,32 +173,6 @@ class NodeForegroundServiceTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(sdk = [31, 32])
|
||||
fun coldServiceStartupUsesThePersistedAppLocaleWithoutAnActivity() {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
val localesFile = "androidx.appcompat.app.AppCompatDelegate.application_locales_record_file"
|
||||
app.openFileOutput(localesFile, Context.MODE_PRIVATE).bufferedWriter().use { writer ->
|
||||
writer.write("""<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><locales application_locales="fr" />""")
|
||||
}
|
||||
NativeStringResources.install(app)
|
||||
assertEquals("Démarrage…", nativeString("Starting…"))
|
||||
val controller = Robolectric.buildService(NodeForegroundService::class.java)
|
||||
|
||||
try {
|
||||
controller.create()
|
||||
|
||||
assertSame(app, controller.get().application)
|
||||
assertTrue(app.getFileStreamPath(localesFile).exists())
|
||||
assertEquals("Démarrage…", nativeString("Starting…"))
|
||||
val notification = Shadows.shadowOf(controller.get()).lastForegroundNotification
|
||||
assertEquals("Démarrage…", notification.extras.getCharSequence(Notification.EXTRA_TEXT))
|
||||
} finally {
|
||||
controller.destroy()
|
||||
app.deleteFile(localesFile)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun backgroundRuntimeStartsWithoutForegroundCapabilitiesOrMicRestore() {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
|
||||
Reference in New Issue
Block a user