Add ConnectionManagerAndroid.
Just a stub implementation that always allow update right now.
Test: mma
Bug: 28800946
Change-Id: I4ff6164d459d142567d49a351f70128f5fc74b9f
diff --git a/connection_manager_unittest.cc b/connection_manager_unittest.cc
index 48f6195..0bb5547 100644
--- a/connection_manager_unittest.cc
+++ b/connection_manager_unittest.cc
@@ -47,6 +47,8 @@
class ConnectionManagerTest : public ::testing::Test {
public:
+ ConnectionManagerTest() : fake_shill_proxy_(new FakeShillProxy()) {}
+
void SetUp() override {
loop_.SetAsCurrent();
fake_system_state_.set_connection_manager(&cmut_);
@@ -78,15 +80,15 @@
brillo::FakeMessageLoop loop_{nullptr};
FakeSystemState fake_system_state_;
- FakeShillProxy fake_shill_proxy_;
+ FakeShillProxy* fake_shill_proxy_;
// ConnectionManager under test.
- ConnectionManager cmut_{&fake_shill_proxy_, &fake_system_state_};
+ ConnectionManager cmut_{fake_shill_proxy_, &fake_system_state_};
};
void ConnectionManagerTest::SetManagerReply(const char* default_service,
bool reply_succeeds) {
- ManagerProxyMock* manager_proxy_mock = fake_shill_proxy_.GetManagerProxy();
+ ManagerProxyMock* manager_proxy_mock = fake_shill_proxy_->GetManagerProxy();
if (!reply_succeeds) {
EXPECT_CALL(*manager_proxy_mock, GetProperties(_, _, _))
.WillOnce(Return(false));
@@ -130,8 +132,8 @@
EXPECT_CALL(*service_proxy_mock.get(), GetProperties(_, _, _))
.WillOnce(DoAll(SetArgPointee<0>(reply_dict), Return(true)));
- fake_shill_proxy_.SetServiceForPath(dbus::ObjectPath(service_path),
- std::move(service_proxy_mock));
+ fake_shill_proxy_->SetServiceForPath(dbus::ObjectPath(service_path),
+ std::move(service_proxy_mock));
}
void ConnectionManagerTest::TestWithServiceType(
@@ -149,7 +151,7 @@
EXPECT_TRUE(cmut_.GetConnectionProperties(&type, &tethering));
EXPECT_EQ(expected_type, type);
testing::Mock::VerifyAndClearExpectations(
- fake_shill_proxy_.GetManagerProxy());
+ fake_shill_proxy_->GetManagerProxy());
}
void ConnectionManagerTest::TestWithServiceTethering(
@@ -164,7 +166,7 @@
EXPECT_TRUE(cmut_.GetConnectionProperties(&type, &tethering));
EXPECT_EQ(expected_tethering, tethering);
testing::Mock::VerifyAndClearExpectations(
- fake_shill_proxy_.GetManagerProxy());
+ fake_shill_proxy_->GetManagerProxy());
}
TEST_F(ConnectionManagerTest, SimpleTest) {