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 <android/hardware/boot/1.0/IBootControl.h> |
| 18 | #include <stdint.h> |
| 19 | |
| 20 | #include <gmock/gmock.h> |
| 21 | |
| 22 | namespace chromeos_update_engine { |
| 23 | |
| 24 | class MockBootControlHal |
| 25 | : public ::android::hardware::boot::V1_0::IBootControl { |
| 26 | public: |
| 27 | MOCK_METHOD0(getNumberSlots, ::android::hardware::Return<uint32_t>()); |
| 28 | MOCK_METHOD0(getCurrentSlot, ::android::hardware::Return<uint32_t>()); |
| 29 | MOCK_METHOD1(markBootSuccessful, |
| 30 | ::android::hardware::Return<void>(markBootSuccessful_cb)); |
| 31 | MOCK_METHOD2(setActiveBootSlot, |
| 32 | ::android::hardware::Return<void>(uint32_t, |
| 33 | setActiveBootSlot_cb)); |
| 34 | MOCK_METHOD2(setSlotAsUnbootable, |
| 35 | ::android::hardware::Return<void>(uint32_t, |
| 36 | setSlotAsUnbootable_cb)); |
| 37 | MOCK_METHOD1( |
| 38 | isSlotBootable, |
| 39 | ::android::hardware::Return<::android::hardware::boot::V1_0::BoolResult>( |
| 40 | uint32_t)); |
| 41 | MOCK_METHOD1( |
| 42 | isSlotMarkedSuccessful, |
| 43 | ::android::hardware::Return<::android::hardware::boot::V1_0::BoolResult>( |
| 44 | uint32_t)); |
| 45 | MOCK_METHOD2(getSuffix, |
| 46 | ::android::hardware::Return<void>(uint32_t, getSuffix_cb)); |
| 47 | }; |
| 48 | |
| 49 | } // namespace chromeos_update_engine |