Yifan Hong | 537802d | 2018-08-15 13:15:42 -0700 | [diff] [blame] | 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 | |
| 17 | #include <stdint.h> |
| 18 | |
| 19 | #include <memory> |
| 20 | #include <string> |
| 21 | |
| 22 | #include <gmock/gmock.h> |
| 23 | |
| 24 | #include "update_engine/dynamic_partition_control_interface.h" |
| 25 | |
| 26 | namespace chromeos_update_engine { |
| 27 | |
| 28 | class MockDynamicPartitionControl : public DynamicPartitionControlInterface { |
| 29 | public: |
Yifan Hong | af65ef1 | 2018-10-29 11:09:06 -0700 | [diff] [blame] | 30 | MOCK_METHOD5(MapPartitionOnDeviceMapper, |
| 31 | bool(const std::string&, |
| 32 | const std::string&, |
| 33 | uint32_t, |
| 34 | bool, |
| 35 | std::string*)); |
Yifan Hong | 537802d | 2018-08-15 13:15:42 -0700 | [diff] [blame] | 36 | MOCK_METHOD2(UnmapPartitionOnDeviceMapper, bool(const std::string&, bool)); |
| 37 | MOCK_METHOD0(Cleanup, void()); |
| 38 | MOCK_METHOD1(DeviceExists, bool(const std::string&)); |
| 39 | MOCK_METHOD1(GetState, ::android::dm::DmDeviceState(const std::string&)); |
| 40 | MOCK_METHOD2(GetDmDevicePathByName, bool(const std::string&, std::string*)); |
Yifan Hong | 6e706b1 | 2018-11-09 16:50:51 -0800 | [diff] [blame] | 41 | MOCK_METHOD3(LoadMetadataBuilder, |
Yifan Hong | 537802d | 2018-08-15 13:15:42 -0700 | [diff] [blame] | 42 | std::unique_ptr<::android::fs_mgr::MetadataBuilder>( |
Yifan Hong | 6e706b1 | 2018-11-09 16:50:51 -0800 | [diff] [blame] | 43 | const std::string&, uint32_t, uint32_t)); |
Yifan Hong | 537802d | 2018-08-15 13:15:42 -0700 | [diff] [blame] | 44 | MOCK_METHOD3(StoreMetadata, |
| 45 | bool(const std::string&, |
| 46 | android::fs_mgr::MetadataBuilder*, |
| 47 | uint32_t)); |
| 48 | MOCK_METHOD1(GetDeviceDir, bool(std::string*)); |
| 49 | MOCK_METHOD0(IsDynamicPartitionsEnabled, bool()); |
| 50 | }; |
| 51 | |
| 52 | } // namespace chromeos_update_engine |