shill: Allow DBus name watchers to be deleted.
This CL refactors the code for watching DBus names as follows:
1. Adds a new DBusNameWatcher class.
2. Replaces DBusManager::WatchName() with
DBusManager::CreateNameWatcher() returning a DBusNameWatcher, which
can be deleted by the caller to unwatch the DBus name.
3. Removes MockDBusManager and changes unit tests to use DBusManager
with a MockDBusServiceProxy.
4. Make related log messages more readable and consistent in format.
BUG=chromium:214476
TEST=Tested the following:
1. Build and run unit tests with USE=wimax.
2. Manually verify, via /var/log/net.log, that shill can observe and
handle the following scenarios when WPA supplicant and WiMAX manager
appear on and vanish from DBus:
- shill starts before WPA supplicant and WiMAX manager
- shill starts after WPA supplicant and WiMAX manager
Change-Id: I719806220c39de1296b62eb457c4610506a5b815
Reviewed-on: https://chromium-review.googlesource.com/181890
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
16 files changed