fake_system_state.cc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // Copyright (C) 2012 The Android Open Source Project
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. #include "update_engine/fake_system_state.h"
  17. namespace chromeos_update_engine {
  18. // Mock the SystemStateInterface so that we could lie that
  19. // OOBE is completed even when there's no such marker file, etc.
  20. FakeSystemState::FakeSystemState()
  21. : mock_update_attempter_(this, nullptr),
  22. mock_request_params_(this),
  23. fake_update_manager_(&fake_clock_),
  24. clock_(&fake_clock_),
  25. connection_manager_(&mock_connection_manager_),
  26. hardware_(&fake_hardware_),
  27. metrics_reporter_(&mock_metrics_reporter_),
  28. prefs_(&mock_prefs_),
  29. powerwash_safe_prefs_(&mock_powerwash_safe_prefs_),
  30. payload_state_(&mock_payload_state_),
  31. update_attempter_(&mock_update_attempter_),
  32. request_params_(&mock_request_params_),
  33. p2p_manager_(&mock_p2p_manager_),
  34. update_manager_(&fake_update_manager_),
  35. device_policy_(nullptr),
  36. fake_system_rebooted_(false) {
  37. mock_payload_state_.Initialize(this);
  38. }
  39. } // namespace chromeos_update_engine