History log of /system/connectivity/wificond/tests/integration/binder_dispatcher.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
74fbc395f1bff78051d7c12257fa697a453d7e35 26-Jul-2016 Roshan Pius <rpius@google.com> binder_dispatcher: Prevent test flakes

Loopers & binder fd instances are sticky on a given thread. So, every
test with a new instance of |BinderDispatcher| still share the same
looper & fd instances which could lead to potential leakage of events
across tests.

Changes in the CL:
1. Stop using |PostDelayed| task to enforce the wait timeout. This could
leave behind a stale message which might affect any future tests. So,
revert back to the original design of processing each event and then
checking if the |elapsed_time| has crossed over the |timeout|.
2. In the destructor of |BinderDispatcher|, destroy the |ProcessState|
instance to trigger cleanup of the binder driver.

While there,
Flip the |needs_init| flag usage to correctly reflect the name of the
variable.

BUG: 30122642
Change-Id: I1960dfc782c6b93dcb591964b5b6cc9a984a536a
TEST: All tests run successfully.
/system/connectivity/wificond/tests/integration/binder_dispatcher.cpp
da63f2e2dd305ef4deec091d4c73cbd4c131e1d4 21-Jul-2016 Roshan Pius <rpius@google.com> Add a module for binder callback handling in tests

Add a new module |BinderDispatcher| to wait for callback events
from |wificond| & |wpa_supplicant|.
The new module provides 2 public methods:
1. |DispatchFor()|: Will be invoked from the body of the test to
process all incoming binder events until |InterruptDispatch|.
2. |InterruptDispatch()|: Will be invoked from the binder object
to indicate the occurence of an event.

PS: Opted against using a multi-threaded approach here because we
anyway need to block the main thread until the callback is received.

BUG: 30122642
Change-Id: Ibfff79977bcf51942b5a67eb5b345be433ec9cc8
/system/connectivity/wificond/tests/integration/binder_dispatcher.cpp