异包名接续广播缓存优化及添加打点

Signed-off-by: MisterE <smart_e@126.com>
This commit is contained in:
MisterE 2024-09-12 17:22:56 +08:00
commit 71e32f7f2d
2 changed files with 23 additions and 15 deletions

View File

@ -150,21 +150,25 @@ HWTEST_F(DSchedContinueManagerTest, ContinueMission_003, TestSize.Level3)
DTEST_LOG << "DSchedContinueManagerTest ContinueMission_003 begin" << std::endl;
DistributedSchedUtil::MockPermission();
OHOS::AAFwk::WantParams wantParams;
int32_t ret = DSchedContinueManager::GetInstance().ContinueMission("", "", BUNDLE_NAME,
CONTINUETYPE, nullptr, wantParams);
int32_t ret = DSchedContinueManager::GetInstance().ContinueMission(
DSchedContinueInfo("", BUNDLE_NAME, "", BUNDLE_NAME, CONTINUETYPE),
nullptr, wantParams);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
ret = DSchedContinueManager::GetInstance().ContinueMission(LOCAL_DEVICEID, "", BUNDLE_NAME,
CONTINUETYPE, nullptr, wantParams);
ret = DSchedContinueManager::GetInstance().ContinueMission(
DSchedContinueInfo(LOCAL_DEVICEID, BUNDLE_NAME, "", BUNDLE_NAME, CONTINUETYPE),
nullptr, wantParams);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
ret = DSchedContinueManager::GetInstance().ContinueMission(LOCAL_DEVICEID, REMOTE_DEVICEID, BUNDLE_NAME,
CONTINUETYPE, nullptr, wantParams);
ret = DSchedContinueManager::GetInstance().ContinueMission(
DSchedContinueInfo(LOCAL_DEVICEID, BUNDLE_NAME, REMOTE_DEVICEID, BUNDLE_NAME, CONTINUETYPE),
nullptr, wantParams);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
auto callback = GetDSchedService();
ret = DSchedContinueManager::GetInstance().ContinueMission(LOCAL_DEVICEID, REMOTE_DEVICEID, BUNDLE_NAME,
CONTINUETYPE, callback, wantParams);
ret = DSchedContinueManager::GetInstance().ContinueMission(
DSchedContinueInfo(LOCAL_DEVICEID, BUNDLE_NAME, REMOTE_DEVICEID, BUNDLE_NAME, CONTINUETYPE),
callback, wantParams);
EXPECT_EQ(ret, OPERATION_DEVICE_NOT_INITIATOR_OR_TARGET);
std::string locDevId;
@ -189,12 +193,15 @@ HWTEST_F(DSchedContinueManagerTest, HandleContinueMission_001, TestSize.Level3)
DTEST_LOG << "DSchedContinueManagerTest HandleContinueMission_001 begin" << std::endl;
OHOS::AAFwk::WantParams wantParams;
auto callback = GetDSchedService();
DSchedContinueManager::GetInstance().HandleContinueMission("", REMOTE_DEVICEID, BUNDLE_NAME, CONTINUETYPE,
DSchedContinueManager::GetInstance().HandleContinueMission(
DSchedContinueInfo("", BUNDLE_NAME, REMOTE_DEVICEID, BUNDLE_NAME, CONTINUETYPE),
callback, wantParams);
DSchedContinueManager::GetInstance().HandleContinueMission(LOCAL_DEVICEID, "", BUNDLE_NAME, CONTINUETYPE,
DSchedContinueManager::GetInstance().HandleContinueMission(
DSchedContinueInfo(LOCAL_DEVICEID, BUNDLE_NAME, "", BUNDLE_NAME, CONTINUETYPE),
callback, wantParams);
DSchedContinueManager::GetInstance().HandleContinueMission(LOCAL_DEVICEID, REMOTE_DEVICEID, BUNDLE_NAME,
CONTINUETYPE, nullptr, wantParams);
DSchedContinueManager::GetInstance().HandleContinueMission(
DSchedContinueInfo(LOCAL_DEVICEID, BUNDLE_NAME, LOCAL_DEVICEID, BUNDLE_NAME, CONTINUETYPE),
nullptr, wantParams);
DSchedContinueManager::GetInstance().HandleContinueMission(LOCAL_DEVICEID, REMOTE_DEVICEID, BUNDLE_NAME,
CONTINUETYPE, callback, wantParams);

View File

@ -453,15 +453,16 @@ HWTEST_F(DMSContinueManagerTest, testDealOnBroadcastBusiness001, TestSize.Level3
*/
sptr<IRemoteObject> obj = nullptr;
std::string networkId = "invalid networkId";
std::string bundleName = "invalid bundleName";
std::string sourceBundleName = "invalid sourceBundleName";
std::string sinkBundleName = "invalid sinkBundleName";
std::string continueType = "invalid continueType";
DMSContinueRecvMgr::GetInstance().NotifyRecvBroadcast(obj, networkId, bundleName, state, continueType);
DMSContinueRecvMgr::GetInstance().NotifyRecvBroadcast(obj, networkId, sourceBundleName, sinkBundleName, state, continueType);
/**
* @tc.steps: step3. test NotifyRecvBroadcast when missionId is invalid;
*/
obj = new RemoteOnListenerStubTest();
DMSContinueRecvMgr::GetInstance().NotifyRecvBroadcast(obj, networkId, bundleName, state, continueType);
DMSContinueRecvMgr::GetInstance().NotifyRecvBroadcast(obj, networkId, sourceBundleName, sinkBundleName, state, continueType);
DTEST_LOG << "DMSContinueManagerTest testDealOnBroadcastBusiness001 end" << std::endl;
}