• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 IMF_MOCK_IREMOTE_OBJECT_H
17 #define IMF_MOCK_IREMOTE_OBJECT_H
18 #include "iremote_broker.h"
19 #include "iremote_object.h"
20 
21 namespace OHOS {
22 class MockIRemoteObject : public IRemoteObject {
23 public:
MockIRemoteObject()24     MockIRemoteObject() : IRemoteObject(u"mock_i_remote_object") { }
25 
~MockIRemoteObject()26     ~MockIRemoteObject() { }
27 
GetObjectRefCount()28     int32_t GetObjectRefCount() override
29     {
30         return 0;
31     }
32 
SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)33     int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override
34     {
35         (void)code;
36         (void)data;
37         (void)reply;
38         (void)option;
39         return 0;
40     }
41 
IsProxyObject()42     bool IsProxyObject() const override
43     {
44         return true;
45     }
46 
CheckObjectLegality()47     bool CheckObjectLegality() const override
48     {
49         return true;
50     }
51 
AddDeathRecipient(const sptr<DeathRecipient> & recipient)52     bool AddDeathRecipient(const sptr<DeathRecipient> &recipient) override
53     {
54         (void)recipient;
55         return true;
56     }
57 
RemoveDeathRecipient(const sptr<DeathRecipient> & recipient)58     bool RemoveDeathRecipient(const sptr<DeathRecipient> &recipient) override
59     {
60         (void)recipient;
61         return true;
62     }
63 
Marshalling(Parcel & parcel)64     bool Marshalling(Parcel &parcel) const override
65     {
66         (void)parcel;
67         return true;
68     }
69 
AsInterface()70     sptr<IRemoteBroker> AsInterface() override
71     {
72         return nullptr;
73     }
74 
Dump(int fd,const std::vector<std::u16string> & args)75     int Dump(int fd, const std::vector<std::u16string> &args) override
76     {
77         (void)fd;
78         return 0;
79     }
80 };
81 } // namespace OHOS
82 #endif // IMF_MOCK_IREMOTE_OBJECT_H