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