mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-20 21:41:02 -04:00
@@ -65,7 +65,7 @@ ohos_unittest("distributed_input_sinkmanager_test") {
|
||||
"//base/security/access_token/interfaces/innerkits/token_setproc/include",
|
||||
"//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
|
||||
"${distributedinput_path}/services/sink/sinkmanager/test/sinkmanagerunittest/mock/",
|
||||
"${sevices_source_path}/inputinject/include",
|
||||
"${services_source_path}/inputinject/include",
|
||||
"//foundation/distributedhardware/distributed_input/inputdevicehandler/include",
|
||||
]
|
||||
|
||||
@@ -112,7 +112,6 @@ ohos_unittest("distributed_input_sinkmanager_test") {
|
||||
"${fwk_interfaces_path}:libdhfwk_sdk",
|
||||
"//foundation/window/window_manager/dm:libdm",
|
||||
"//foundation/distributedhardware/distributed_input/services/sink/transport:libdinput_sink_trans",
|
||||
"//foundation/distributedhardware/distributed_input/services/transportbase:libdinput_trans_base",
|
||||
"//base/security/access_token/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
|
||||
"//base/security/access_token/interfaces/innerkits/nativetoken:libnativetoken",
|
||||
"//base/security/access_token/interfaces/innerkits/token_setproc:libtoken_setproc",
|
||||
|
||||
+2
-2
@@ -442,14 +442,14 @@ HWTEST_F(DistributedInputSourceInjectTest, openDevicesNode_001, testing::ext::Te
|
||||
|
||||
HWTEST_F(DistributedInputSourceInjectTest, openDevicesNode_002, testing::ext::TestSize.Level1)
|
||||
{
|
||||
std::string devId(DEV_ID_LENGTH_MAX + 1. 'a');
|
||||
std::string devId(DEV_ID_LENGTH_MAX + 1, 'a');
|
||||
std::string dhId = "1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
|
||||
std::string parameters = "parameters_test";
|
||||
int32_t ret = DistributedInputInject::GetInstance().inputNodeManager_->openDevicesNode(devId, dhId, parameters);
|
||||
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_OPEN_DEVICE_NODE_FAIL, ret);
|
||||
|
||||
devId = "umkyu1b165e1be98151891erbe8r91ev";
|
||||
std::string dhIds(DEV_ID_LENGTH_MAX + 1. 'a');
|
||||
std::string dhIds(DH_ID_LENGTH_MAX + 1. 'a');
|
||||
ret = DistributedInputInject::GetInstance().inputNodeManager_->openDevicesNode(devId, dhIds, parameters);
|
||||
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_OPEN_DEVICE_NODE_FAIL, ret);
|
||||
|
||||
|
||||
+3
-5
@@ -245,8 +245,6 @@ HWTEST_F(DistributedInputSourceManagerTest, CheckRegisterParam_01, testing::ext:
|
||||
sourceManager_->deviceOfflineListener_ = nullptr;
|
||||
sourceManager_->UnregisterDHFwkPublisher();
|
||||
|
||||
|
||||
|
||||
std::string devId = "";
|
||||
std::string dhId = "";
|
||||
std::string parameters = "";
|
||||
@@ -2165,7 +2163,7 @@ HWTEST_F(DistributedInputSourceManagerTest, ParseMessage_02, testing::ext::TestS
|
||||
DistributedInputSourceManager::StartDScreenListener startListener;
|
||||
|
||||
startListener.OnMessage(DHTopic::TOPIC_STOP_DSCREEN, "message_test");
|
||||
std::string message = (SCREEN_MSG_MAX + 1, 'a');
|
||||
std::string message(SCREEN_MSG_MAX + 1, 'a');
|
||||
startListener.OnMessage(DHTopic::TOPIC_START_DSCREEN, message);
|
||||
std::string messages = "";
|
||||
startListener.OnMessage(DHTopic::TOPIC_START_DSCREEN, messages);
|
||||
@@ -2183,12 +2181,12 @@ HWTEST_F(DistributedInputSourceManagerTest, ParseMessage_02, testing::ext::TestS
|
||||
EXPECT_EQ(ERR_DH_INPUT_JSON_PARSE_FAIL, ret);
|
||||
|
||||
jsonObj[SOURCE_WINDOW_ID] = 100;
|
||||
jsonPbj[SOURCE_WINDOW_WIDTH] = "source_window_width_test";
|
||||
jsonObj[SOURCE_WINDOW_WIDTH] = "source_window_width_test";
|
||||
ret = startListener.ParseMessage(jsonObj.dump(), sinkDevId, srcScreenInfo);
|
||||
EXPECT_EQ(ERR_DH_INPUT_JSON_PARSE_FAIL, ret);
|
||||
|
||||
jsonObj[SOURCE_WINDOW_WIDTH] = 100;
|
||||
jsonPbj[SOURCE_WINDOW_HEIGHT] = "source_window_height_test";
|
||||
jsonObj[SOURCE_WINDOW_HEIGHT] = "source_window_height_test";
|
||||
ret = startListener.ParseMessage(jsonObj.dump(), sinkDevId, srcScreenInfo);
|
||||
EXPECT_EQ(ERR_DH_INPUT_JSON_PARSE_FAIL, ret);
|
||||
|
||||
|
||||
+6
-3
@@ -541,7 +541,9 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput04, te
|
||||
recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE] = "false";
|
||||
recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST] = false;
|
||||
DistributedInputSourceTransport::GetInstance().NotifyResponsePrepareRemoteInput(sessionId, recMsg);
|
||||
EXPECT_EQ(false, recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST].is_string());
|
||||
std::string message(MSG_MAX_SIZE + 1, 'a');
|
||||
int32_t ret = DistributedInputSourceTransport::GetInstance().SendMessage(sessionId, message);
|
||||
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
|
||||
}
|
||||
|
||||
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseUnprepareRemoteInput01, testing::ext::TestSize.Level0)
|
||||
@@ -774,6 +776,9 @@ HWTEST_F(DistributedInputSourceTransTest, ReceiveRelayUnprepareResult01, testing
|
||||
DistributedInputSourceTransport::GetInstance().ReceiveRelayUnprepareResult(sessionId, recMsg);
|
||||
recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID] = "sink_devid_test";
|
||||
DistributedInputSourceTransport::GetInstance().ReceiveRelayUnprepareResult(sessionId, recMsg);
|
||||
std::string message(MSG_MAX_SIZE + 1, 'a');
|
||||
int32_t ret = DistributedInputSourceTransport::GetInstance().SendMessage(sessionId, message);
|
||||
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
|
||||
}
|
||||
|
||||
HWTEST_F(DistributedInputSourceTransTest, ReceiveSrcTSrcRelayStartDhid01, testing::ext::TestSize.Level1)
|
||||
@@ -808,7 +813,6 @@ HWTEST_F(DistributedInputSourceTransTest, ReceiveSrcTSrcRelayStopDhid01, testing
|
||||
DistributedInputSourceTransport::GetInstance().ReceiveSrcTSrcRelayStopDhid(sessionId, recMsg);
|
||||
recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID] = "vector_dhId_test";
|
||||
DistributedInputSourceTransport::GetInstance().ReceiveSrcTSrcRelayStopDhid(sessionId, recMsg);
|
||||
EXPECT_EQ(0, DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.size());
|
||||
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_[deviceId] = sessionId;
|
||||
DistributedInputSourceTransport::GetInstance().ReceiveSrcTSrcRelayStopDhid(sessionId, recMsg);
|
||||
std::string message(MSG_MAX_SIZE + 1, 'a');
|
||||
@@ -991,7 +995,6 @@ HWTEST_F(DistributedInputSourceTransTest, HandleData01, testing::ext::TestSize.L
|
||||
DistributedInputSourceTransport::GetInstance().HandleData(sessionId, recMsg.dump());
|
||||
DistributedInputSourceTransport::GetInstance().callback_ = nullptr;
|
||||
DistributedInputSourceTransport::GetInstance().HandleData(sessionId, recMsg.dump());
|
||||
|
||||
std::string message(MSG_MAX_SIZE + 1, 'a');
|
||||
int32_t ret = DistributedInputSourceTransport::GetInstance().SendMessage(sessionId, message);
|
||||
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
|
||||
|
||||
Reference in New Issue
Block a user