Lines Matching refs:mock

52 HealthInterfaceMock *mock;  variable
58 return mock->ReadFileToString(path, content, follow_symlinks); in ReadFileToString()
62 return mock->WriteStringToFile(content, path, follow_symlinks); in WriteStringToFile()
67 return (T)(mock->GetIntProperty(key, default_value, min, max)); in GetIntProperty()
71 return mock->GetBoolProperty(key, default_value); in GetBoolProperty()
80 return mock->SetProperty(key, value); in SetProperty()
110 mock = &mockFixture; in SetUp()
112 EXPECT_CALL(*mock, SetProperty(_, _)).Times(AnyNumber()); in SetUp()
113 EXPECT_CALL(*mock, ReadFileToString(_, _, _)).Times(AnyNumber()); in SetUp()
114 EXPECT_CALL(*mock, GetIntProperty(_, _, _, _)).Times(AnyNumber()); in SetUp()
115 EXPECT_CALL(*mock, GetBoolProperty(_, _)).Times(AnyNumber()); in SetUp()
116 EXPECT_CALL(*mock, WriteStringToFile(_, _, _)).Times(AnyNumber()); in SetUp()
118 ON_CALL(*mock, ReadFileToString(_, _, _)) in SetUp()
121 ON_CALL(*mock, WriteStringToFile(_, _, _)).WillByDefault(Return(true)); in SetUp()
146 ON_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStart, _, _, _)).WillByDefault(Return(0)); in enableDefender()
147 ON_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStop, _, _, _)).WillByDefault(Return(100)); in enableDefender()
148 ON_CALL(*mock, GetBoolProperty(kPropBatteryDefenderDisable, _)).WillByDefault(Return(false)); in enableDefender()
149 ON_CALL(*mock, GetBoolProperty(kPropDebuggable, _)).WillByDefault(Return(true)); in enableDefender()
153 ON_CALL(*mock, ReadFileToString(kPathWirelessChargerOnline, _, _)) in powerAvailable()
155 ON_CALL(*mock, ReadFileToString(kPathWiredChargerPresent, _, _)) in powerAvailable()
160 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderThreshold, _, _, _)) in defaultThreshold()
165 ON_CALL(*mock, ReadFileToString(kPathBatteryCapacity, _, _)) in capacityReached()
170 ON_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in initToConnectedCapacityReached()
175 ON_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in initToActive()
188 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISCONNECTED")); in TEST_F()
196 EXPECT_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStart, _, _, _)).WillOnce(Return(30)); in TEST_F()
197 EXPECT_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStop, _, _, _)).WillOnce(Return(35)); in TEST_F()
199 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISABLED")); in TEST_F()
207 EXPECT_CALL(*mock, GetBoolProperty(kPropDebuggable, _)).WillOnce(Return(false)); in TEST_F()
209 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISABLED")); in TEST_F()
217 EXPECT_CALL(*mock, GetBoolProperty(kPropBatteryDefenderDisable, _)).WillOnce(Return(true)); in TEST_F()
219 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISABLED")); in TEST_F()
230 EXPECT_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in TEST_F()
233 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
246 EXPECT_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in TEST_F()
249 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
253 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(DEFAULT_TIME_TO_ACTIVATE_SECONDS), in TEST_F()
255 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
268 EXPECT_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in TEST_F()
270 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
275 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
288 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
293 EXPECT_CALL(*mock, ReadFileToString(kPathBatteryCapacity, _, _)) in TEST_F()
295 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
299 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(DEFAULT_TIME_TO_ACTIVATE_SECONDS), in TEST_F()
301 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
305 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(DEFAULT_TIME_TO_ACTIVATE_SECONDS + 1), in TEST_F()
307 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
323 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
327 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(60), kPathStartLevel, _)); in TEST_F()
328 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(70), kPathStopLevel, _)); in TEST_F()
329 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
344 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(60), kPathStartLevel, _)); in TEST_F()
345 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(70), kPathStopLevel, _)); in TEST_F()
346 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
360 ON_CALL(*mock, ReadFileToString(kPathWirelessChargerOnline, _, _)) in TEST_F()
363 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(1000), kPathPersistChargerPresentTime, _)); in TEST_F()
364 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
368 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(1060), kPathPersistChargerPresentTime, _)); in TEST_F()
369 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
374 ON_CALL(*mock, ReadFileToString(kPathWirelessChargerOnline, _, _)) in TEST_F()
378 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
383 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
387 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(0), kPathPersistChargerPresentTime, _)); in TEST_F()
388 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISCONNECTED")); in TEST_F()
393 ON_CALL(*mock, ReadFileToString(kPathWirelessChargerOnline, _, _)) in TEST_F()
397 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
403 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
407 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(60), kPathPersistChargerPresentTime, _)); in TEST_F()
408 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()