update_engine: Move ConnectionManager to an abstract Interface.
MockConnectionManager required to use one of ConnectionManager
constructors passing pointers that won't be use by the mock. This
patch moves the interface to its own ConnectionManagerInterface class.
BUG=None
TEST=unittests still pass.
Change-Id: I9ed09daf8e4256304be7dab30cfbe751901dc24b
Reviewed-on: https://chromium-review.googlesource.com/290120
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/fake_system_state.h b/fake_system_state.h
index 84c37fc..1f3f58f 100644
--- a/fake_system_state.h
+++ b/fake_system_state.h
@@ -45,7 +45,7 @@
return device_policy_;
}
- inline ConnectionManager* connection_manager() override {
+ inline ConnectionManagerInterface* connection_manager() override {
return connection_manager_;
}
@@ -89,7 +89,8 @@
clock_ = clock ? clock : &fake_clock_;
}
- inline void set_connection_manager(ConnectionManager* connection_manager) {
+ inline void set_connection_manager(
+ ConnectionManagerInterface* connection_manager) {
connection_manager_ = (connection_manager ? connection_manager :
&mock_connection_manager_);
}
@@ -215,7 +216,7 @@
// Pointers to objects that client code can override. They are initialized to
// the default implementations above.
ClockInterface* clock_;
- ConnectionManager* connection_manager_;
+ ConnectionManagerInterface* connection_manager_;
HardwareInterface* hardware_;
MetricsLibraryInterface* metrics_lib_;
PrefsInterface* prefs_;