test(android): update RemotePlayerState threshold expectation to 30
android / Build + lint + test (push) Has been cancelled

This commit is contained in:
2026-06-03 23:50:37 -04:00
parent e62fac3a0e
commit 47b0894ad6
@@ -53,17 +53,23 @@ class RemotePlayerStateTest {
@Test
fun `recordPollFailure trips after threshold`() {
val state = RemotePlayerState()
assertFalse(state.recordPollFailure())
assertFalse(state.recordPollFailure())
// Threshold is 30 -- tolerate ~30s of screen-off WiFi sleep before
// declaring the remote dropped. Pre-threshold calls all return false.
repeat(DROP_THRESHOLD - 1) {
assertFalse(state.recordPollFailure())
}
assertTrue(state.recordPollFailure())
}
@Test
fun `recordPollSuccess clears the failure counter`() {
val state = RemotePlayerState()
state.recordPollFailure()
state.recordPollFailure()
repeat(DROP_THRESHOLD - 1) { state.recordPollFailure() }
state.recordPollSuccess()
assertFalse(state.recordPollFailure())
}
private companion object {
const val DROP_THRESHOLD = 30
}
}