mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
fix(session): show the recorded reason when a session fails to start (#2841)
* fix(session): show the recorded reason when a session fails to start The ended screen now shows any recorded start-up failure message except a plain guest exit, not only PROOT_MISSING. The graphics runtime staging and game environment publish failures now record GRAPHICS_RUNTIME_FAILED and GAME_ENVIRONMENT_FAILED with their own messages instead of looking like a guest exit. * i18n(session): translate the start failure messages --------- Co-authored-by: Tapuuk <177422350+Tapuuk@users.noreply.github.com> Co-authored-by: maxjivi05 <maxjividen@gmail.com>
This commit is contained in:
36 files changed
+96
-3
No files matched your search
@@ -34,14 +34,20 @@ class SessionEndHintTest {
|
||||
private var previousArchitecture: String? = null
|
||||
private var previousLog: File? = null
|
||||
private var previousDirectory: File? = null
|
||||
private var previousFailureCode: String? = null
|
||||
private var previousFailureMessage: String? = null
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
previousArchitecture = SessionState.steamClientArch
|
||||
previousLog = SessionState.logFile
|
||||
previousDirectory = SessionState.logDirectory
|
||||
previousFailureCode = SessionState.failureCode
|
||||
previousFailureMessage = SessionState.failureMessage
|
||||
SessionState.logFile = null
|
||||
SessionState.logDirectory = null
|
||||
SessionState.failureCode = null
|
||||
SessionState.failureMessage = null
|
||||
DetectedGpu.family = GpuInfo.Family.NOT_ADRENO
|
||||
DetectedGpu.name = "test GPU"
|
||||
activity = Robolectric.buildActivity(SessionActivity::class.java).get()
|
||||
@@ -53,6 +59,8 @@ class SessionEndHintTest {
|
||||
SessionState.steamClientArch = previousArchitecture
|
||||
SessionState.logFile = previousLog
|
||||
SessionState.logDirectory = previousDirectory
|
||||
SessionState.failureCode = previousFailureCode
|
||||
SessionState.failureMessage = previousFailureMessage
|
||||
DetectedGpu.family = GpuInfo.Family.NOT_ADRENO
|
||||
DetectedGpu.name = "test GPU"
|
||||
}
|
||||
@@ -122,6 +130,22 @@ class SessionEndHintTest {
|
||||
assertNull(exitHint(0))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun startFailureShowsTheRecordedMessage() {
|
||||
SessionState.failureCode = "POWERVR_MISSING"
|
||||
SessionState.failureMessage = "x"
|
||||
val hint = exitHint(-1)
|
||||
assertNotNull(hint)
|
||||
assertEquals("x", ReflectionHelpers.getField<String>(hint, "text"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun guestExitMessageIsNotShownAsAStartFailure() {
|
||||
SessionState.failureCode = "GUEST_EXIT"
|
||||
SessionState.failureMessage = "Session guest exited with status 1"
|
||||
assertNull(exitHint(1))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun missingEmptyAndUnrelatedLogsHaveNoHint() {
|
||||
assertNull(hint(null))
|
||||
|
||||
Reference in new issue
Block a user