DMS上报应用信息补充测试用例

Signed-off-by: du-zhihai <duzhihai@huawei.com>
Change-Id: Iabc2bc7707735c38d62fbf3d001ed96e6c9ee400
This commit is contained in:
du-zhihai 2022-09-15 19:36:59 +08:00
parent 289dd8dc99
commit ca64031006
6 changed files with 63 additions and 35 deletions

View File

@ -22,7 +22,8 @@
"dmsfwk_feature_coverage = false",
"dmsfwk_standard_form_share",
"dmsfwk_mission_manager",
"dmsfwk_report_distributedcomponent_memmgr"
"dmsfwk_report_memmgr",
"dmsfwk_report_memmgr_plugins"
],
"hisysevent_config": [
"//foundation/ability/dmsfwk/hisysevent.yaml"

View File

@ -13,21 +13,22 @@
declare_args() {
dmsfwk_standard_form_share = true
dmsfwk_mission_manager = true
efficiency_manager_service_enable = true
dmsfwk_report_distributedcomponent_memmgr = true
if (defined(global_parts_info) &&
!defined(global_parts_info.multimedia_multimedia_image_standard)) {
dmsfwk_mission_manager = false
}
if (defined(global_parts_info) &&
!defined(global_parts_info.resourceschedule_efficiency_manager)) {
efficiency_manager_service_enable = false
}
if (defined(global_parts_info) &&
!defined(global_parts_info.resourceschedule_memmgr) &&
!defined(global_parts_info.resourceschedule_plugins_memmgr)) {
dmsfwk_report_distributedcomponent_memmgr = false
dmsfwk_mission_manager = false
efficiency_manager_service_enable = false
dmsfwk_report_memmgr = false
dmsfwk_report_memmgr_plugins = false
if (defined(global_parts_info) ) {
if (defined(global_parts_info.multimedia_multimedia_image_standard)) {
dmsfwk_mission_manager = true
}
if (defined(global_parts_info.resourceschedule_efficiency_manager)) {
efficiency_manager_service_enable = true
}
if (defined(global_parts_info.resourceschedule_memmgr)) {
dmsfwk_report_memmgr = true
}
if (defined(global_parts_info.resourceschedule_plugins_memmgr)) {
dmsfwk_report_memmgr_plugins = true
}
}
}

View File

@ -26,7 +26,7 @@ config("distributed_sched_config") {
if (dmsfwk_mission_manager) {
defines = [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ]
}
if (dmsfwk_report_distributedcomponent_memmgr) {
if (dmsfwk_report_memmgr || dmsfwk_report_memmgr_plugins) {
defines += [ "SUPPORT_DISTRIBUTEDCOMPONENT_TO_MEMMGR" ]
}
if (dmsfwk_standard_form_share) {
@ -113,13 +113,12 @@ ohos_shared_library("distributedschedsvr") {
external_deps += [ "multimedia_image_standard:image_native" ]
}
if (dmsfwk_report_distributedcomponent_memmgr && defined(global_parts_info)) {
if (defined(global_parts_info.resourceschedule_memmgr)) {
external_deps += [ "memmgr:memmgrclient" ]
}
if (defined(global_parts_info.resourceschedule_plugins_memmgr)) {
external_deps += [ "plugins/memmgr:memmgrclient" ]
}
if (dmsfwk_report_memmgr) {
external_deps += [ "memmgr:memmgrclient" ]
}
if (dmsfwk_report_memmgr_plugins) {
external_deps += [ "plugins/memmgr:memmgrclient" ]
}
install_images = [ system_base_dir ]

View File

@ -1186,9 +1186,12 @@ void DistributedSchedService::ReportDistributedComponentChange(const CallerInfo&
changeType == DISTRIBUTED_COMPONENT_ADD);
#endif
};
if (componentChangeHandler_ == nullptr || !componentChangeHandler_->PostTask(func)) {
if (componentChangeHandler_ == nullptr) {
HILOGE("HandleDistributedComponentChange handler postTask failed");
}
else {
componentChangeHandler_->PostTask(func);
}
#endif
}
@ -1208,9 +1211,12 @@ void DistributedSchedService::ReportDistributedComponentChange(const ConnectInfo
SuspendManager::SuspendManagerClient::GetInstance().ReportStateChangeEvent(
SuspendManager::ReportEventType::DIS_COMP_CHANGE, componentInfo);
};
if (componentChangeHandler_ == nullptr || !componentChangeHandler_->PostTask(func)) {
if (componentChangeHandler_ == nullptr) {
HILOGE("HandleDistributedComponentChange handler postTask failed");
}
else {
componentChangeHandler_->PostTask(func);
}
#endif
}

View File

@ -55,13 +55,12 @@ dsched_external_deps = [
"samgr:samgr_proxy",
]
if (dmsfwk_report_distributedcomponent_memmgr && defined(global_parts_info)) {
if (defined(global_parts_info.resourceschedule_memmgr)) {
dsched_external_deps += [ "memmgr:memmgrclient" ]
}
if (defined(global_parts_info.resourceschedule_plugins_memmgr)) {
dsched_external_deps += [ "plugins/memmgr:memmgrclient" ]
}
if (dmsfwk_report_memmgr) {
dsched_external_deps += [ "memmgr:memmgrclient" ]
}
if (dmsfwk_report_memmgr_plugins) {
dsched_external_deps += [ "plugins/memmgr:memmgrclient" ]
}
if (dmsfwk_standard_form_share) {
@ -143,7 +142,7 @@ ohos_unittest("distributedschedsvrtest") {
public_deps = dsched_public_deps
}
if (dmsfwk_report_distributedcomponent_memmgr) {
if (dmsfwk_report_memmgr || dmsfwk_report_memmgr_plugins) {
defines = [ "SUPPORT_DISTRIBUTEDCOMPONENT_TO_MEMMGR" ]
}

View File

@ -989,6 +989,7 @@ HWTEST_F(DistributedSchedServiceTest, ContinueMission_002, TestSize.Level1)
* @tc.name: StartContinuation_001
* @tc.desc: call StartContinuation
* @tc.type: FUNC
* @tc.require: I5NOA1
*/
HWTEST_F(DistributedSchedServiceTest, StartContinuation_001, TestSize.Level1)
{
@ -1004,6 +1005,27 @@ HWTEST_F(DistributedSchedServiceTest, StartContinuation_001, TestSize.Level1)
int32_t ret = DistributedSchedService::GetInstance().StartContinuation(
want, missionId, callerUid, status, accessToken);
EXPECT_EQ(static_cast<int>(INVALID_REMOTE_PARAMETERS_ERR), ret);
CallerInfo callerInfo;
/**
* @tc.steps: step1. ReportDistributedComponentChange when componentChangeHandler_ is nullptr
*/
DistributedSchedService::GetInstance().componentChangeHandler_ = nullptr;
DistributedSchedService::GetInstance().ReportDistributedComponentChange(callerInfo,
1, IDistributedSched::CALL, IDistributedSched::CALLER);
/**
* @tc.steps: step2. ReportDistributedComponentChange when componentChangeHandler_ is not nullptr
*/
auto runner = AppExecFwk::EventRunner::Create("DmsComponentChange");
DistributedSchedService::GetInstance().componentChangeHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
DistributedSchedService::GetInstance().ReportDistributedComponentChange(callerInfo,
1, IDistributedSched::CALL, IDistributedSched::CALLER);
/**
* @tc.steps: step3. ReportDistributedComponentChange when callerInfo.bundleNames is not empty
*/
callerInfo.bundleNames.emplace_back("bundleName");
DistributedSchedService::GetInstance().ReportDistributedComponentChange(callerInfo,
1, IDistributedSched::CALL, IDistributedSched::CALLER);
DTEST_LOG << "DSchedContinuationTest StartContinuation_001 end" << std::endl;
}