mock_dynamic_partition_control.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Copyright (C) 2018 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 <stdint.h>
  17. #include <memory>
  18. #include <string>
  19. #include <gmock/gmock.h>
  20. #include "update_engine/dynamic_partition_control_interface.h"
  21. namespace chromeos_update_engine {
  22. class MockDynamicPartitionControl : public DynamicPartitionControlInterface {
  23. public:
  24. MOCK_METHOD5(MapPartitionOnDeviceMapper,
  25. bool(const std::string&,
  26. const std::string&,
  27. uint32_t,
  28. bool,
  29. std::string*));
  30. MOCK_METHOD2(UnmapPartitionOnDeviceMapper, bool(const std::string&, bool));
  31. MOCK_METHOD0(Cleanup, void());
  32. MOCK_METHOD1(DeviceExists, bool(const std::string&));
  33. MOCK_METHOD1(GetState, ::android::dm::DmDeviceState(const std::string&));
  34. MOCK_METHOD2(GetDmDevicePathByName, bool(const std::string&, std::string*));
  35. MOCK_METHOD3(LoadMetadataBuilder,
  36. std::unique_ptr<::android::fs_mgr::MetadataBuilder>(
  37. const std::string&, uint32_t, uint32_t));
  38. MOCK_METHOD3(StoreMetadata,
  39. bool(const std::string&,
  40. android::fs_mgr::MetadataBuilder*,
  41. uint32_t));
  42. MOCK_METHOD1(GetDeviceDir, bool(std::string*));
  43. MOCK_METHOD0(IsDynamicPartitionsEnabled, bool());
  44. MOCK_METHOD0(IsDynamicPartitionsRetrofit, bool());
  45. };
  46. } // namespace chromeos_update_engine