/** * Copyright (c) 2022, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include #include #include #include namespace android { namespace automotive { namespace watchdog { class MockHidlServiceManager : public android::hidl::manager::V1_0::IServiceManager { public: using IServiceManager = android::hidl::manager::V1_0::IServiceManager; using IBase = android::hidl::base::V1_0::IBase; template using Return = android::hardware::Return; using String = const android::hardware::hidl_string&; ~MockHidlServiceManager() = default; #define MOCK_METHOD_CB(name) MOCK_METHOD1(name, Return(IServiceManager::name##_cb)) MOCK_METHOD2(get, Return>(String, String)); MOCK_METHOD2(add, Return(String, const android::sp&)); MOCK_METHOD2(getTransport, Return(String, String)); MOCK_METHOD_CB(list); MOCK_METHOD2(listByInterface, Return(String, listByInterface_cb)); MOCK_METHOD3(registerForNotifications, Return(String, String, const sp&)); MOCK_METHOD_CB(debugDump); MOCK_METHOD2(registerPassthroughClient, Return(String, String)); MOCK_METHOD_CB(interfaceChain); MOCK_METHOD2(debug, Return(const android::hardware::hidl_handle&, const android::hardware::hidl_vec&)); MOCK_METHOD_CB(interfaceDescriptor); MOCK_METHOD_CB(getHashChain); MOCK_METHOD0(setHalInstrumentation, Return()); MOCK_METHOD2(linkToDeath, Return(const sp&, uint64_t)); MOCK_METHOD0(ping, Return()); MOCK_METHOD_CB(getDebugInfo); MOCK_METHOD0(notifySyspropsChanged, Return()); MOCK_METHOD1(unlinkToDeath, Return(const sp&)); }; } // namespace watchdog } // namespace automotive } // namespace android