FakeUpdateEngineClient::FakeUpdateEngineClient()
: update_check_result_(UpdateEngineClient::UPDATE_RESULT_SUCCESS),
- reboot_after_update_call_count_(0) {
+ can_rollback_stub_result_(false),
+ reboot_after_update_call_count_(0),
+ rollback_call_count_(0),
+ can_rollback_call_count_(0) {
}
FakeUpdateEngineClient::~FakeUpdateEngineClient() {
}
void FakeUpdateEngineClient::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
}
void FakeUpdateEngineClient::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
}
bool FakeUpdateEngineClient::HasObserver(Observer* observer) {
}
void FakeUpdateEngineClient::Rollback() {
+ rollback_call_count_++;
}
void FakeUpdateEngineClient::CanRollbackCheck(
const RollbackCheckCallback& callback) {
+ can_rollback_call_count_++;
+ callback.Run(can_rollback_stub_result_);
}
void FakeUpdateEngineClient::RebootAfterUpdate() {
return last_status;
}
+void FakeUpdateEngineClient::NotifyObserversThatStatusChanged(
+ const UpdateEngineClient::Status& status) {
+ FOR_EACH_OBSERVER(Observer, observers_, UpdateStatusChanged(status));
+}
+
void FakeUpdateEngineClient::SetChannel(const std::string& target_channel,
bool is_powerwash_allowed) {
}