RDK Documentation (Open Sourced RDK Components)
iarmMgrMocks.h
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef AAMP_IARM_MGR_MOCKS_H
21 #define AAMP_IARM_MGR_MOCKS_H
22 
23 #include "libIBus.h"
24 #include "host.hpp"
25 #include "videoOutputPort.hpp"
26 #include "pixelResolution.hpp"
27 #include "manager.hpp"
28 #include <gmock/gmock.h>
29 
30 using namespace device;
31 
32 /* IARM Bus library mock. */
34 {
35  public:
36  MOCK_METHOD(IARM_Result_t, IARM_Bus_Call, (const char *ownerName,
37  const char *methodName,
38  void *arg,
39  size_t argLen));
40 
41  MOCK_METHOD(IARM_Result_t, IARM_Bus_Connect, ());
42 
43  MOCK_METHOD(IARM_Result_t, IARM_Bus_Init, (const char *name));
44 
45  MOCK_METHOD(IARM_Result_t, IARM_Bus_RegisterEventHandler, (const char *ownerName,
46  IARM_EventId_t eventId,
47  IARM_EventHandler_t handler));
48 
49  MOCK_METHOD(IARM_Result_t, IARM_Bus_RemoveEventHandler, (const char *ownerName,
50  IARM_EventId_t eventId,
51  IARM_EventHandler_t handler));
52 };
53 
54 extern AampMockIarmBus *g_mockIarmBus;
55 
56 /* Device settings library mocks. */
58 {
59  public:
60  MOCK_METHOD(VideoOutputPort &, getVideoOutputPort, (const std::string &name));
61 };
62 
64 {
65  public:
66  MOCK_METHOD(void, DeInitialize, ());
67  MOCK_METHOD(void, Initialize, ());
68 };
69 
71 {
72  public:
73  MOCK_METHOD(int, getHDCPCurrentProtocol, ());
74  MOCK_METHOD(int, getHDCPProtocol, ());
75  MOCK_METHOD(int, getHDCPReceiverProtocol, ());
76  MOCK_METHOD(int, getHDCPStatus, ());
77  MOCK_METHOD(const VideoResolution &, getResolution, ());
78  MOCK_METHOD(bool, isContentProtected, (), (const));
79  MOCK_METHOD(bool, isDisplayConnected, (), (const));
80 };
81 
83 {
84  public:
85  MOCK_METHOD(const PixelResolution &, getPixelResolution, (), (const));
86 };
87 
88 extern AampMockDeviceHost *g_mockDeviceHost;
89 extern AampMockDeviceManager *g_mockDeviceManager;
90 extern AampMockDeviceVideoOutputPort *g_mockVideoOutputPort;
91 
92 #endif /* AAMP_IARM_MGR_MOCKS_H */
device::VideoResolution
Class extending DSConstant to implement the videoResolution interface.
Definition: videoResolution.hpp:57
device::PixelResolution
This class extends DSConstant to manages the pixel resolution of the video.
Definition: pixelResolution.hpp:51
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
manager.hpp
It contains class referenced by manager.cpp file.
IARM_Bus_RegisterEventHandler
IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
This API register to listen to event and provide the callback function for event notification....
Definition: iarmMgrMocks.cpp:43
IARM_Bus_RemoveEventHandler
IARM_Result_t IARM_Bus_RemoveEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
Remove specific handler registered for the given event.
Definition: iarmMgrMocks.cpp:50
libIBus.h
RDK IARM-Bus API Declarations.
AampMockIarmBus
Definition: iarmMgrMocks.h:33
AampMockDeviceVideoOutputPort
Definition: iarmMgrMocks.h:70
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
AampMockDeviceManager
Definition: iarmMgrMocks.h:63
IARM_EventHandler_t
void(* IARM_EventHandler_t)(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
Function signature for event handlers.
Definition: libIBus.h:125
AampMockDevicePixelResolution
Definition: iarmMgrMocks.h:82
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
AampMockDeviceHost
Definition: iarmMgrMocks.h:57
pixelResolution.hpp
This file defines PixelResolution class for managing video resolution types.
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38