• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <aidl/android/hardware/automotive/evs/BnEvsEnumerator.h>
20 #include <aidl/android/hardware/automotive/evs/BnEvsEnumeratorStatusCallback.h>
21 #include <aidl/android/hardware/automotive/evs/IEvsDisplay.h>
22 #include <gmock/gmock.h>
23 #include <gtest/gtest.h>
24 
25 namespace aidl::android::automotive::evs::implementation {
26 
27 namespace aidlevs = ::aidl::android::hardware::automotive::evs;
28 
29 class MockEvsEnumerator : public aidlevs::BnEvsEnumerator {
30 public:
31     MockEvsEnumerator() = default;
32     virtual ~MockEvsEnumerator() = default;
33 
34     MOCK_METHOD(::ndk::ScopedAStatus, isHardware, (bool*), (override));
35     MOCK_METHOD(::ndk::ScopedAStatus, openCamera,
36                 (const std::string&, const aidlevs::Stream&, std::shared_ptr<aidlevs::IEvsCamera>*),
37                 (override));
38     MOCK_METHOD(::ndk::ScopedAStatus, closeCamera, (const std::shared_ptr<aidlevs::IEvsCamera>&),
39                 (override));
40     MOCK_METHOD(::ndk::ScopedAStatus, getCameraList, (std::vector<aidlevs::CameraDesc>*),
41                 (override));
42     MOCK_METHOD(::ndk::ScopedAStatus, getStreamList,
43                 (const aidlevs::CameraDesc&, std::vector<aidlevs::Stream>*), (override));
44     MOCK_METHOD(::ndk::ScopedAStatus, openDisplay,
45                 (int32_t, std::shared_ptr<aidlevs::IEvsDisplay>*), (override));
46     MOCK_METHOD(::ndk::ScopedAStatus, closeDisplay, (const std::shared_ptr<aidlevs::IEvsDisplay>&),
47                 (override));
48     MOCK_METHOD(::ndk::ScopedAStatus, getDisplayIdList, (std::vector<uint8_t>*), (override));
49     MOCK_METHOD(::ndk::ScopedAStatus, getDisplayState, (aidlevs::DisplayState*), (override));
50     MOCK_METHOD(::ndk::ScopedAStatus, getDisplayStateById, (int32_t, aidlevs::DisplayState*),
51                 (override));
52     MOCK_METHOD(::ndk::ScopedAStatus, registerStatusCallback,
53                 (const std::shared_ptr<aidlevs::IEvsEnumeratorStatusCallback>&), (override));
54     MOCK_METHOD(::ndk::ScopedAStatus, openUltrasonicsArray,
55                 (const std::string&, std::shared_ptr<aidlevs::IEvsUltrasonicsArray>*), (override));
56     MOCK_METHOD(::ndk::ScopedAStatus, closeUltrasonicsArray,
57                 (const std::shared_ptr<aidlevs::IEvsUltrasonicsArray>&), (override));
58     MOCK_METHOD(::ndk::ScopedAStatus, getUltrasonicsArrayList,
59                 (std::vector<aidlevs::UltrasonicsArrayDesc>*), (override));
60 };
61 
62 using NiceMockEvsEnumerator = ::testing::NiceMock<MockEvsEnumerator>;
63 
64 }  // namespace aidl::android::automotive::evs::implementation
65