Skip to content

Commit c026b3b

Browse files
committed
AVInput COM-RPC Support: WIP
1 parent a811010 commit c026b3b

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

AVInput/AVInput.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ namespace Plugin {
4444
virtual ~AVInput();
4545

4646
BEGIN_INTERFACE_MAP(AVInput)
47-
INTERFACE_ENTRY(PluginHost::IPlugin)
48-
INTERFACE_ENTRY(PluginHost::IDispatcher)
49-
INTERFACE_AGGREGATE(Exchange::IAVInput, _avInput)
47+
INTERFACE_ENTRY(PluginHost::IPlugin)
48+
INTERFACE_ENTRY(PluginHost::IDispatcher)
49+
INTERFACE_AGGREGATE(Exchange::IAVInput, _avInput)
5050
END_INTERFACE_MAP
5151

5252
// IPlugin methods
@@ -94,13 +94,13 @@ namespace Plugin {
9494
}
9595

9696
BEGIN_INTERFACE_MAP(Notification)
97-
INTERFACE_ENTRY(Exchange::IAVInput::IDevicesChangedNotification)
98-
INTERFACE_ENTRY(Exchange::IAVInput::ISignalChangedNotification)
99-
INTERFACE_ENTRY(Exchange::IAVInput::IInputStatusChangedNotification)
100-
INTERFACE_ENTRY(Exchange::IAVInput::IVideoStreamInfoUpdateNotification)
101-
INTERFACE_ENTRY(Exchange::IAVInput::IGameFeatureStatusUpdateNotification)
102-
INTERFACE_ENTRY(Exchange::IAVInput::IHdmiContentTypeUpdateNotification)
103-
INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
97+
INTERFACE_ENTRY(Exchange::IAVInput::IDevicesChangedNotification)
98+
INTERFACE_ENTRY(Exchange::IAVInput::ISignalChangedNotification)
99+
INTERFACE_ENTRY(Exchange::IAVInput::IInputStatusChangedNotification)
100+
INTERFACE_ENTRY(Exchange::IAVInput::IVideoStreamInfoUpdateNotification)
101+
INTERFACE_ENTRY(Exchange::IAVInput::IGameFeatureStatusUpdateNotification)
102+
INTERFACE_ENTRY(Exchange::IAVInput::IHdmiContentTypeUpdateNotification)
103+
INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
104104
END_INTERFACE_MAP
105105

106106
void Activated(RPC::IRemoteConnection*) override

Tests/L1Tests/tests/test_AVInput.cpp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
**/
1919

2020
#include <gtest/gtest.h>
21+
#include "COMLinkMock.h"
22+
#include <gmock/gmock.h>
2123

2224
#include "AVInput.h"
2325

@@ -29,24 +31,51 @@
2931
#include "ServiceMock.h"
3032
#include "ThunderPortability.h"
3133

34+
#include "AVInputImplementation.h"
35+
3236
using namespace WPEFramework;
3337

3438
using ::testing::NiceMock;
3539

3640
class AVInputTest : public ::testing::Test {
3741
protected:
3842
Core::ProxyType<Plugin::AVInput> plugin;
43+
Core::ProxyType<Plugin::AVInputImplementation> AVInputImpl;
44+
45+
NiceMock<COMLinkMock> comLinkMock;
46+
3947
Core::JSONRPC::Handler& handler;
4048
DECL_CORE_JSONRPC_CONX connection;
4149
string response;
4250

51+
AVInputMock* p_avInputMock = nullptr;
52+
4353
AVInputTest()
4454
: plugin(Core::ProxyType<Plugin::AVInput>::Create())
4555
, handler(*(plugin))
4656
, INIT_CONX(1, 0)
4757
{
58+
p_avInputMock = new NiceMock<AVInputMock>;
59+
60+
#ifdef USE_THUNDER_R4
61+
ON_CALL(comLinkMock, Instantiate(::testing::_, ::testing::_, ::testing::_))
62+
.WillByDefault(::testing::Invoke(
63+
[&](const RPC::Object& object, const uint32_t waitTime, uint32_t& connectionId) {
64+
AVInputImpl = Core::ProxyType<Plugin::AVInputImplementation>::Create();
65+
return &AVInputImpl;
66+
}));
67+
#else
68+
ON_CALL(comLinkMock, Instantiate(::testing::_, ::testing::_, ::testing::_, ::testing::_, ::testing::_))
69+
.WillByDefault(::testing::Return(AVInputImpl));
70+
#endif
71+
72+
plugin->Initialize(&service);
73+
74+
}
75+
virtual ~AVInputTest()
76+
{
77+
plugin->Deinitialize(&service);
4878
}
49-
virtual ~AVInputTest() = default;
5079
};
5180

5281
TEST_F(AVInputTest, RegisteredMethods)

0 commit comments

Comments
 (0)