• 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 #ifndef MESSAGE_PARCEL_MOCK_H
16 #define MESSAGE_PARCEL_MOCK_H
17 
18 #include <gmock/gmock.h>
19 
20 #include "idevmgr_hdi.h"
21 #include "infrared_emitter_controller.h"
22 
23 namespace OHOS {
24 namespace MMI {
25 class DfsMessageParcel {
26 public:
27     virtual ~DfsMessageParcel() = default;
28 public:
29     virtual sptr<OHOS::HDI::Consumerir::V1_0::ConsumerIr> Get(const std::string& serviceName, bool isStub) = 0;
30     virtual sptr<OHOS::HDI::DeviceManager::V1_0::IDeviceManager> Get() = 0;
31 public:
32     static inline std::shared_ptr<DfsMessageParcel> messageParcel = nullptr;
33 };
34 
35 class MessageParcelMock : public DfsMessageParcel {
36 public:
37     MOCK_METHOD2(Get, sptr<OHOS::HDI::Consumerir::V1_0::ConsumerIr>(const std::string& serviceName, bool isStub));
38     MOCK_METHOD0(Get, sptr<OHOS::HDI::DeviceManager::V1_0::IDeviceManager>());
39 };
40 } // namespace MMI
41 } // namespace OHOS
42 #endif