1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef UNITTEST_OHOS_ABILITY_RUNTIME_WANT_SENDER_STUB_IMPL_MOCK_H 17 #define UNITTEST_OHOS_ABILITY_RUNTIME_WANT_SENDER_STUB_IMPL_MOCK_H 18 19 #define private public 20 #include "want_sender_stub.h" 21 #undef private 22 23 #include <gmock/gmock.h> 24 #include <iremote_object.h> 25 #include <iremote_stub.h> 26 #include "want_sender_interface.h" 27 28 namespace OHOS { 29 namespace AAFwk { 30 class WantSenderStubImplMock : public WantSenderStub { 31 public: WantSenderStubImplMock()32 WantSenderStubImplMock() 33 {} ~WantSenderStubImplMock()34 virtual ~WantSenderStubImplMock() 35 {} 36 InvokeSendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)37 int InvokeSendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) 38 { 39 code_ = code; 40 return 0; 41 } 42 InvokeErrorSendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)43 int InvokeErrorSendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) 44 { 45 code_ = code; 46 return UNKNOWN_ERROR; 47 } 48 49 int code_ = 0; 50 Send(SenderInfo & senderInfo)51 virtual void Send(SenderInfo& senderInfo) {}; 52 }; 53 } // namespace AAFwk 54 } // namespace OHOS 55 56 #endif // UNITTEST_OHOS_ABILITY_RUNTIME_WANT_SENDER_STUB_IMPL_MOCK_H 57