!46 修复sptr指针的check问题

Merge pull request !46 from 李天刚/master
This commit is contained in:
openharmony_ci
2023-07-24 02:01:10 +00:00
committed by Gitee
16 changed files with 193 additions and 193 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -164,7 +164,7 @@ int DistributedInputInnerTest::CheckSinkProxy() const
HWTEST_F(DistributedInputInnerTest, PrepareRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "PrepareRemoteInput01";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t ret = DistributedInputKit::PrepareRemoteInput(deviceId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -181,7 +181,7 @@ HWTEST_F(DistributedInputInnerTest, PrepareRemoteInput03, testing::ext::TestSize
{
std::string srcId = "PrepareRemoteInput_test";
std::string sinkId = "PrepareRemoteInput_test";
sptr<IPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<IPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t ret = DistributedInputKit::PrepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -198,7 +198,7 @@ HWTEST_F(DistributedInputInnerTest, PrepareRemoteInput04, testing::ext::TestSize
HWTEST_F(DistributedInputInnerTest, UnprepareRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "UnprepareRemoteInput01";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = DistributedInputKit::UnprepareRemoteInput(deviceId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -215,7 +215,7 @@ HWTEST_F(DistributedInputInnerTest, UnprepareRemoteInput03, testing::ext::TestSi
{
std::string srcId = "PrepareRemoteInput_src";
std::string sinkId = "PrepareRemoteInput_sink";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = DistributedInputKit::UnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -232,7 +232,7 @@ HWTEST_F(DistributedInputInnerTest, UnprepareRemoteInput04, testing::ext::TestSi
HWTEST_F(DistributedInputInnerTest, StartRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "StartRemoteInput01";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret =
DistributedInputKit::StartRemoteInput(deviceId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -251,7 +251,7 @@ HWTEST_F(DistributedInputInnerTest, StartRemoteInput03, testing::ext::TestSize.L
{
std::string sinkId = "StartRemoteInput_sink";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputKit::StartRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -269,7 +269,7 @@ HWTEST_F(DistributedInputInnerTest, StartRemoteInput05, testing::ext::TestSize.L
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret =
DistributedInputKit::StartRemoteInput(srcId, sinkId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -290,7 +290,7 @@ HWTEST_F(DistributedInputInnerTest, StartRemoteInput07, testing::ext::TestSize.L
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputKit::StartRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -308,7 +308,7 @@ HWTEST_F(DistributedInputInnerTest, StartRemoteInput08, testing::ext::TestSize.L
HWTEST_F(DistributedInputInnerTest, StopRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "StopRemoteInput01";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret =
DistributedInputKit::StopRemoteInput(deviceId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -327,7 +327,7 @@ HWTEST_F(DistributedInputInnerTest, StopRemoteInput03, testing::ext::TestSize.Le
{
std::string sinkId = "StartRemoteInput_test";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputKit::StopRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -345,7 +345,7 @@ HWTEST_F(DistributedInputInnerTest, StopRemoteInput05, testing::ext::TestSize.Le
{
string srcId = "StopRemoteInput03-src";
string sinkId = "StopRemoteInput03-sink";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret =
DistributedInputKit::StopRemoteInput(srcId, sinkId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -366,7 +366,7 @@ HWTEST_F(DistributedInputInnerTest, StopRemoteInput07, testing::ext::TestSize.Le
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputKit::StopRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -473,7 +473,7 @@ HWTEST_F(DistributedInputInnerTest, IsStartDistributedInput03, testing::ext::Tes
HWTEST_F(DistributedInputInnerTest, RegisterInputNodeListener01, testing::ext::TestSize.Level0)
{
sptr<TestInputNodeListener> listener = new TestInputNodeListener();
sptr<TestInputNodeListener> listener(new TestInputNodeListener());
int32_t ret = DistributedInputKit::RegisterInputNodeListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -487,7 +487,7 @@ HWTEST_F(DistributedInputInnerTest, RegisterInputNodeListener02, testing::ext::T
HWTEST_F(DistributedInputInnerTest, UnregisterInputNodeListener01, testing::ext::TestSize.Level0)
{
sptr<TestInputNodeListener> listener = new TestInputNodeListener();
sptr<TestInputNodeListener> listener(new TestInputNodeListener());
int32_t ret = DistributedInputKit::UnregisterInputNodeListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -501,7 +501,7 @@ HWTEST_F(DistributedInputInnerTest, UnregisterInputNodeListener02, testing::ext:
HWTEST_F(DistributedInputInnerTest, RegisterSimulationEventListener01, testing::ext::TestSize.Level0)
{
sptr<TestSimulationEventListenerStub> listener = new TestSimulationEventListenerStub();
sptr<TestSimulationEventListenerStub> listener(new TestSimulationEventListenerStub());
int32_t ret = DistributedInputKit::RegisterSimulationEventListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -515,7 +515,7 @@ HWTEST_F(DistributedInputInnerTest, RegisterSimulationEventListener02, testing::
HWTEST_F(DistributedInputInnerTest, UnregisterSimulationEventListener01, testing::ext::TestSize.Level0)
{
sptr<TestSimulationEventListenerStub> listener = new TestSimulationEventListenerStub();
sptr<TestSimulationEventListenerStub> listener(new TestSimulationEventListenerStub());
int32_t ret = DistributedInputKit::UnregisterSimulationEventListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -178,7 +178,7 @@ void DistributedInputClient::CheckSharingDhIdsCallback()
return;
}
if (!isSharingDhIdsReg) {
sptr<ISharingDhIdListener> listener = new (std::nothrow) SharingDhIdListenerCb();
sptr<ISharingDhIdListener> listener(new (std::nothrow) SharingDhIdListenerCb());
int32_t ret =
DInputSAManager::GetInstance().dInputSinkProxy_->RegisterSharingDhIdListener(listener);
if (ret == DH_SUCCESS) {
@@ -198,7 +198,7 @@ void DistributedInputClient::CheckWhiteListCallback()
return;
}
if (!isAddWhiteListCbReg) {
sptr<AddWhiteListInfosCb> addCallback = new (std::nothrow) AddWhiteListInfosCb();
sptr<AddWhiteListInfosCb> addCallback(new (std::nothrow) AddWhiteListInfosCb());
int32_t ret =
DInputSAManager::GetInstance().dInputSourceProxy_->RegisterAddWhiteListCallback(addCallback);
if (ret == DH_SUCCESS) {
@@ -210,7 +210,7 @@ void DistributedInputClient::CheckWhiteListCallback()
}
}
if (!isDelWhiteListCbReg) {
sptr<DelWhiteListInfosCb> delCallback = new (std::nothrow) DelWhiteListInfosCb();
sptr<DelWhiteListInfosCb> delCallback(new (std::nothrow) DelWhiteListInfosCb());
int32_t ret =
DInputSAManager::GetInstance().dInputSourceProxy_->RegisterDelWhiteListCallback(delCallback);
if (ret == DH_SUCCESS) {
@@ -255,7 +255,7 @@ void DistributedInputClient::CheckSinkScreenInfoCallback()
return;
}
if (!isGetSinkScreenInfosCbReg) {
sptr<GetSinkScreenInfosCb> callback = new (std::nothrow) GetSinkScreenInfosCb();
sptr<GetSinkScreenInfosCb> callback(new (std::nothrow) GetSinkScreenInfosCb());
int32_t ret =
DInputSAManager::GetInstance().dInputSinkProxy_->RegisterGetSinkScreenInfosCallback(callback);
if (ret == DH_SUCCESS) {
@@ -179,7 +179,7 @@ int32_t AddWhiteListInfosCallbackTest::TestDistributedInputSinkStub::RegisterSha
HWTEST_F(AddWhiteListInfosCallbackTest, AddWhiteListInfosCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestAddWhiteListInfosCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestAddWhiteListInfosCallbackStub());
AddWhiteListInfosCallbackProxy callBackProxy(callBackStubPtr);
std::string deviceId = "deviceId0";
std::string json = "json0";
@@ -190,7 +190,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, AddWhiteListInfosCallback01, testing::ex
HWTEST_F(AddWhiteListInfosCallbackTest, GetSinkScreenInfosCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestGetSinkScreenInfosCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestGetSinkScreenInfosCallbackStub());
GetSinkScreenInfosCallbackProxy callBackProxy(callBackStubPtr);
std::string json = "json0";
callBackProxy.OnResult(json);
@@ -199,7 +199,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, GetSinkScreenInfosCallback01, testing::e
HWTEST_F(AddWhiteListInfosCallbackTest, InputNodeListenerStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> nodeListener = new TestInputNodeListenerStub();
sptr<IRemoteObject> nodeListener(new TestInputNodeListenerStub());
InputNodeListenerProxy nodeListenerProxy(nodeListener);
std::string srcDevId = "srcDevId_test";
std::string sinkDevId = "sinkDevId_test";
@@ -214,7 +214,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, InputNodeListenerStub01, testing::ext::T
HWTEST_F(AddWhiteListInfosCallbackTest, InputNodeListenerStub02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> nodeListener = new TestInputNodeListenerStub();
sptr<IRemoteObject> nodeListener(new TestInputNodeListenerStub());
InputNodeListenerProxy nodeListenerProxy(nodeListener);
std::string srcDevId = "srcDevId_test";
std::string sinkDevId = "sinkDevId_test";
@@ -227,7 +227,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, InputNodeListenerStub02, testing::ext::T
HWTEST_F(AddWhiteListInfosCallbackTest, PrepareDInputCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestPrepareDInputCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestPrepareDInputCallbackStub());
PrepareDInputCallbackProxy callBackProxy(callBackStubPtr);
std::string devId = "devId_test";
int32_t status = 0;
@@ -237,7 +237,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, PrepareDInputCallback01, testing::ext::T
HWTEST_F(AddWhiteListInfosCallbackTest, RegisterDInputCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestRegisterDInputCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestRegisterDInputCallbackStub());
RegisterDInputCallbackProxy callBackProxy(callBackStubPtr);
std::string devId = "devId_test";
std::string dhId = "dhId_test";
@@ -249,7 +249,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, RegisterDInputCallback01, testing::ext::
HWTEST_F(AddWhiteListInfosCallbackTest, SharingDhIdListenerStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> sharingStubPtr = new TestSharingDhIdListenerStub();
sptr<IRemoteObject> sharingStubPtr(new TestSharingDhIdListenerStub());
SharingDhIdListenerProxy sharingProxy(sharingStubPtr);
std::string dhId = "dhId_test";
int32_t ret = sharingProxy.OnSharing(dhId);
@@ -258,7 +258,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, SharingDhIdListenerStub01, testing::ext:
HWTEST_F(AddWhiteListInfosCallbackTest, SharingDhIdListenerStub02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> sharingStubPtr = new TestSharingDhIdListenerStub();
sptr<IRemoteObject> sharingStubPtr(new TestSharingDhIdListenerStub());
SharingDhIdListenerProxy sharingProxy(sharingStubPtr);
std::string dhId = "dhId_test";
int32_t ret = sharingProxy.OnNoSharing(dhId);
@@ -267,7 +267,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, SharingDhIdListenerStub02, testing::ext:
HWTEST_F(AddWhiteListInfosCallbackTest, SimulationEventListenerStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> simulationStubPtr = new TestSimulationEventListenerStub();
sptr<IRemoteObject> simulationStubPtr(new TestSimulationEventListenerStub());
SimulationEventListenerProxy sharingProxy(simulationStubPtr);
uint32_t type = 1;
uint32_t code = 1;
@@ -278,7 +278,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, SimulationEventListenerStub01, testing::
HWTEST_F(AddWhiteListInfosCallbackTest, StartDInputCallbackStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestStartDInputCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestStartDInputCallbackStub());
StartDInputCallbackProxy callBackProxy(callBackStubPtr);
std::string devId = "devId_test";
uint32_t inputTypes = static_cast<uint32_t>(DInputDeviceType::ALL);
@@ -289,7 +289,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, StartDInputCallbackStub01, testing::ext:
HWTEST_F(AddWhiteListInfosCallbackTest, StartStopDInputsCallbackStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestStartStopDInputsCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestStartStopDInputsCallbackStub());
StartStopDInputsCallbackProxy callBackProxy(callBackStubPtr);
std::string devId = "devId_test";
int32_t status = 1;
@@ -300,7 +300,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, StartStopDInputsCallbackStub01, testing:
HWTEST_F(AddWhiteListInfosCallbackTest, StartStopResultCallbackStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestStartStopResultCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestStartStopResultCallbackStub());
StartStopResultCallbackProxy callBackProxy(callBackStubPtr);
std::string srcId = "srcId_test";
std::string sinkId = "sinkId_test";
@@ -313,7 +313,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, StartStopResultCallbackStub01, testing::
HWTEST_F(AddWhiteListInfosCallbackTest, StartStopResultCallbackStub02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestStartStopResultCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestStartStopResultCallbackStub());
StartStopResultCallbackProxy callBackProxy(callBackStubPtr);
std::string srcId = "srcId_test";
std::string sinkId = "sinkId_test";
@@ -326,7 +326,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, StartStopResultCallbackStub02, testing::
HWTEST_F(AddWhiteListInfosCallbackTest, StopDInputCallbackStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestStopDInputCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestStopDInputCallbackStub());
StopDInputCallbackProxy callBackProxy(callBackStubPtr);
std::string devId = "devId_test";
uint32_t inputTypes = static_cast<uint32_t>(DInputDeviceType::ALL);
@@ -337,7 +337,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, StopDInputCallbackStub01, testing::ext::
HWTEST_F(AddWhiteListInfosCallbackTest, DistributedInputSinkStub01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> sinkStubPtr = new TestDistributedInputSinkStub();
sptr<IRemoteObject> sinkStubPtr(new TestDistributedInputSinkStub());
DistributedInputSinkProxy sinkProxy(sinkStubPtr);
int32_t ret = sinkProxy.Init();
EXPECT_EQ(DH_SUCCESS, ret);
@@ -349,7 +349,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, DistributedInputSinkStub01, testing::ext
ret = sinkProxy.RegisterGetSinkScreenInfosCallback(callback);
EXPECT_EQ(ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL, ret);
sptr<IGetSinkScreenInfosCallback> sinkScreenCb = new TestGetSinkScreenInfosCallbackStub();
sptr<IGetSinkScreenInfosCallback> sinkScreenCb(new TestGetSinkScreenInfosCallbackStub());
ret = sinkProxy.RegisterGetSinkScreenInfosCallback(sinkScreenCb);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -357,7 +357,7 @@ HWTEST_F(AddWhiteListInfosCallbackTest, DistributedInputSinkStub01, testing::ext
ret = sinkProxy.NotifyStopDScreen(srcScreenInfoKey);
EXPECT_EQ(DH_SUCCESS, ret);
sptr<ISharingDhIdListener> sharingDhIdListene = new TestSharingDhIdListenerStub();
sptr<ISharingDhIdListener> sharingDhIdListene(new TestSharingDhIdListenerStub());
ret = sinkProxy.RegisterSharingDhIdListener(sharingDhIdListene);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -194,7 +194,7 @@ HWTEST_F(DistributedInputClientTest, UnregisterDistributedHardware02, testing::e
HWTEST_F(DistributedInputClientTest, PrepareRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "PrepareRemoteInput01";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().PrepareRemoteInput(deviceId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_PREPARE_FAIL, ret);
}
@@ -213,7 +213,7 @@ HWTEST_F(DistributedInputClientTest, PrepareRemoteInput03, testing::ext::TestSiz
{
std::string srcId = "PrepareRemoteInput_test";
std::string sinkId = "PrepareRemoteInput_test";
sptr<IPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<IPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().PrepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_PREPARE_FAIL, ret);
}
@@ -230,7 +230,7 @@ HWTEST_F(DistributedInputClientTest, PrepareRemoteInput04, testing::ext::TestSiz
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "UnprepareRemoteInput01";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().UnprepareRemoteInput(deviceId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
}
@@ -247,7 +247,7 @@ HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput03, testing::ext::TestS
{
std::string srcId = "PrepareRemoteInput_src";
std::string sinkId = "PrepareRemoteInput_sink";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().UnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
}
@@ -264,7 +264,7 @@ HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput04, testing::ext::TestS
HWTEST_F(DistributedInputClientTest, StartRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "StartRemoteInput01";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StartRemoteInput(
deviceId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
@@ -283,7 +283,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput03, testing::ext::TestSize.
{
std::string sinkId = "StartRemoteInput_sink";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StartRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
@@ -301,7 +301,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput05, testing::ext::TestSize.
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StartRemoteInput(
srcId, sinkId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
@@ -322,7 +322,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput07, testing::ext::TestSize.
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StartRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
@@ -340,7 +340,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput08, testing::ext::TestSize.
HWTEST_F(DistributedInputClientTest, StopRemoteInput01, testing::ext::TestSize.Level0)
{
string deviceId = "StopRemoteInput01";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StopRemoteInput(
deviceId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -359,7 +359,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput03, testing::ext::TestSize.L
{
std::string sinkId = "StartRemoteInput_test";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StopRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
}
@@ -377,7 +377,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput05, testing::ext::TestSize.L
{
string srcId = "StopRemoteInput03-src";
string sinkId = "StopRemoteInput03-sink";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StopRemoteInput(
srcId, sinkId, static_cast<uint32_t>(DInputDeviceType::ALL), callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -398,7 +398,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput07, testing::ext::TestSize.L
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
std::vector<std::string> dhIds = {"dhIds_test"};
sptr<TestStartStopDInputCallback> callback = new TestStartStopDInputCallback();
sptr<TestStartStopDInputCallback> callback(new TestStartStopDInputCallback());
int32_t ret = DistributedInputClient::GetInstance().StopRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -41,7 +41,7 @@ void DelWhiteListInfosCallbackTest::TestDelWhiteListInfosCallbackStub::OnResult(
HWTEST_F(DelWhiteListInfosCallbackTest, DelWhiteListInfosCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDelWhiteListInfosCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDelWhiteListInfosCallbackStub());
DelWhiteListInfosCallbackProxy callBackProxy(callBackStubPtr);
std::string deviceId = "deviceId0";
callBackProxy.OnResult(deviceId);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -351,7 +351,7 @@ int32_t DInputSourceCallBackTest::TestDInputSimulationEventCallBack::OnSimulatio
HWTEST_F(DInputSourceCallBackTest, SendRequest01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
IDInputSourceInterfaceCode code = IDInputSourceInterfaceCode::INIT;
MessageParcel data;
@@ -362,7 +362,7 @@ HWTEST_F(DInputSourceCallBackTest, SendRequest01, testing::ext::TestSize.Level1)
HWTEST_F(DInputSourceCallBackTest, Init01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
int32_t ret = callBackProxy.Init();
EXPECT_EQ(DH_SUCCESS, ret);
@@ -370,7 +370,7 @@ HWTEST_F(DInputSourceCallBackTest, Init01, testing::ext::TestSize.Level1)
HWTEST_F(DInputSourceCallBackTest, Release01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
int32_t ret = callBackProxy.Release();
EXPECT_EQ(DH_SUCCESS, ret);
@@ -378,204 +378,204 @@ HWTEST_F(DInputSourceCallBackTest, Release01, testing::ext::TestSize.Level1)
HWTEST_F(DInputSourceCallBackTest, RegisterDistributedHardware01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string devId = "d6f4s6d4f6";
const std::string dhId = "Input_sd4f4s5d4f5s4";
const std::string parameters = "d4a6s5d46asd";
sptr<IRegisterDInputCallback> callback = new TestDInputRegisterCallBack();
sptr<IRegisterDInputCallback> callback(new TestDInputRegisterCallBack());
int32_t ret = callBackProxy.RegisterDistributedHardware(devId, dhId, parameters, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, UnregisterDistributedHardware01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string devId = "d6f4s6d4f6";
const std::string dhId = "Input_sd4f4s5d4f5s4";
sptr<TestDInputUnregisterCallBack> callback = new TestDInputUnregisterCallBack();
sptr<TestDInputUnregisterCallBack> callback(new TestDInputUnregisterCallBack());
int32_t ret = callBackProxy.UnregisterDistributedHardware(devId, dhId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, PrepareRemoteInput01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string devId = "d6f4s6d4f6";
sptr<TestDInputPrepareCallBack> callback = new TestDInputPrepareCallBack();
sptr<TestDInputPrepareCallBack> callback(new TestDInputPrepareCallBack());
int32_t ret = callBackProxy.PrepareRemoteInput(devId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, PrepareRemoteInput02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string srcId = "d6f4s6d4f6";
const std::string sinkId = "5sd45s4d5s4d5";
sptr<TestDInputPrepareCallBack> callback = new TestDInputPrepareCallBack();
sptr<TestDInputPrepareCallBack> callback(new TestDInputPrepareCallBack());
int32_t ret = callBackProxy.PrepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, UnprepareRemoteInput01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string devId = "d6f4s6d4f6";
sptr<TestDInputUnprepareCallBack> callback = new TestDInputUnprepareCallBack();
sptr<TestDInputUnprepareCallBack> callback(new TestDInputUnprepareCallBack());
int32_t ret = callBackProxy.UnprepareRemoteInput(devId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, UnprepareRemoteInput02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string srcId = "d6f4s6d4f6";
const std::string sinkId = "5sd45s4d5s4d5";
sptr<TestDInputUnprepareCallBack> callback = new TestDInputUnprepareCallBack();
sptr<TestDInputUnprepareCallBack> callback(new TestDInputUnprepareCallBack());
int32_t ret = callBackProxy.UnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StartRemoteInput01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string devId = "d6f4s6d4f6";
uint32_t inputTypes = 1;
sptr<TestDInputStartCallBack> callback = new TestDInputStartCallBack();
sptr<TestDInputStartCallBack> callback(new TestDInputStartCallBack());
int32_t ret = callBackProxy.StartRemoteInput(devId, inputTypes, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StartRemoteInput02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string srcId = "d6f4s6d4f6";
const std::string sinkId = "5sd45s4d5s4d5";
uint32_t inputTypes = 1;
sptr<TestDInputStartCallBack> callback = new TestDInputStartCallBack();
sptr<TestDInputStartCallBack> callback(new TestDInputStartCallBack());
int32_t ret = callBackProxy.StartRemoteInput(srcId, sinkId, inputTypes, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StartRemoteInput03, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string sinkId = "d6f4s6d4f6";
std::vector<std::string> dhIds;
dhIds.push_back("Input_6ds54f6sd4f65sd4fsdf4s");
sptr<TestVectorStartStopCallBackStub> callback = new TestVectorStartStopCallBackStub();
sptr<TestVectorStartStopCallBackStub> callback(new TestVectorStartStopCallBackStub());
int32_t ret = callBackProxy.StartRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StartRemoteInput04, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string srcId = "d6f4s6d4f6";
const std::string sinkId = "5sd45s4d5s4d5";
std::vector<std::string> dhIds;
dhIds.push_back("Input_6ds54f6sd4f65sd4fsdf4s");
sptr<TestVectorStartStopCallBackStub> callback = new TestVectorStartStopCallBackStub();
sptr<TestVectorStartStopCallBackStub> callback(new TestVectorStartStopCallBackStub());
int32_t ret = callBackProxy.StartRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StopRemoteInput01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string devId = "d6f4s6d4f6";
uint32_t inputTypes = 1;
sptr<TestDInputStopCallBack> callback = new TestDInputStopCallBack();
sptr<TestDInputStopCallBack> callback(new TestDInputStopCallBack());
int32_t ret = callBackProxy.StopRemoteInput(devId, inputTypes, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StopRemoteInput02, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string srcId = "d6f4s6d4f6";
const std::string sinkId = "5sd45s4d5s4d5";
uint32_t inputTypes = 1;
sptr<TestDInputStopCallBack> callback = new TestDInputStopCallBack();
sptr<TestDInputStopCallBack> callback(new TestDInputStopCallBack());
int32_t ret = callBackProxy.StopRemoteInput(srcId, sinkId, inputTypes, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StopRemoteInput03, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string sinkId = "d6f4s6d4f6";
std::vector<std::string> dhIds;
dhIds.push_back("Input_6ds54f6sd4f65sd4fsdf4s");
sptr<TestVectorStartStopCallBackStub> callback = new TestVectorStartStopCallBackStub();
sptr<TestVectorStartStopCallBackStub> callback(new TestVectorStartStopCallBackStub());
int32_t ret = callBackProxy.StopRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, StopRemoteInput04, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string srcId = "d6f4s6d4f6";
const std::string sinkId = "5sd45s4d5s4d5";
std::vector<std::string> dhIds;
dhIds.push_back("Input_6ds54f6sd4f65sd4fsdf4s");
sptr<TestVectorStartStopCallBackStub> callback = new TestVectorStartStopCallBackStub();
sptr<TestVectorStartStopCallBackStub> callback(new TestVectorStartStopCallBackStub());
int32_t ret = callBackProxy.StopRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, RegisterAddWhiteListCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
sptr<TestAddWhiteListInfosCallBack> callback = new TestAddWhiteListInfosCallBack();
sptr<TestAddWhiteListInfosCallBack> callback(new TestAddWhiteListInfosCallBack());
int32_t ret = callBackProxy.RegisterAddWhiteListCallback(callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, RegisterDelWhiteListCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
sptr<TestDelWhiteListInfosCallBack> callback = new TestDelWhiteListInfosCallBack();
sptr<TestDelWhiteListInfosCallBack> callback(new TestDelWhiteListInfosCallBack());
int32_t ret = callBackProxy.RegisterDelWhiteListCallback(callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, RegisterInputNodeListener01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
sptr<TestDInputNodeListenerCallBack> listener = new TestDInputNodeListenerCallBack();
sptr<TestDInputNodeListenerCallBack> listener(new TestDInputNodeListenerCallBack());
int32_t ret = callBackProxy.RegisterInputNodeListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, UnregisterInputNodeListener01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
sptr<TestDInputNodeListenerCallBack> listener = new TestDInputNodeListenerCallBack();
sptr<TestDInputNodeListenerCallBack> listener(new TestDInputNodeListenerCallBack());
int32_t ret = callBackProxy.UnregisterInputNodeListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, SyncNodeInfoRemoteInput01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
const std::string userDevId = "a4sd654q8w7e9qwe";
const std::string dhid = "Input_sd65f46df46s54f";
@@ -586,18 +586,18 @@ HWTEST_F(DInputSourceCallBackTest, SyncNodeInfoRemoteInput01, testing::ext::Test
HWTEST_F(DInputSourceCallBackTest, RegisterSimulationEventListener01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
sptr<TestDInputSimulationEventCallBack> listener = new TestDInputSimulationEventCallBack();
sptr<TestDInputSimulationEventCallBack> listener(new TestDInputSimulationEventCallBack());
int32_t ret = callBackProxy.RegisterSimulationEventListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputSourceCallBackTest, UnregisterSimulationEventListener01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestDInputSourceCallBackStub();
sptr<IRemoteObject> callBackStubPtr(new TestDInputSourceCallBackStub());
DistributedInputSourceProxy callBackProxy(callBackStubPtr);
sptr<TestDInputSimulationEventCallBack> listener = new TestDInputSimulationEventCallBack();
sptr<TestDInputSimulationEventCallBack> listener(new TestDInputSimulationEventCallBack());
int32_t ret = callBackProxy.UnregisterSimulationEventListener(listener);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -222,7 +222,7 @@ HWTEST_F(DistributedInputIpcTest, RegisterInputNodeListener01, testing::ext::Tes
HWTEST_F(DistributedInputIpcTest, RegisterInputNodeListener02, testing::ext::TestSize.Level1)
{
sptr<TestInputNodeListener> listener = new TestInputNodeListener();
sptr<TestInputNodeListener> listener(new TestInputNodeListener());
int32_t ret = DistributedInputClient::GetInstance().RegisterInputNodeListener(listener);
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
@@ -236,7 +236,7 @@ HWTEST_F(DistributedInputIpcTest, UnregisterInputNodeListener01, testing::ext::T
HWTEST_F(DistributedInputIpcTest, UnregisterInputNodeListener02, testing::ext::TestSize.Level1)
{
sptr<TestInputNodeListener> listener = new TestInputNodeListener();
sptr<TestInputNodeListener> listener(new TestInputNodeListener());
int32_t ret = DistributedInputClient::GetInstance().UnregisterInputNodeListener(listener);
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
@@ -250,7 +250,7 @@ HWTEST_F(DistributedInputIpcTest, RegisterSimulationEventListener01, testing::ex
HWTEST_F(DistributedInputIpcTest, RegisterSimulationEventListener02, testing::ext::TestSize.Level1)
{
sptr<TestSimulationEventListenerStub> listener = new TestSimulationEventListenerStub();
sptr<TestSimulationEventListenerStub> listener(new TestSimulationEventListenerStub());
int32_t ret = DistributedInputClient::GetInstance().RegisterSimulationEventListener(listener);
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
@@ -264,7 +264,7 @@ HWTEST_F(DistributedInputIpcTest, UnregisterSimulationEventListener01, testing::
HWTEST_F(DistributedInputIpcTest, UnregisterSimulationEventListener02, testing::ext::TestSize.Level1)
{
sptr<TestSimulationEventListenerStub> listener = new TestSimulationEventListenerStub();
sptr<TestSimulationEventListenerStub> listener(new TestSimulationEventListenerStub());
int32_t ret = DistributedInputClient::GetInstance().UnregisterSimulationEventListener(listener);
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -43,7 +43,7 @@ void UnprepareDInputCallbackTest::TestUnprepareDInputCallbackStub::OnResult(cons
HWTEST_F(UnprepareDInputCallbackTest, UnprepareDInputCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestUnprepareDInputCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestUnprepareDInputCallbackStub());
UnprepareDInputCallbackProxy callBackProxy(callBackStubPtr);
std::string deviceId = "deviceId0";
int32_t status = 0;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -44,7 +44,7 @@ void UnregisterDInputCallbackTest::TestUnregisterDInputCallbackStub::OnResult(co
HWTEST_F(UnregisterDInputCallbackTest, UnregisterDInputCallback01, testing::ext::TestSize.Level1)
{
sptr<IRemoteObject> callBackStubPtr = new TestUnregisterDInputCallbackStub();
sptr<IRemoteObject> callBackStubPtr(new TestUnregisterDInputCallbackStub());
UnregisterDInputCallbackProxy callBackProxy(callBackStubPtr);
std::string deviceId = "deviceId0";
std::string dhId = "dhId0";
@@ -833,8 +833,8 @@ void DistributedInputSinkManager::ProjectWindowListener::OnMessage(const DHTopic
}
sptr<IRemoteObject> dScreenSinkSA = DInputContext::GetInstance().GetRemoteObject(
DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID);
sptr<DScreenSinkSvrRecipient> dScreenSinkDeathRecipient = new(std::nothrow) DScreenSinkSvrRecipient(srcDeviceId,
srcWinId);
sptr<DScreenSinkSvrRecipient> dScreenSinkDeathRecipient(new(std::nothrow) DScreenSinkSvrRecipient(srcDeviceId,
srcWinId));
dScreenSinkSA->AddDeathRecipient(dScreenSinkDeathRecipient);
DInputContext::GetInstance().AddRemoteObject(DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID, dScreenSinkSA);
}
@@ -174,7 +174,7 @@ HWTEST_F(DistributedInputSinkManagerTest, GetSinkScreenInfosCbackSize01, testing
HWTEST_F(DistributedInputSinkManagerTest, RegisterGetSinkScreenInfosCallback_01, testing::ext::TestSize.Level1)
{
sptr<TestGetSinkScreenInfosCb> callback = new TestGetSinkScreenInfosCb();
sptr<TestGetSinkScreenInfosCb> callback(new TestGetSinkScreenInfosCb());
int32_t ret = sinkManager_->RegisterGetSinkScreenInfosCallback(callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -2648,8 +2648,8 @@ void DistributedInputSourceManager::StartDScreenListener::OnMessage(const DHTopi
sptr<IRemoteObject> dScreenSrcSA =
DInputContext::GetInstance().GetRemoteObject(DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID);
sptr<DScreenSourceSvrRecipient> dScreenSrcDeathRecipient = new(std::nothrow) DScreenSourceSvrRecipient(srcDevId,
sinkDevId, srcScreenInfo.sourceWinId);
sptr<DScreenSourceSvrRecipient> dScreenSrcDeathRecipient(new(std::nothrow) DScreenSourceSvrRecipient(srcDevId,
sinkDevId, srcScreenInfo.sourceWinId));
dScreenSrcSA->AddDeathRecipient(dScreenSrcDeathRecipient);
DInputContext::GetInstance().AddRemoteObject(DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID, dScreenSrcSA);
}
@@ -287,7 +287,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RegisterDistributedHardware_01, test
std::string devId = "";
std::string dhId = "1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
std::string parameters = "";
sptr<TestRegisterDInputCb> callback = new TestRegisterDInputCb();
sptr<TestRegisterDInputCb> callback(new TestRegisterDInputCb());
int32_t ret = sourceManager_->RegisterDistributedHardware(devId, dhId, parameters, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_REGISTER_FAIL, ret);
}
@@ -309,7 +309,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RegisterDistributedHardware_02, test
std::string dhId = pBuffer.descriptor;
std::string parameters;
StructTransJson(pBuffer, parameters);
sptr<TestRegisterDInputCb> callback = new TestRegisterDInputCb();
sptr<TestRegisterDInputCb> callback(new TestRegisterDInputCb());
DistributedInputSourceManager::InputDeviceId inputDeviceId {devId, dhId, GetNodeDesc(parameters)};
sourceManager_->inputDevice_.push_back(inputDeviceId);
int32_t ret = sourceManager_->RegisterDistributedHardware(devId, dhId, parameters, callback);
@@ -344,7 +344,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnregCallbackNotify_01, testing::ext
int32_t ret = sourceManager_->UnregCallbackNotify(devId, dhId);
EXPECT_EQ(DH_SUCCESS, ret);
sptr<TestUnregisterDInputCb> callback = new TestUnregisterDInputCb();
sptr<TestUnregisterDInputCb> callback(new TestUnregisterDInputCb());
DistributedInputSourceManager::DInputClientUnregistInfo info {devId, dhId, callback};
sourceManager_->unregCallbacks_.push_back(info);
devId = "devId_20221221_test";
@@ -385,7 +385,7 @@ HWTEST_F(DistributedInputSourceManagerTest, CheckDeviceIsExists_01, testing::ext
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
std::string dhId = "1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
sptr<TestUnregisterDInputCb> callback = new TestUnregisterDInputCb();
sptr<TestUnregisterDInputCb> callback(new TestUnregisterDInputCb());
DistributedInputSourceManager::InputDeviceId inputDeviceId {devId, dhId};
sourceManager_->inputDevice_.push_back(inputDeviceId);
auto it = sourceManager_->inputDevice_.begin();
@@ -397,7 +397,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnregisterDistributedHardware_01, te
{
std::string devId = "";
std::string dhId = "1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
sptr<TestUnregisterDInputCb> callback = new TestUnregisterDInputCb();
sptr<TestUnregisterDInputCb> callback(new TestUnregisterDInputCb());
int32_t ret = sourceManager_->UnregisterDistributedHardware(devId, dhId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNREGISTER_FAIL, ret);
}
@@ -406,7 +406,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnregisterDistributedHardware_02, te
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
std::string dhId = "1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
sptr<TestUnregisterDInputCb> callback = new TestUnregisterDInputCb();
sptr<TestUnregisterDInputCb> callback(new TestUnregisterDInputCb());
int32_t ret = sourceManager_->UnregisterDistributedHardware(devId, dhId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNREGISTER_FAIL, ret);
}
@@ -420,7 +420,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnregisterDistributedHardware_02, te
HWTEST_F(DistributedInputSourceManagerTest, PrepareRemoteInput_01, testing::ext::TestSize.Level1)
{
std::string devId = "";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t ret = sourceManager_->PrepareRemoteInput(devId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_PREPARE_FAIL, ret);
}
@@ -428,7 +428,7 @@ HWTEST_F(DistributedInputSourceManagerTest, PrepareRemoteInput_01, testing::ext:
HWTEST_F(DistributedInputSourceManagerTest, PrepareRemoteInput_02, testing::ext::TestSize.Level1)
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
DistributedInputSourceManager::DInputClientPrepareInfo info {devId, callback};
sourceManager_->preCallbacks_.push_back(info);
int32_t ret = sourceManager_->PrepareRemoteInput(devId, callback);
@@ -439,7 +439,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_01, testing::ex
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t sessionId = 1;
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[devId] = sessionId;
int32_t ret = sourceManager_->UnprepareRemoteInput(devId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -448,7 +448,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_01, testing::ex
HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_02, testing::ext::TestSize.Level1)
{
std::string devId = "";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = sourceManager_->UnprepareRemoteInput(devId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
devId = "umkyu1b165e1be98151891erbe8r91ev";
@@ -461,7 +461,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_02, testing::ex
HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_03, testing::ext::TestSize.Level1)
{
std::string devId = "devId_4810input4809_test";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = sourceManager_->UnprepareRemoteInput(devId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
}
@@ -475,7 +475,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_03, testing::ex
HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_01, testing::ext::TestSize.Level1)
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = sourceManager_->StartRemoteInput(devId, INPUTTYPE, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -486,7 +486,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_01, testing::ext::T
HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_02, testing::ext::TestSize.Level1)
{
std::string devId = "";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = sourceManager_->StartRemoteInput(devId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
devId = "umkyu1b165e1be98151891erbe8r91ev";
@@ -502,7 +502,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_02, testing::ext::T
HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_03, testing::ext::TestSize.Level1)
{
std::string devId = "devId_4810input4809_test";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = sourceManager_->StartRemoteInput(devId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
@@ -516,7 +516,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_03, testing::ext::T
HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_01, testing::ext::TestSize.Level1)
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret = sourceManager_->StopRemoteInput(devId, INPUTTYPE, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -527,7 +527,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_01, testing::ext::Te
HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_02, testing::ext::TestSize.Level1)
{
std::string devId = "";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret = sourceManager_->StopRemoteInput(devId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
devId = "umkyu1b165e1be98151891erbe8r91ev";
@@ -539,7 +539,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_02, testing::ext::Te
HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_03, testing::ext::TestSize.Level1)
{
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
std::string devId = "devId_4810input4809_test";
int32_t ret = sourceManager_->StopRemoteInput(devId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -555,7 +555,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_04, testing::ext::T
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = sourceManager_->StartRemoteInput(srcId, sinkId, INPUTTYPE, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -567,7 +567,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_05, testing::ext::T
{
std::string srcId = "";
std::string sinkId = "";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t ret = sourceManager_->StartRemoteInput(srcId, sinkId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
srcId = "srcId_4810input4809_test";
@@ -585,7 +585,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_05, testing::ext::T
HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_06, testing::ext::TestSize.Level1)
{
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "devId_4810input4809_test";
int32_t ret = sourceManager_->StartRemoteInput(srcId, sinkId, INPUTTYPE, callback);
@@ -602,7 +602,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_04, testing::ext::Te
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret = sourceManager_->StopRemoteInput(srcId, sinkId, INPUTTYPE, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -614,7 +614,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_05, testing::ext::Te
{
std::string srcId = "";
std::string sinkId = "";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t ret = sourceManager_->StopRemoteInput(srcId, sinkId,
INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -633,7 +633,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_05, testing::ext::Te
HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_06, testing::ext::TestSize.Level1)
{
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "devId_4810input4809_test";
int32_t ret = sourceManager_->StopRemoteInput(srcId, sinkId, INPUTTYPE, callback);
@@ -644,7 +644,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStartRemoteInputByType_01, test
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
int32_t sessionId = 1;
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[srcId] = sessionId;
@@ -663,7 +663,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStartRemoteInputByType_02, test
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->RelayStartRemoteInputByType(srcId, sinkId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
@@ -673,7 +673,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStopRemoteInputByType_01, testi
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
int32_t sessionId = 1;
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[srcId] = sessionId;
@@ -692,7 +692,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStopRemoteInputByType_02, testi
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->RelayStopRemoteInputByType(srcId, sinkId, INPUTTYPE, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -708,7 +708,7 @@ HWTEST_F(DistributedInputSourceManagerTest, PrepareRemoteInput_03, testing::ext:
{
std::string srcId = "";
std::string sinkId = "";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t ret = sourceManager_->PrepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_PREPARE_FAIL, ret);
srcId = "srcId_4810input4809_test";
@@ -736,7 +736,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_04, testing::ex
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t sessionId = 1;
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[sinkId] = sessionId;
int32_t ret = sourceManager_->UnprepareRemoteInput(srcId, sinkId, callback);
@@ -747,7 +747,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_05, testing::ex
{
std::string srcId = "";
std::string sinkId = "";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = sourceManager_->UnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
srcId = "srcId_4810input4809_test";
@@ -767,7 +767,7 @@ HWTEST_F(DistributedInputSourceManagerTest, UnprepareRemoteInput_06, testing::ex
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "sinkId_48104809_test";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = sourceManager_->UnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
}
@@ -782,7 +782,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_07, testing::ext::T
{
std::vector<std::string> dhIds;
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
dhIds.push_back("Input_slkdiek3kddkeojfe");
int32_t ret = sourceManager_->StartRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -805,7 +805,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_08, testing::ext::T
std::string sinkId = "";
std::vector<std::string> dhIds;
dhIds.push_back("Input_slkdiek3kddkeojfe");
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
int32_t ret = sourceManager_->StartRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
@@ -822,7 +822,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_09, testing::ext::T
dhIds.push_back("Input_slkdiek3kddkeojfe");
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
sourceManager_->staStringCallbacks_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->StartRemoteInput(sinkId, dhIds, callback);
@@ -838,7 +838,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_09, testing::ext::T
HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_07, testing::ext::TestSize.Level1)
{
std::vector<std::string> dhIds;
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
dhIds.push_back("Input_slkdiek3kddkeojfe");
int32_t sessionId = 1;
@@ -863,7 +863,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_08, testing::ext::Te
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "";
std::vector<std::string> dhIds;
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
int32_t ret = sourceManager_->StopRemoteInput(sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
sinkId = "umkyu1b165e1be98151891erbe8r91ev";
@@ -879,7 +879,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_09, testing::ext::Te
dhIds.push_back("Input_slkdiek3kddkeojfe");
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
sourceManager_->stpStringCallbacks_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->StopRemoteInput(sinkId, dhIds, callback);
@@ -895,7 +895,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_09, testing::ext::Te
HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_10, testing::ext::TestSize.Level1)
{
std::vector<std::string> dhIds;
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
dhIds.push_back("Input_slkdiek3kddkeojfe");
@@ -922,7 +922,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_11, testing::ext::T
std::string srcId = "";
std::string sinkId = "";
std::vector<std::string> dhIds;
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
int32_t ret = sourceManager_->StartRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
@@ -947,7 +947,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_12, testing::ext::T
dhIds.push_back("Input_slkdiek3kddkeojfe");
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
sourceManager_->staStringCallbacks_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->StartRemoteInput(srcId, sinkId, dhIds, callback);
@@ -963,7 +963,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StartRemoteInput_12, testing::ext::T
HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_10, testing::ext::TestSize.Level1)
{
std::vector<std::string> dhIds;
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
dhIds.push_back("Input_slkdiek3kddkeojfe");
@@ -990,7 +990,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_11, testing::ext::Te
std::string srcId = "";
std::string sinkId = "";
std::vector<std::string> dhIds;
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
int32_t ret = sourceManager_->StopRemoteInput(srcId, sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -1015,7 +1015,7 @@ HWTEST_F(DistributedInputSourceManagerTest, StopRemoteInput_12, testing::ext::Te
dhIds.push_back("Input_slkdiek3kddkeojfe");
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestStartStopVectorCallbackStub> callback = new TestStartStopVectorCallbackStub();
sptr<TestStartStopVectorCallbackStub> callback(new TestStartStopVectorCallbackStub());
sourceManager_->stpStringCallbacks_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->StopRemoteInput(srcId, sinkId, dhIds, callback);
@@ -1054,7 +1054,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RegisterAddWhiteListCallback01, test
HWTEST_F(DistributedInputSourceManagerTest, RegisterAddWhiteListCallback02, testing::ext::TestSize.Level0)
{
sptr<TestAddWhiteListInfosCb> callback = new TestAddWhiteListInfosCb();
sptr<TestAddWhiteListInfosCb> callback(new TestAddWhiteListInfosCb());
int32_t ret = sourceManager_->RegisterAddWhiteListCallback(callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -1068,7 +1068,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RegisterDelWhiteListCallback01, test
HWTEST_F(DistributedInputSourceManagerTest, RegisterDelWhiteListCallback02, testing::ext::TestSize.Level0)
{
sptr<TestDelWhiteListInfosCb> callback = new TestDelWhiteListInfosCb();
sptr<TestDelWhiteListInfosCb> callback(new TestDelWhiteListInfosCb());
int32_t ret = sourceManager_->RegisterDelWhiteListCallback(callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
@@ -1095,7 +1095,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RegisterSimulationEventListener_01,
HWTEST_F(DistributedInputSourceManagerTest, UnregisterSimulationEventListener_02, testing::ext::TestSize.Level1)
{
sptr<TestSimulationEventCb> callback = new TestSimulationEventCb();
sptr<TestSimulationEventCb> callback(new TestSimulationEventCb());
int32_t ret = sourceManager_->RegisterSimulationEventListener(callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -1107,7 +1107,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayPrepareRemoteInput_01, testing:
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
int32_t sessionId = 1;
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[srcId] = sessionId;
@@ -1123,7 +1123,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayUnprepareRemoteInput_01, testin
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
int32_t ret = sourceManager_->RelayUnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(DH_SUCCESS, ret);
@@ -1136,7 +1136,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayUnprepareRemoteInput_02, testin
{
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->RelayUnprepareRemoteInput(srcId, sinkId, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
@@ -1148,7 +1148,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStartRemoteInputByDhid_01, test
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
std::vector<std::string> dhIds;
dhIds.push_back("input_slkdiek3kddkeojfe");
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
int32_t sessionId = 1;
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[srcId] = sessionId;
int32_t ret = sourceManager_->RelayStartRemoteInputByDhid(srcId, sinkId, dhIds, callback);
@@ -1174,7 +1174,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStartRemoteInputByDhid_02, test
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
std::vector<std::string> dhIds;
dhIds.push_back("input_slkdiek3kddkeojfe");
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->RelayStartRemoteInputByDhid(srcId, sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
@@ -1186,7 +1186,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStopRemoteInputByDhid_01, testi
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
std::vector<std::string> dhIds;
dhIds.push_back("input_slkdiek3kddkeojfe");
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
int32_t sessionId = 1;
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[srcId] = sessionId;
int32_t ret = sourceManager_->RelayStopRemoteInputByDhid(srcId, sinkId, dhIds, callback);
@@ -1212,7 +1212,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RelayStopRemoteInputByDhid_02, testi
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
std::vector<std::string> dhIds;
dhIds.push_back("input_slkdiek3kddkeojfe");
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
int32_t ret = sourceManager_->RelayStopRemoteInputByDhid(srcId, sinkId, dhIds, callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
@@ -1223,7 +1223,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRegisterCallback_01, testing::ext
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
std::string dhId = "input_slkdiek3kddkeojfe";
int32_t status = 0;
sptr<TestRegisterDInputCb> callback = new TestRegisterDInputCb();
sptr<TestRegisterDInputCb> callback(new TestRegisterDInputCb());
DistributedInputSourceManager::DInputClientRegistInfo info {devId, dhId, callback};
sourceManager_->regCallbacks_.push_back(info);
sourceManager_->RunRegisterCallback(devId, dhId, status);
@@ -1249,7 +1249,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunUnregisterCallback_01, testing::e
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
std::string dhId = "input_slkdiek3kddkeojfe";
int32_t status = 0;
sptr<TestUnregisterDInputCb> callback = new TestUnregisterDInputCb();
sptr<TestUnregisterDInputCb> callback(new TestUnregisterDInputCb());
DistributedInputSourceManager::DInputClientUnregistInfo info {devId, dhId, callback};
sourceManager_->unregCallbacks_.push_back(info);
sourceManager_->RunUnregisterCallback(devId, dhId, status);
@@ -1275,7 +1275,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunPrepareCallback_01, testing::ext:
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
std::string object = "runprepareobject";
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
DistributedInputSourceManager::DInputClientPrepareInfo info {devId, callback};
sourceManager_->preCallbacks_.push_back(info);
sourceManager_->RunPrepareCallback(devId, status, object);
@@ -1292,7 +1292,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunWhiteListCallback_01, testing::ex
{
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
std::string object = "runwhitelistobject";
sptr<TestAddWhiteListInfosCb> callback = new TestAddWhiteListInfosCb();
sptr<TestAddWhiteListInfosCb> callback(new TestAddWhiteListInfosCb());
sourceManager_->addWhiteListCallbacks_.insert(callback);
sourceManager_->RunWhiteListCallback(devId, object);
EXPECT_EQ(1, sourceManager_->addWhiteListCallbacks_.size());
@@ -1303,7 +1303,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRelayPrepareCallback_01, testing:
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
sptr<TestPrepareDInputCallback> callback = new TestPrepareDInputCallback();
sptr<TestPrepareDInputCallback> callback(new TestPrepareDInputCallback());
DistributedInputSourceManager::DInputClientRelayPrepareInfo info {srcId, sinkId, callback};
sourceManager_->relayPreCallbacks_.push_back(info);
sourceManager_->RunRelayPrepareCallback(srcId, sinkId, status);
@@ -1330,7 +1330,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRelayUnprepareCallback_01, testin
std::string srcId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
DistributedInputSourceManager::DInputClientRelayUnprepareInfo info {srcId, sinkId, callback};
sourceManager_->relayUnpreCallbacks_.push_back(info);
sourceManager_->RunRelayUnprepareCallback(srcId, sinkId, status);
@@ -1356,7 +1356,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunUnprepareCallback_01, testing::ex
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
std::string object = "runprepareobject";
sptr<TestUnprepareDInputCallback> callback = new TestUnprepareDInputCallback();
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
DistributedInputSourceManager::DInputClientUnprepareInfo info {devId, callback};
sourceManager_->unpreCallbacks_.push_back(info);
sourceManager_->RunUnprepareCallback(devId, status);
@@ -1375,7 +1375,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunStartCallback_01, testing::ext::T
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
uint32_t inputTypes = 1;
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
DistributedInputSourceManager::DInputClientStartInfo info {devId, inputTypes, callback};
sourceManager_->staCallbacks_.push_back(info);
sourceManager_->RunStartCallback(devId, inputTypes, status);
@@ -1401,7 +1401,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunStopCallback_01, testing::ext::Te
std::string devId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
uint32_t inputTypes = 1;
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
DistributedInputSourceManager::DInputClientStopInfo info {devId, inputTypes, callback};
sourceManager_->stpCallbacks_.push_back(info);
sourceManager_->RunStopCallback(devId, inputTypes, status);
@@ -1430,7 +1430,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunStartDhidCallback_01, testing::ex
std::string localNetworkId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::vector<std::string> dhIds;
dhIds.push_back("input_slkdiek3kddkeojfe");
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
DistributedInputSourceManager::DInputClientStartDhidInfo info {localNetworkId, sinkId, dhIds, callback};
sourceManager_->staStringCallbacks_.push_back(info);
sourceManager_->RunStartDhidCallback(sinkId, dhId, status);
@@ -1456,7 +1456,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunStopDhidCallback_01, testing::ext
std::string localNetworkId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::vector<std::string> dhIds;
dhIds.push_back(dhId);
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
DistributedInputSourceManager::DInputClientStopDhidInfo info {localNetworkId, sinkId, dhIds, callback};
sourceManager_->stpStringCallbacks_.push_back(info);
sourceManager_->RunStopDhidCallback(sinkId, dhId, status);
@@ -1482,7 +1482,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRelayStartDhidCallback_01, testin
std::string dhId = "input_slkdiek3kddkeojfe";
std::vector<std::string> dhIds;
dhIds.push_back(dhId);
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
DistributedInputSourceManager::DInputClientStartDhidInfo info{srcId, sinkId, dhIds, callback};
sourceManager_->relayStaDhidCallbacks_.push_back(info);
sourceManager_->RunRelayStartDhidCallback(srcId, sinkId, status, dhId);
@@ -1512,7 +1512,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRelayStopDhidCallback_01, testing
std::string dhId = "input_slkdiek3kddkeojfe";
std::vector<std::string> dhIds;
dhIds.push_back(dhId);
sptr<TestStartStopDInputsCb> callback = new TestStartStopDInputsCb();
sptr<TestStartStopDInputsCb> callback(new TestStartStopDInputsCb());
DistributedInputSourceManager::DInputClientStopDhidInfo info{srcId, sinkId, dhIds, callback};
sourceManager_->relayStpDhidCallbacks_.push_back(info);
sourceManager_->RunRelayStopDhidCallback(srcId, sinkId, status, dhId);
@@ -1540,7 +1540,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRelayStartTypeCallback_01, testin
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
uint32_t inputTypes = 1;
sptr<TestStartDInputCallback> callback = new TestStartDInputCallback();
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
DistributedInputSourceManager::DInputClientStartTypeInfo info(srcId, sinkId, inputTypes, callback);
sourceManager_->relayStaTypeCallbacks_.push_back(info);
sourceManager_->RunRelayStartTypeCallback(srcId, sinkId, status, inputTypes);
@@ -1567,7 +1567,7 @@ HWTEST_F(DistributedInputSourceManagerTest, RunRelayStopTypeCallback_01, testing
std::string sinkId = "umkyu1b165e1be98151891erbe8r91ev";
int32_t status = 0;
uint32_t inputTypes = 1;
sptr<TestStopDInputCallback> callback = new TestStopDInputCallback();
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
DistributedInputSourceManager::DInputClientStopTypeInfo info(srcId, sinkId, inputTypes, callback);
sourceManager_->relayStpTypeCallbacks_.push_back(info);
sourceManager_->RunRelayStopTypeCallback(srcId, sinkId, status, inputTypes);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -41,7 +41,7 @@ int32_t DistributedInputSinkHandler::InitSink(const std::string &params)
DHLOGE("Failed to get system ability mgr.");
return ERR_DH_INPUT_SINK_HANDLER_INIT_SINK_SA_FAIL;
}
sptr<LoadDInputSinkCallback> loadCallback = new LoadDInputSinkCallback(params);
sptr<LoadDInputSinkCallback> loadCallback(new LoadDInputSinkCallback(params));
HisyseventUtil::GetInstance().SysEventWriteBehavior(DINPUT_INIT,
"dinput sink LoadSystemAbility call");
int32_t ret = samgr->LoadSystemAbility(DISTRIBUTED_HARDWARE_INPUT_SINK_SA_ID, loadCallback);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -40,7 +40,7 @@ int32_t DistributedInputSourceHandler::InitSource(const std::string &params)
DHLOGE("Failed to get system ability mgr.");
return ERR_DH_INPUT_SINK_HANDLER_INIT_SOURCE_SA_FAIL;
}
sptr<LoadDInputSourceCallback> loadCallback = new LoadDInputSourceCallback(params);
sptr<LoadDInputSourceCallback> loadCallback(new LoadDInputSourceCallback(params));
HisyseventUtil::GetInstance().SysEventWriteBehavior(DINPUT_INIT,
"dinput init source sa start.");
int32_t ret = samgr->LoadSystemAbility(DISTRIBUTED_HARDWARE_INPUT_SOURCE_SA_ID, loadCallback);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -108,8 +108,8 @@ void PrepareInputFuzzTest(const uint8_t* data, size_t size)
std::string networkId(reinterpret_cast<const char*>(data), size);
OHOS::sptr<TestPrepareDInputCallback> prepareCb = new(std::nothrow) TestPrepareDInputCallback();
OHOS::sptr<TestUnprepareDInputCallback> unprepareCb = new(std::nothrow) TestUnprepareDInputCallback();
OHOS::sptr<TestPrepareDInputCallback> prepareCb(new(std::nothrow) TestPrepareDInputCallback());
OHOS::sptr<TestUnprepareDInputCallback> unprepareCb(new(std::nothrow) TestUnprepareDInputCallback());
DistributedInput::DistributedInputKit::PrepareRemoteInput(networkId, prepareCb);
DistributedInput::DistributedInputKit::UnprepareRemoteInput(networkId, unprepareCb);
}
@@ -124,11 +124,11 @@ void StartRemoteInputFuzzTest(const uint8_t* data, size_t size)
std::string sinkId = "456";
uint32_t inputTypes = *(reinterpret_cast<const uint32_t*>(data));
std::vector<std::string> dhIds= {};
OHOS::sptr<TestStartDInputCallback> startCb = new (std::nothrow) TestStartDInputCallback();
OHOS::sptr<TestStopDInputCallback> stopCb = new (std::nothrow) TestStopDInputCallback();
OHOS::sptr<TestStartDInputCallback> startCb(new (std::nothrow) TestStartDInputCallback());
OHOS::sptr<TestStopDInputCallback> stopCb(new (std::nothrow) TestStopDInputCallback());
DistributedInput::DistributedInputKit::StartRemoteInput(sinkId, inputTypes, startCb);
DistributedInput::DistributedInputKit::StartRemoteInput(srcId, sinkId, inputTypes, startCb);
OHOS::sptr<TestIStartStopDInputsCallback> callback = new (std::nothrow) TestIStartStopDInputsCallback();
OHOS::sptr<TestIStartStopDInputsCallback> callback(new (std::nothrow) TestIStartStopDInputsCallback());
DistributedInput::DistributedInputKit::StartRemoteInput(sinkId, dhIds, callback);
DistributedInput::DistributedInputKit::StartRemoteInput(srcId, sinkId, dhIds, callback);
}
@@ -160,11 +160,11 @@ void StopRemoteInputFuzzTest(const uint8_t* data, size_t size)
std::string sinkId = "456";
uint32_t inputTypes = *(reinterpret_cast<const uint32_t*>(data));
std::vector<std::string> dhIds = {};
OHOS::sptr<TestStartDInputCallback> startCb = new (std::nothrow) TestStartDInputCallback();
OHOS::sptr<TestStopDInputCallback> stopCb = new (std::nothrow) TestStopDInputCallback();
OHOS::sptr<TestStartDInputCallback> startCb(new (std::nothrow) TestStartDInputCallback());
OHOS::sptr<TestStopDInputCallback> stopCb(new (std::nothrow) TestStopDInputCallback());
DistributedInput::DistributedInputKit::StopRemoteInput(sinkId, inputTypes, stopCb);
DistributedInput::DistributedInputKit::StopRemoteInput(srcId, sinkId, inputTypes, stopCb);
OHOS::sptr<TestIStartStopDInputsCallback> callback = new (std::nothrow) TestIStartStopDInputsCallback();
OHOS::sptr<TestIStartStopDInputsCallback> callback(new (std::nothrow) TestIStartStopDInputsCallback());
DistributedInput::DistributedInputKit::StopRemoteInput(sinkId, dhIds, callback);
DistributedInput::DistributedInputKit::StopRemoteInput(srcId, sinkId, dhIds, callback);
}