PM: Shift to signal-based inference of network connection.
Instead of making DBus calls to shill on-demand, and estimating the time
a connection has changed, the RealShillProvider now listens to the
appropriate DBus signal and update its internal state accordingly. Note
that checking for the connection type still requires a DBus call, if the
connection has changed since its type was last checked.
In order to pass all unit tests (including those of PolicyManager and
RealState), there's a substantial portion of DBus mock set up code that
was added. This code will be removed very soon, once we begin injecting
providers into RealState, instead of low-level DBus and/or clock
interfaces.
BUG=chromium:338585
TEST=Unit tests.
Change-Id: Ia7a2f9db18f905f1b7a2cc1234acb31eaa60009e
Reviewed-on: https://chromium-review.googlesource.com/189692
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/policy_manager/variable.h b/policy_manager/variable.h
index 2c6a8e3..be3fdb1 100644
--- a/policy_manager/variable.h
+++ b/policy_manager/variable.h
@@ -144,6 +144,7 @@
FRIEND_TEST(PmRealShillProviderTest, ReadDefaultValues);
FRIEND_TEST(PmRealShillProviderTest, ReadChangedValuesConnectedViaEthernet);
FRIEND_TEST(PmRealShillProviderTest, ReadChangedValuesConnectedViaVpn);
+ FRIEND_TEST(PmRealShillProviderTest, ReadChangedValuesConnectedTwoSignals);
Variable(const std::string& name, VariableMode mode)
: BaseVariable(name, mode) {}