Lines Matching refs:mock

54 HealthInterfaceMock *mock;  variable
60 return mock->ReadFileToString(path, content, follow_symlinks); in ReadFileToString()
64 return mock->WriteStringToFile(content, path, follow_symlinks); in WriteStringToFile()
69 return (T)(mock->GetIntProperty(key, default_value, min, max)); in GetIntProperty()
73 return mock->GetBoolProperty(key, default_value); in GetBoolProperty()
82 return mock->SetProperty(key, value); in SetProperty()
135 mock = &mockFixture; in SetUp()
140 EXPECT_CALL(*mock, SetProperty(_, _)).Times(AnyNumber()); in SetUp()
141 EXPECT_CALL(*mock, ReadFileToString(_, _, _)).Times(AnyNumber()); in SetUp()
142 EXPECT_CALL(*mock, GetIntProperty(_, _, _, _)).Times(AnyNumber()); in SetUp()
143 EXPECT_CALL(*mock, GetBoolProperty(_, _)).Times(AnyNumber()); in SetUp()
144 EXPECT_CALL(*mock, WriteStringToFile(_, _, _)).Times(AnyNumber()); in SetUp()
146 ON_CALL(*mock, ReadFileToString(_, _, _)) in SetUp()
149 ON_CALL(*mock, WriteStringToFile(_, _, _)).WillByDefault(Return(true)); in SetUp()
160 ON_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStart, _, _, _)).WillByDefault(Return(0)); in enableDefender()
161 ON_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStop, _, _, _)).WillByDefault(Return(100)); in enableDefender()
162 ON_CALL(*mock, GetBoolProperty(kPropBatteryDefenderDisable, _)).WillByDefault(Return(false)); in enableDefender()
164 ON_CALL(*mock, GetBoolProperty(kPropBatteryDefenderCtrlEnable, _)).WillByDefault(Return(true)); in enableDefender()
168 ON_CALL(*mock, ReadFileToString(kPathWiredChargerPresent, _, _)) in usbPresent()
173 ON_CALL(*mock, ReadFileToString(kPathWirelessChargerPresent, _, _)) in wirelessPresent()
178 ON_CALL(*mock, ReadFileToString(kPathWirelessChargerPresent, _, _)) in wirelessNotPresent()
188 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderThreshold, _, _, _)) in defaultThresholds()
191 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlActivateTime, _, _, _)) in defaultThresholds()
193 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlResumeTime, _, _, _)) in defaultThresholds()
196 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlStartSOC, _, _, _)) in defaultThresholds()
198 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlStopSOC, _, _, _)) in defaultThresholds()
201 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlTriggerSOC, _, _, _)) in defaultThresholds()
210 ON_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in initTo1000sConnectedCapacityReached()
215 ON_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in initToActive()
228 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISCONNECTED")); in TEST_F()
236 EXPECT_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStart, _, _, _)).WillOnce(Return(30)); in TEST_F()
237 EXPECT_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStop, _, _, _)).WillOnce(Return(35)); in TEST_F()
239 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISABLED")); in TEST_F()
247 EXPECT_CALL(*mock, GetBoolProperty(kPropBatteryDefenderDisable, _)).WillOnce(Return(true)); in TEST_F()
249 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISABLED")); in TEST_F()
260 EXPECT_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in TEST_F()
263 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
275 EXPECT_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in TEST_F()
277 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
282 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(time_expected), in TEST_F()
284 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
295 EXPECT_CALL(*mock, ReadFileToString(kPathPersistChargerPresentTime, _, _)) in TEST_F()
297 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
302 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
307 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
318 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
324 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
328 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(DEFAULT_TIME_TO_ACTIVATE_SECONDS), in TEST_F()
330 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
334 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(DEFAULT_TIME_TO_ACTIVATE_SECONDS + in TEST_F()
337 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
351 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
355 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(70), kPathStartLevel, _)); in TEST_F()
356 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(80), kPathStopLevel, _)); in TEST_F()
357 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
370 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(70), kPathStartLevel, _)); in TEST_F()
371 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(80), kPathStopLevel, _)); in TEST_F()
372 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
380 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderThreshold, _, _, _)) in TEST_F()
382 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlActivateTime, _, _, _)) in TEST_F()
384 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlResumeTime, _, _, _)) in TEST_F()
388 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlStartSOC, _, _, _)) in TEST_F()
390 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlStopSOC, _, _, _)) in TEST_F()
395 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(50), kPathStartLevel, _)); in TEST_F()
396 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(60), kPathStopLevel, _)); in TEST_F()
397 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
405 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderThreshold, _, _, _)) in TEST_F()
407 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlActivateTime, _, _, _)) in TEST_F()
409 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlResumeTime, _, _, _)) in TEST_F()
413 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlStartSOC, _, _, _)) in TEST_F()
415 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlStopSOC, _, _, _)) in TEST_F()
420 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(70), kPathStartLevel, _)); in TEST_F()
421 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(80), kPathStopLevel, _)); in TEST_F()
422 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
436 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(1000), kPathPersistChargerPresentTime, _)); in TEST_F()
437 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
441 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(1000 + MIN_TIME_BETWEEN_FILE_UPDATES), in TEST_F()
443 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
451 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
456 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
461 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(0), kPathPersistChargerPresentTime, _)); in TEST_F()
462 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISCONNECTED")); in TEST_F()
470 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
476 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
480 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(MIN_TIME_BETWEEN_FILE_UPDATES), in TEST_F()
482 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
490 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderThreshold, _, _, _)) in TEST_F()
492 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlActivateTime, _, _, _)) in TEST_F()
496 ON_CALL(*mock, GetIntProperty(kPropBatteryDefenderCtrlResumeTime, _, _, _)) in TEST_F()
504 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(1000), kPathPersistChargerPresentTime, _)); in TEST_F()
505 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
509 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(1000 + MIN_TIME_BETWEEN_FILE_UPDATES), in TEST_F()
511 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
518 EXPECT_CALL(*mock, WriteStringToFile(std::to_string(0), kPathPersistChargerPresentTime, _)); in TEST_F()
519 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISCONNECTED")); in TEST_F()
534 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
556 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
578 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
600 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
620 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
626 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
646 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
652 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
672 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
678 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
698 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
704 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")).Times(2); in TEST_F()
725 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")); in TEST_F()
731 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "ACTIVE")); in TEST_F()
744 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "CONNECTED")).Times(3); in TEST_F()
770 EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISCONNECTED")); in TEST_F()