WifiDiagnosticsTest: stub out call to logcat
WifiDiagnostics.captureBugReport() forks an external
process (logcat), to read data from logd. At present,
that external process is _not_ stubbed out for testing.
As a consequence, the time to run WifiDiagnosticsTest
depends on how busy logd happens to be. This causes
problems when, e.g., running a ToT build where other
subsystems are crashy.
Resolve this problem, by stubbing out the external
process for unit tests.
Along the way: update WifiInjector, so that it hosts
an instance of java.lang.Runtime.
Bug: 34971969
Test: runtests.sh
Test: manual
Manual test:
- install a build that's suffering from b/35400537
- run wifi unit tests 5 times
- verify that no run takes longer than 35 seconds
Change-Id: Icf2c36acc04713c5ead44b47a42fa9e80cf0a1fd
3 files changed