tonihei f9c6fb4e90 Ensure messages sent on a dead thread don't block FakeClock execution
FakeClock keeps an internal list of messages to be executed to
ensure deterministic serialization. The next message from the list
is triggered by a separate helper message sent to the real Handler.
However, if the target HandlerThread is no longer alive (e.g. when
it quit itself during the message execution), this helper
message is never executed and the entire message execution chain
is stuck forever.

This can be solved by checking the return values of Hander.post or
Handler.sendMessage, which are false if the message won't be
delivered. If the messages are not delivered, we can unblock the
chain by marking the message as complete and triggering the next
one.

PiperOrigin-RevId: 491275031
(cherry picked from commit 8fcc06309323847b47ed8ab225cd861335448d36)
2023-01-25 17:41:00 +00:00
..
2021-10-27 09:12:46 +01:00
2021-10-27 09:12:46 +01:00

Test utils module

Provides utility classes for media unit and instrumentation tests.