blob: a0701e7a68ff776991179ca93598ea7e2f0c2d98 [file] [log] [blame]
Yifan Hong537802d2018-08-15 13:15:42 -07001//
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
17#include <stdint.h>
18
19#include <memory>
20#include <string>
21
22#include <gmock/gmock.h>
23
Yifan Hong012508e2019-07-22 18:30:40 -070024#include "update_engine/common/boot_control_interface.h"
25#include "update_engine/dynamic_partition_control_android.h"
Yifan Hong537802d2018-08-15 13:15:42 -070026#include "update_engine/dynamic_partition_control_interface.h"
27
28namespace chromeos_update_engine {
29
Yifan Hong012508e2019-07-22 18:30:40 -070030class MockDynamicPartitionControlAndroid
31 : public DynamicPartitionControlAndroid {
Yifan Hong537802d2018-08-15 13:15:42 -070032 public:
Yifan Hongaf65ef12018-10-29 11:09:06 -070033 MOCK_METHOD5(MapPartitionOnDeviceMapper,
34 bool(const std::string&,
35 const std::string&,
36 uint32_t,
37 bool,
38 std::string*));
David Anderson4c891c92019-06-21 17:45:23 -070039 MOCK_METHOD1(UnmapPartitionOnDeviceMapper, bool(const std::string&));
Yifan Hong537802d2018-08-15 13:15:42 -070040 MOCK_METHOD0(Cleanup, void());
41 MOCK_METHOD1(DeviceExists, bool(const std::string&));
42 MOCK_METHOD1(GetState, ::android::dm::DmDeviceState(const std::string&));
43 MOCK_METHOD2(GetDmDevicePathByName, bool(const std::string&, std::string*));
Yifan Hong6e706b12018-11-09 16:50:51 -080044 MOCK_METHOD3(LoadMetadataBuilder,
Yifan Hong537802d2018-08-15 13:15:42 -070045 std::unique_ptr<::android::fs_mgr::MetadataBuilder>(
Yifan Hong6e706b12018-11-09 16:50:51 -080046 const std::string&, uint32_t, uint32_t));
Yifan Hong537802d2018-08-15 13:15:42 -070047 MOCK_METHOD3(StoreMetadata,
48 bool(const std::string&,
49 android::fs_mgr::MetadataBuilder*,
50 uint32_t));
51 MOCK_METHOD1(GetDeviceDir, bool(std::string*));
Yifan Hong186bb682019-07-23 14:04:39 -070052 MOCK_METHOD0(GetDynamicPartitionsFeatureFlag, FeatureFlag());
Yifan Hong537802d2018-08-15 13:15:42 -070053};
54
55} // namespace chromeos_update_engine