mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
test(sidecar): unknown animation state must not read as idle
This commit is contained in:
1 parent
9ff82b1565
commit
07e8abb9ef
1 file changed
+10
-4
@@ -21,11 +21,17 @@ class IdleDetectionTest {
|
|||||||
assertFalse(StubDriverBackend.isAnimationCountIdle("3\n"))
|
assertFalse(StubDriverBackend.isAnimationCountIdle("3\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test fun idleWhenOutputEmpty() {
|
// A dumpsys that said nothing does not say the device is still. Reading
|
||||||
assertTrue(StubDriverBackend.isAnimationCountIdle(""))
|
// absence as idle is how a settle returns instantly on a degraded link and
|
||||||
|
// hands the runner a screen caught mid-animation; the caller bounds its own
|
||||||
|
// wait, so the cost of being wrong the other way is a wait it already
|
||||||
|
// budgeted for. The exception path of the same probe already answers false.
|
||||||
|
@Test fun unreadableOutputIsNotIdle() {
|
||||||
|
assertFalse(StubDriverBackend.isAnimationCountIdle(""))
|
||||||
|
assertFalse(StubDriverBackend.isAnimationCountIdle(" \n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test fun idleWhenOutputIsNotANumber() {
|
@Test fun unparseableOutputIsNotIdle() {
|
||||||
assertTrue(StubDriverBackend.isAnimationCountIdle("error: no service"))
|
assertFalse(StubDriverBackend.isAnimationCountIdle("error: no service"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user