summaryrefslogtreecommitdiff
path: root/mock_dynamic_partition_control.h
diff options
context:
space:
mode:
Diffstat (limited to 'mock_dynamic_partition_control.h')
-rw-r--r--mock_dynamic_partition_control.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/mock_dynamic_partition_control.h b/mock_dynamic_partition_control.h
index cdfeeccc..26fc2469 100644
--- a/mock_dynamic_partition_control.h
+++ b/mock_dynamic_partition_control.h
@@ -21,6 +21,8 @@
#include <gmock/gmock.h>
+#include "update_engine/common/boot_control_interface.h"
+#include "update_engine/dynamic_partition_control_android.h"
#include "update_engine/dynamic_partition_control_interface.h"
namespace chromeos_update_engine {
@@ -33,6 +35,31 @@ class MockDynamicPartitionControl : public DynamicPartitionControlInterface {
uint32_t,
bool,
std::string*));
+ MOCK_METHOD0(Cleanup, void());
+ MOCK_METHOD1(DeviceExists, bool(const std::string&));
+ MOCK_METHOD1(GetState, ::android::dm::DmDeviceState(const std::string&));
+ MOCK_METHOD2(GetDmDevicePathByName, bool(const std::string&, std::string*));
+ MOCK_METHOD2(LoadMetadataBuilder,
+ std::unique_ptr<::android::fs_mgr::MetadataBuilder>(
+ const std::string&, uint32_t));
+ MOCK_METHOD1(GetDeviceDir, bool(std::string*));
+ MOCK_METHOD0(GetDynamicPartitionsFeatureFlag, FeatureFlag());
+ MOCK_METHOD3(PreparePartitionsForUpdate,
+ bool(uint32_t,
+ uint32_t,
+ const BootControlInterface::PartitionMetadata&));
+ MOCK_METHOD1(GetSuperPartitionName, std::string(uint32_t));
+};
+
+class MockDynamicPartitionControlAndroid
+ : public DynamicPartitionControlAndroid {
+ public:
+ MOCK_METHOD5(MapPartitionOnDeviceMapper,
+ bool(const std::string&,
+ const std::string&,
+ uint32_t,
+ bool,
+ std::string*));
MOCK_METHOD1(UnmapPartitionOnDeviceMapper, bool(const std::string&));
MOCK_METHOD0(Cleanup, void());
MOCK_METHOD1(DeviceExists, bool(const std::string&));
@@ -46,8 +73,8 @@ class MockDynamicPartitionControl : public DynamicPartitionControlInterface {
android::fs_mgr::MetadataBuilder*,
uint32_t));
MOCK_METHOD1(GetDeviceDir, bool(std::string*));
- MOCK_METHOD0(IsDynamicPartitionsEnabled, bool());
- MOCK_METHOD0(IsDynamicPartitionsRetrofit, bool());
+ MOCK_METHOD0(GetDynamicPartitionsFeatureFlag, FeatureFlag());
+ MOCK_METHOD1(GetSuperPartitionName, std::string(uint32_t));
};
} // namespace chromeos_update_engine