1 /* 2 * Copyright 2022 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 #pragma once 18 19 #include <android/hardware/automotive/evs/1.1/IEvsDisplay.h> 20 #include <android/hardware/automotive/evs/1.1/IEvsEnumerator.h> 21 #include <android/hardware/camera/device/3.2/ICameraDevice.h> 22 #include <gmock/gmock.h> 23 #include <gtest/gtest.h> 24 25 namespace aidl::android::automotive::evs::implementation { 26 27 namespace hidlevs = ::android::hardware::automotive::evs; 28 29 class MockHidlEvsEnumerator : public hidlevs::V1_1::IEvsEnumerator { 30 public: 31 MockHidlEvsEnumerator() = default; 32 virtual ~MockHidlEvsEnumerator() = default; 33 34 // Methods from hardware::automotive::evs::V1_0::IEvsEnumerator follow. 35 MOCK_METHOD(::android::hardware::Return<void>, getCameraList, (getCameraList_cb), (override)); 36 MOCK_METHOD(::android::hardware::Return<::android::sp<hidlevs::V1_0::IEvsCamera>>, openCamera, 37 (const ::android::hardware::hidl_string&), (override)); 38 MOCK_METHOD(::android::hardware::Return<void>, closeCamera, 39 (const ::android::sp<hidlevs::V1_0::IEvsCamera>&), (override)); 40 MOCK_METHOD(::android::hardware::Return<::android::sp<hidlevs::V1_0::IEvsDisplay>>, openDisplay, 41 (), (override)); 42 MOCK_METHOD(::android::hardware::Return<void>, closeDisplay, 43 (const ::android::sp<hidlevs::V1_0::IEvsDisplay>&), (override)); 44 MOCK_METHOD(::android::hardware::Return<hidlevs::V1_0::DisplayState>, getDisplayState, (), 45 (override)); 46 47 // Methods from hardware::automotive::evs::V1_1::IEvsEnumerator follow. 48 MOCK_METHOD(::android::hardware::Return<void>, getCameraList_1_1, (getCameraList_1_1_cb), 49 (override)); 50 MOCK_METHOD(::android::hardware::Return<::android::sp<hidlevs::V1_1::IEvsCamera>>, 51 openCamera_1_1, 52 (const ::android::hardware::hidl_string&, 53 const ::android::hardware::camera::device::V3_2::Stream&), 54 (override)); 55 MOCK_METHOD(::android::hardware::Return<bool>, isHardware, (), (override)); 56 MOCK_METHOD(::android::hardware::Return<void>, getDisplayIdList, (getDisplayIdList_cb), 57 (override)); 58 MOCK_METHOD(::android::hardware::Return<::android::sp<hidlevs::V1_1::IEvsDisplay>>, 59 openDisplay_1_1, (uint8_t), (override)); 60 MOCK_METHOD(::android::hardware::Return<void>, getUltrasonicsArrayList, 61 (getUltrasonicsArrayList_cb), (override)); 62 MOCK_METHOD(::android::hardware::Return<::android::sp<hidlevs::V1_1::IEvsUltrasonicsArray>>, 63 openUltrasonicsArray, (const ::android::hardware::hidl_string&), (override)); 64 MOCK_METHOD(::android::hardware::Return<void>, closeUltrasonicsArray, 65 (const ::android::sp<hidlevs::V1_1::IEvsUltrasonicsArray>&), (override)); 66 }; 67 68 using NiceMockHidlEvsEnumerator = ::testing::NiceMock<MockHidlEvsEnumerator>; 69 70 } // namespace aidl::android::automotive::evs::implementation 71