1 /* 2 * Copyright (C) 2021 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 #ifndef CPP_EVS_MANAGER_1_1_TEST_UNIT_MOCKEVSENUMERATOR_H_ 18 #define CPP_EVS_MANAGER_1_1_TEST_UNIT_MOCKEVSENUMERATOR_H_ 19 20 #include "Enumerator.h" 21 22 #include <android/hardware/automotive/evs/1.1/IEvsEnumerator.h> 23 #include <gmock/gmock.h> 24 #include <gtest/gtest.h> 25 26 namespace android::automotive::evs::V1_1::implementation { 27 28 class MockEvsEnumerator : public IEvsEnumerator { 29 public: 30 MockEvsEnumerator() = default; 31 ~MockEvsEnumerator() override = default; 32 33 MOCK_METHOD(bool, isRemote, (), (const override)); 34 MOCK_METHOD(::android::hardware::Return<void>, getCameraList, (getCameraList_cb), (override)); 35 MOCK_METHOD(::android::hardware::Return< 36 ::android::sp<::android::hardware::automotive::evs::V1_0::IEvsCamera>>, 37 openCamera, (const ::android::hardware::hidl_string&), (override)); 38 MOCK_METHOD(::android::hardware::Return<void>, closeCamera, 39 (const ::android::sp<::android::hardware::automotive::evs::V1_0::IEvsCamera>&), 40 (override)); 41 MOCK_METHOD(::android::hardware::Return< 42 ::android::sp<::android::hardware::automotive::evs::V1_0::IEvsDisplay>>, 43 openDisplay, (), (override)); 44 MOCK_METHOD(::android::hardware::Return<void>, closeDisplay, 45 (const ::android::sp<::android::hardware::automotive::evs::V1_0::IEvsDisplay>&), 46 (override)); 47 MOCK_METHOD( 48 ::android::hardware::Return<::android::hardware::automotive::evs::V1_0::DisplayState>, 49 getDisplayState, (), (override)); 50 MOCK_METHOD(::android::hardware::Return<void>, getCameraList_1_1, (getCameraList_1_1_cb)); 51 MOCK_METHOD(::android::hardware::Return< 52 ::android::sp<::android::hardware::automotive::evs::V1_1::IEvsCamera>>, 53 openCamera_1_1, 54 (const ::android::hardware::hidl_string&, 55 const ::android::hardware::camera::device::V3_2::Stream&)); 56 MOCK_METHOD(::android::hardware::Return<bool>, isHardware, (), (override)); 57 MOCK_METHOD(::android::hardware::Return<void>, getDisplayIdList, (getDisplayIdList_cb)); 58 MOCK_METHOD(::android::hardware::Return< 59 ::android::sp<::android::hardware::automotive::evs::V1_1::IEvsDisplay>>, 60 openDisplay_1_1, (uint8_t id), (override)); 61 MOCK_METHOD(::android::hardware::Return<void>, getUltrasonicsArrayList, 62 (getUltrasonicsArrayList_cb), (override)); 63 MOCK_METHOD(::android::hardware::Return<::android::sp< 64 ::android::hardware::automotive::evs::V1_1::IEvsUltrasonicsArray>>, 65 openUltrasonicsArray, (const ::android::hardware::hidl_string& ultrasonicsArrayId), 66 (override)); 67 MOCK_METHOD( 68 ::android::hardware::Return<void>, closeUltrasonicsArray, 69 (const ::android::sp<::android::hardware::automotive::evs::V1_1::IEvsUltrasonicsArray>& 70 evsUltrasonicsArray)); 71 MOCK_METHOD(::android::hardware::Return<void>, interfaceChain, (interfaceChain_cb), (override)); 72 MOCK_METHOD(::android::hardware::Return<void>, debug, 73 (const ::android::hardware::hidl_handle&, 74 const ::android::hardware::hidl_vec<::android::hardware::hidl_string>&), 75 (override)); 76 MOCK_METHOD(::android::hardware::Return<void>, interfaceDescriptor, (interfaceDescriptor_cb), 77 (override)); 78 }; 79 80 using NiceMockEvsEnumerator = ::testing::NiceMock<MockEvsEnumerator>; 81 82 } // namespace android::automotive::evs::V1_1::implementation 83 84 #endif // CPP_EVS_MANAGER_1_1_TEST_UNIT_MOCKEVSENUMERATOR_H_ 85