Skip to content

Commit 5c3a9aa

Browse files
committed
AVInput COM-RPC Support: WIP
1 parent 60140c1 commit 5c3a9aa

File tree

1 file changed

+65
-27
lines changed

1 file changed

+65
-27
lines changed

Tests/L1Tests/tests/test_AVInput.cpp

Lines changed: 65 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,25 @@ class AVInputTest : public ::testing::Test {
5353

5454
Core::ProxyType<Plugin::AVInput> plugin;
5555
Core::ProxyType<Plugin::AVInputImplementation> AVInputImpl;
56-
Core::ProxyType<WorkerPoolImplementation> workerPool;
56+
// <pca> debug
57+
//Core::ProxyType<WorkerPoolImplementation> workerPool;
58+
// </pca>
5759

5860
NiceMock<COMLinkMock> comLinkMock;
5961
NiceMock<ServiceMock> service;
60-
NiceMock<FactoriesImplementation> factoriesImplementation;
62+
// <pca>
63+
//NiceMock<FactoriesImplementation> factoriesImplementation;
64+
// </pca>
6165

6266
WrapsImplMock* p_wrapsImplMock = nullptr;
6367
ServiceMock* p_serviceMock = nullptr;
6468
AVInputMock* p_avInputMock = nullptr;
6569
HdmiInputImplMock* p_hdmiInputImplMock = nullptr;
6670
CompositeInputImplMock* p_compositeInputImplMock = nullptr;
6771
HostImplMock* p_HostImplMock = nullptr;
68-
IarmBusImplMock* p_iarmBusImplMock = nullptr;
72+
// <pca> debug
73+
//IarmBusImplMock* p_iarmBusImplMock = nullptr;
74+
// </pca>
6975

7076
Exchange::IAVInput::IDevicesChangedNotification *OnDevicesChangedNotification = nullptr;
7177
Exchange::IAVInput::ISignalChangedNotification *OnSignalChangedNotification = nullptr;
@@ -81,12 +87,19 @@ class AVInputTest : public ::testing::Test {
8187
IARM_EventHandler_t dsAVVideoModeEventHandler;
8288
IARM_EventHandler_t dsAviContentTypeEventHandler;
8389

90+
// <pca> debug
91+
// AVInputTest()
92+
// : plugin(Core::ProxyType<Plugin::AVInput>::Create())
93+
// , handler(*(plugin))
94+
// , INIT_CONX(1, 0) , workerPool(Core::ProxyType<WorkerPoolImplementation>::Create(
95+
// 2, Core::Thread::DefaultStackSize(), 16))
96+
// {
8497
AVInputTest()
8598
: plugin(Core::ProxyType<Plugin::AVInput>::Create())
8699
, handler(*(plugin))
87-
, INIT_CONX(1, 0) , workerPool(Core::ProxyType<WorkerPoolImplementation>::Create(
88-
2, Core::Thread::DefaultStackSize(), 16))
100+
, INIT_CONX(1, 0)
89101
{
102+
// </pca>
90103
printf("*** _DEBUG: AVInputTest ctor: entry");
91104

92105
p_serviceMock = new NiceMock <ServiceMock>;
@@ -95,11 +108,18 @@ class AVInputTest : public ::testing::Test {
95108

96109
Wraps::setImpl(p_wrapsImplMock);
97110

98-
PluginHost::IFactories::Assign(&factoriesImplementation);
111+
// <pca> debug
112+
//PluginHost::IFactories::Assign(&factoriesImplementation);
113+
// </pca>
99114

100-
dispatcher = static_cast<PLUGINHOST_DISPATCHER*>(plugin->QueryInterface(PLUGINHOST_DISPATCHER_ID));
101-
dispatcher->Activate(&service);
115+
// <pca> debug
116+
// dispatcher = static_cast<PLUGINHOST_DISPATCHER*>(plugin->QueryInterface(PLUGINHOST_DISPATCHER_ID));
117+
// dispatcher->Activate(&service);
118+
// </pca>
102119

120+
// <pca> debug
121+
#if 0
122+
// </pca>
103123
ON_CALL(*p_avInputMock, Register(::testing::Matcher<Exchange::IAVInput::IDevicesChangedNotification*>(::testing::_)))
104124
.WillByDefault(::testing::Invoke(
105125
[&](Exchange::IAVInput::IDevicesChangedNotification *notification){
@@ -154,6 +174,13 @@ class AVInputTest : public ::testing::Test {
154174
.WillByDefault(::testing::Return(AVInputImpl));
155175
#endif
156176

177+
// <pca> debug
178+
#endif
179+
// </pca>
180+
181+
// <pca>
182+
#if 0
183+
// </pca>
157184
p_iarmBusImplMock = new NiceMock<IarmBusImplMock>;
158185
IarmBus::setImpl(p_iarmBusImplMock);
159186

@@ -206,9 +233,14 @@ class AVInputTest : public ::testing::Test {
206233
}
207234
return IARM_RESULT_SUCCESS;
208235
}));
236+
// <pca>
237+
#endif
238+
// </pca>
209239

210-
Core::IWorkerPool::Assign(&(*workerPool));
211-
workerPool->Run();
240+
// <pca> debug
241+
// Core::IWorkerPool::Assign(&(*workerPool));
242+
// workerPool->Run();
243+
// </pca>
212244

213245
plugin->Initialize(&service);
214246

@@ -227,8 +259,10 @@ class AVInputTest : public ::testing::Test {
227259
TEST_LOG("*** _DEBUG: AVInputTest xtor");
228260
plugin->Deinitialize(&service);
229261

230-
Core::IWorkerPool::Assign(nullptr);
231-
workerPool.Release();
262+
// <pca> debug
263+
// Core::IWorkerPool::Assign(nullptr);
264+
// workerPool.Release();
265+
// </pca>
232266

233267
if (p_serviceMock != nullptr)
234268
{
@@ -268,16 +302,20 @@ class AVInputTest : public ::testing::Test {
268302
p_HostImplMock = nullptr;
269303
}
270304

271-
dispatcher->Deactivate();
272-
dispatcher->Release();
305+
// <pca> debug
306+
// dispatcher->Deactivate();
307+
// dispatcher->Release();
308+
// </pca>
273309

274310
PluginHost::IFactories::Assign(nullptr);
275311

276-
IarmBus::setImpl(nullptr);
277-
if (p_iarmBusImplMock != nullptr) {
278-
delete p_iarmBusImplMock;
279-
p_iarmBusImplMock = nullptr;
280-
}
312+
// <pca> debug
313+
// IarmBus::setImpl(nullptr);
314+
// if (p_iarmBusImplMock != nullptr) {
315+
// delete p_iarmBusImplMock;
316+
// p_iarmBusImplMock = nullptr;
317+
// }
318+
// </pca>
281319
}
282320
};
283321

@@ -311,14 +349,14 @@ TEST_F(AVInputTest, RegisteredMethods)
311349
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getGameFeatureStatus")));
312350
}
313351

314-
// TEST_F(AVInputTest, contentProtected)
315-
// {
316-
// TEST_LOG("*** _DEBUG: TEST_F(AVInputTest, contentProtected): entry");
317-
// EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("contentProtected"), _T("{}"), response));
318-
// TEST_LOG("*** _DEBUG: TEST_F(AVInputTest, contentProtected): Mark 1");
319-
// EXPECT_EQ(response, string("{\"isContentProtected\":true,\"success\":true}"));
320-
// TEST_LOG("*** _DEBUG: TEST_F(AVInputTest, contentProtected): Mark 2");
321-
// }
352+
TEST_F(AVInputTest, contentProtected)
353+
{
354+
TEST_LOG("*** _DEBUG: TEST_F(AVInputTest, contentProtected): entry");
355+
EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("contentProtected"), _T("{}"), response));
356+
TEST_LOG("*** _DEBUG: TEST_F(AVInputTest, contentProtected): Mark 1");
357+
EXPECT_EQ(response, string("{\"isContentProtected\":true,\"success\":true}"));
358+
TEST_LOG("*** _DEBUG: TEST_F(AVInputTest, contentProtected): Mark 2");
359+
}
322360
// <pca>
323361
#endif
324362
// </pca>

0 commit comments

Comments
 (0)