Skip to content
Commit f145e173 authored by Roshan Pius's avatar Roshan Pius
Browse files

TestLooper: Some changes to test looper behavior

a) Add a new stopAutoDispatchAndIgnoreExceptions method
This method ignores exceptions raised when there are no messages
dispatched in the looper. Helps write negative unit tests for methods where
the runnables are not posted when some preconditions are not met.
Not starting the looper in these tests would make it
unclear whether the test failed because the looper was not running or
because the preconditions (like permission checks) where not satisfied.
b) Auto dispatch will only stop running when stopAutoDispatch is
invoked. Previously it stops running when it runs a single message. This
causes failures in unit tests for methods which posts multiple runnables
in the same method.

Bug: 138403307
Bug: 117601161
Test: atest com.android.server.wifi
Change-Id: Iab27d92d443c6d7364c52b86d51dd2cb7902358a
parent c3b87926
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment