From 1a54dcbc882a34a8f574be0a44c7763f7cfbb4e8 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 14:13:07 +0800 Subject: [PATCH 01/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../include/form_ability_commona.h | 11 +- .../src/form_ability_commona.cpp | 59 +- .../src/form_ability_no_perm.cpp | 2 + .../include/form_ability_a.h | 4 + .../include/form_ability_deleteform.h | 9 +- .../src/form_ability_a.cpp | 171 +++- .../src/form_ability_deleteform.cpp | 209 +++-- .../src/form_ability_releaseform.cpp | 54 +- .../src/form_ability_b.cpp | 8 +- .../src/form_ability_c.cpp | 1 + .../src/form_ability_not_sys.cpp | 3 + test/systemtest/BUILD.gn | 1 + .../fms/common/include/form_st_common_info.h | 153 +++- .../common/include/system_test_form_util.h | 15 + .../fms/common/src/system_test_form_util.cpp | 73 ++ .../common/fms/fms_acquire_form_test/BUILD.gn | 2 + .../fms_acquire_form_test.cpp | 309 ++++++- .../fms_acquire_form_test_batch.cpp | 203 ++++- .../fms_acquire_form_test_max.cpp | 763 ------------------ .../fms_delete_form_test.cpp | 585 ++++++++++++-- .../fms_release_form_test.cpp | 395 ++++++--- .../fms_self_starting_test.cpp | 147 ++-- .../self_starting_test_config_parser.h | 45 +- tools/fm/src/fms_command.cpp | 2 +- 24 files changed, 2030 insertions(+), 1194 deletions(-) mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_a.h mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_deleteform.h mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp mode change 100644 => 100755 test/systemtest/common/fms/common/include/system_test_form_util.h mode change 100644 => 100755 test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn mode change 100644 => 100755 test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp delete mode 100644 test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/include/form_ability_commona.h b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/include/form_ability_commona.h index 89ae25797a..bd37d22f82 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/include/form_ability_commona.h +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/include/form_ability_commona.h @@ -29,19 +29,24 @@ public: void handleEvent(std::string action, std::string data); void FMS_acquireForm(std::string data); void FMS_deleteForm(std::string data); + void FMS_acquireForm_001(std::string data); + void FMS_deleteForm_001(std::string data); void FMS_acquireForm_batch(std::string data); void FMS_deleteFormBatch(std::string data); std::shared_ptr subscriber_; class AcquireFormCallback : public FormCallback { public: - AcquireFormCallback() + AcquireFormCallback(std::string name, int code):caseName_(name), code_(code) { } virtual ~AcquireFormCallback() = default; void OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const override; void OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const override; void OnFormUninstall(const int64_t formId) const override; + std::string caseName_ = ""; + int code_ = 0; + FormAbilityCommonA *ability_; }; protected: virtual void Init(const std::shared_ptr &abilityInfo, @@ -52,9 +57,11 @@ protected: virtual void OnActive() override; virtual void OnInactive() override; virtual void OnBackground() override; - +private: + void Clear(); using FormFunc = void (FormAbilityCommonA::*)(std::string data); std::map memberFuncMap_; + std::map calledFuncMap_; std::shared_ptr callback_; }; diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp index 401b391d0d..32cad6992d 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp @@ -28,6 +28,8 @@ namespace AppExecFwk { std::vector eventList = { FORM_EVENT_REQ_ONE_NORMAL_FORM, FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, + FORM_EVENT_REQ_ONE_NORMAL_FORM_001, + FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL_001, FORM_EVENT_REQ_ACQUIRE_FORM_BATCH, FORM_EVENT_REQ_CLEAR_FORM_BATCH }; @@ -37,8 +39,8 @@ void FormAbilityCommonA::AcquireFormCallback::OnAcquired(const int32_t result, c } void FormAbilityCommonA::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100, std::to_string(formJsInfo.formId)); + APP_LOGI("%{public}s called, caseName_[%{public}s]", __func__, this->caseName_.c_str()); + FormTestUtils::PublishEvent(this->caseName_, this->code_, std::to_string(formJsInfo.formId).c_str()); } void FormAbilityCommonA::AcquireFormCallback::OnFormUninstall(const int64_t formId) const @@ -50,7 +52,8 @@ void FormAbilityCommonA::AcquireFormCallback::OnFormUninstall(const int64_t form void FormAbilityCommonA::FMS_acquireForm(std::string data) { APP_LOGI("%{public}s called, data: %{public}s", __func__, data.c_str()); - std::shared_ptr callback = std::make_shared(); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -66,9 +69,10 @@ void FormAbilityCommonA::FMS_acquireForm(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("[form_ability_commonA]AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110, "true"); } else { APP_LOGE("[form_ability_commonA]AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110, "false"); } } void FormAbilityCommonA::FMS_deleteForm(std::string data) @@ -83,6 +87,43 @@ void FormAbilityCommonA::FMS_deleteForm(std::string data) FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, "false"); } } + +void FormAbilityCommonA::FMS_acquireForm_001(std::string data) +{ + APP_LOGI("%{public}s called, data: %{public}s", __func__, data.c_str()); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100); + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + // Set Want info end + bool bResult = AcquireForm(0, want, callback); + if (bResult) { + APP_LOGI("[form_ability_commonA]AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110, "true"); + } else { + APP_LOGE("[form_ability_commonA]AcquireForm error"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110, "false"); + } +} + +void FormAbilityCommonA::FMS_deleteForm_001(std::string data) +{ + APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + bool bResult = DeleteForm(atoll(data.c_str())); + if (bResult) { + APP_LOGI("%{public}s DeleteForm end", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101, "true"); + } else { + APP_LOGE("%{public}s DeleteForm error", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101, "false"); + } +} + void FormAbilityCommonA::FMS_acquireForm_batch(std::string data) { APP_LOGI("%{public}s called", __func__); @@ -177,6 +218,8 @@ void FormAbilityCommonA::Init(const std::shared_ptr &abilityInfo, Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM] = &FormAbilityCommonA::FMS_acquireForm; memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL] = &FormAbilityCommonA::FMS_deleteForm; + memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM_001] = &FormAbilityCommonA::FMS_acquireForm_001; + memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL_001] = &FormAbilityCommonA::FMS_deleteForm_001; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_BATCH] = &FormAbilityCommonA::FMS_acquireForm_batch; memberFuncMap_[FORM_EVENT_REQ_CLEAR_FORM_BATCH] = &FormAbilityCommonA::FMS_deleteFormBatch; SubscribeEvent(); @@ -185,6 +228,10 @@ void FormAbilityCommonA::Init(const std::shared_ptr &abilityInfo, void FormAbilityCommonA::handleEvent(std::string action, std::string data) { APP_LOGI("%{public}s called", __func__); + if (calledFuncMap_.find(action) != calledFuncMap_.end()) { + return; + } + calledFuncMap_.emplace(action, 0); auto itFunc = memberFuncMap_.find(action); if (itFunc != memberFuncMap_.end()) { auto memberFunc = itFunc->second; @@ -194,6 +241,10 @@ void FormAbilityCommonA::handleEvent(std::string action, std::string data) } } +void FormAbilityCommonA::Clear() +{ +} + void FormEventSubscriberForCommonA::OnReceiveEvent(const CommonEventData &data) { APP_LOGI("FormEventSubscriberForCommonA::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp old mode 100644 new mode 100755 index c0bab3eab5..0adb42efa6 --- a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp @@ -63,6 +63,7 @@ void FormAbilityNoPerm::FMS_deleteForm_0200() bool bResult = DeleteForm(formId); if (bResult) { APP_LOGI("[FMS_deleteForm_0200] end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0200, EVENT_CODE_200, "true"); } else { APP_LOGE("[FMS_deleteForm_0200] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0200, EVENT_CODE_200, "false"); @@ -76,6 +77,7 @@ void FormAbilityNoPerm::FMS_releaseForm_0200() bool bResult = ReleaseForm(formId, isReleaseCache); if (bResult) { APP_LOGI("[FMS_releaseForm_0200] end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0200, EVENT_CODE_200, "true"); } else { APP_LOGE("[FMS_releaseForm_0200] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0200, EVENT_CODE_200, "false"); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_a.h b/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_a.h old mode 100644 new mode 100755 index bb63b78c25..7efe314180 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_a.h +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_a.h @@ -31,6 +31,7 @@ public: void FMS_deleteFormCommon(std::string strFormId); void FMS_acquireForm_0300(std::string data); + void FMS_acquireForm_0300_1(std::string data); void FMS_acquireForm_0400(std::string data); void FMS_acquireForm_0500(std::string data); void FMS_acquireForm_0600(std::string data); @@ -60,6 +61,9 @@ public: void FMS_acquireForm_3300(std::string data); void FMS_acquireForm_3400(std::string data); void FMS_acquireForm_3500(std::string data); + void FMS_acquireForm_3700(std::string data); + void FMS_acquireForm_3800(std::string data); + void FMS_acquireForm_3800_1(std::string data); void FMS_acquireForm_tempForm(std::string data); void FMS_acquireFormBatch(std::string data); void FMS_acquireFormBatchB(std::string data); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_deleteform.h b/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_deleteform.h old mode 100644 new mode 100755 index 9af88ac6a1..88fb39f361 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_deleteform.h +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_deleteform.h @@ -32,6 +32,8 @@ public: void FMS_deleteForm_0500(std::string data); void FMS_deleteForm_0600(std::string data); void FMS_deleteForm_0700(std::string data); + void FMS_deleteForm_0700_1(std::string data); + void FMS_deleteForm_0700_2(std::string data); void FMS_deleteForm_0800(std::string data); void FMS_deleteForm_0900(std::string data); void FMS_deleteForm_1000(std::string data); @@ -52,11 +54,11 @@ public: void FMS_acquire_tempForm_batch(std::string data); void FMS_acquireForm_batch(std::string data); void FMS_deleteFormBatch(std::string data); - + void FMS_deleteFormCommon(std::string data); std::shared_ptr subscriber_; class AcquireFormCallback : public FormCallback { public: - AcquireFormCallback(std::string name):caseName_(name) + AcquireFormCallback(std::string name, int code):caseName_(name), code_(code) { } virtual ~AcquireFormCallback() = default; @@ -65,6 +67,7 @@ public: void OnFormUninstall(const int64_t formId) const override; FormAbilityDeleteForm *ability_; std::string caseName_; + int code_ = 0; }; protected: virtual void Init(const std::shared_ptr &abilityInfo, @@ -82,6 +85,8 @@ private: void DeleteForm_0500(int64_t form_id); void DeleteForm_0600(int64_t form_id); void DeleteForm_0700(int64_t form_id); + void DeleteForm_0700_1(int64_t form_id); + void DeleteForm_0700_2(int64_t form_id); void DeleteForm_0800(int64_t form_id); void DeleteForm_0900(int64_t form_id); void DeleteForm_1000(int64_t form_id); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp index 344a14cf92..4cb3944ad9 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp @@ -14,6 +14,7 @@ */ #include "form_ability_a.h" #include "app_log_wrapper.h" +#include "form_host_client.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -25,9 +26,10 @@ using namespace OHOS::EventFwk; namespace OHOS { namespace AppExecFwk { +const int TWO = 2; std::vector eventList = { - FORM_EVENT_REQ_DELETE_FORM_COMMON, FORM_EVENT_REQ_ACQUIRE_FORM_TEMP, - FORM_EVENT_REQ_ACQUIRE_FORM_0300, FORM_EVENT_REQ_ACQUIRE_FORM_0400, FORM_EVENT_REQ_ACQUIRE_FORM_0500, + FORM_EVENT_REQ_DELETE_FORM_COMMON, FORM_EVENT_REQ_ACQUIRE_FORM_TEMP, FORM_EVENT_REQ_ACQUIRE_FORM_0300, + FORM_EVENT_REQ_ACQUIRE_FORM_0300_1, FORM_EVENT_REQ_ACQUIRE_FORM_0400, FORM_EVENT_REQ_ACQUIRE_FORM_0500, FORM_EVENT_REQ_ACQUIRE_FORM_0600, FORM_EVENT_REQ_ACQUIRE_FORM_0700, FORM_EVENT_REQ_ACQUIRE_FORM_1000, FORM_EVENT_REQ_ACQUIRE_FORM_1100, FORM_EVENT_REQ_ACQUIRE_FORM_1200, FORM_EVENT_REQ_ACQUIRE_FORM_1500_1, FORM_EVENT_REQ_ACQUIRE_FORM_1600, FORM_EVENT_REQ_ACQUIRE_FORM_1600_1, FORM_EVENT_REQ_ACQUIRE_FORM_1800, @@ -37,7 +39,8 @@ std::vector eventList = { FORM_EVENT_REQ_ACQUIRE_FORM_2700, FORM_EVENT_REQ_ACQUIRE_FORM_2800, FORM_EVENT_REQ_ACQUIRE_FORM_2900, FORM_EVENT_REQ_ACQUIRE_FORM_2900_1, FORM_EVENT_REQ_ACQUIRE_FORM_3000, FORM_EVENT_REQ_ACQUIRE_FORM_3100, FORM_EVENT_REQ_ACQUIRE_FORM_BATCH, FORM_EVENT_REQ_ACQUIRE_TEMP_FORM_BATCH, FORM_EVENT_REQ_CLEAR_FORM_BATCH, - FORM_EVENT_REQ_ACQUIRE_FORM_BATCH_B, + FORM_EVENT_REQ_ACQUIRE_FORM_BATCH_B, FORM_EVENT_REQ_ACQUIRE_FORM_3700, FORM_EVENT_REQ_ACQUIRE_FORM_3800, + FORM_EVENT_REQ_ACQUIRE_FORM_3800_1 }; void FormAbilityA::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { @@ -47,6 +50,11 @@ void FormAbilityA::AcquireFormCallback::OnAcquired(const int32_t result, const F void FormAbilityA::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { APP_LOGI("%{public}s called", __func__); + if (this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_3800) { + FormTestUtils::PublishEvent(this->caseName_, this->code_ + 1, std::to_string(formJsInfo.formId)); + ability_->FMS_acquireForm_3800_1(std::to_string(formJsInfo.formId)); + return; + } FormTestUtils::PublishEvent(this->caseName_, this->code_ + 1, formJsInfo.formData); if (this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1200 @@ -102,11 +110,39 @@ void FormAbilityA::FMS_acquireForm_0300(std::string data) bool bResult = AcquireForm(-1, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0300, EVENT_CODE_300, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0300, EVENT_CODE_300, "false"); } } + +void FormAbilityA::FMS_acquireForm_0300_1(std::string data) +{ + APP_LOGI("%{public}s called", __func__); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_0300_1, EVENT_CODE_300_1); + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + // Set Want info end + int64_t int64MaxId = 9223372036854775807; + + bool bResult = AcquireForm(int64MaxId, want, callback); + if (bResult) { + std::string strFormId = std::to_string(int64MaxId); + APP_LOGI("AcquireForm end, formId: %{public}s", strFormId.c_str()); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0300_1, EVENT_CODE_300_1, "true"); + } else { + APP_LOGE("AcquireForm error"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0300_1, EVENT_CODE_300_1, "false"); + } +} + void FormAbilityA::FMS_acquireForm_0400(std::string data) { APP_LOGI("%{public}s called", __func__); @@ -123,6 +159,7 @@ void FormAbilityA::FMS_acquireForm_0400(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0400, EVENT_CODE_400, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0400, EVENT_CODE_400, "false"); @@ -145,6 +182,7 @@ void FormAbilityA::FMS_acquireForm_0500(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0500, EVENT_CODE_500, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0500, EVENT_CODE_500, "false"); @@ -167,6 +205,7 @@ void FormAbilityA::FMS_acquireForm_0600(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0600, EVENT_CODE_600, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0600, EVENT_CODE_600, "false"); @@ -188,6 +227,7 @@ void FormAbilityA::FMS_acquireForm_0700(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0700, EVENT_CODE_700, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0700, EVENT_CODE_700, "false"); @@ -209,6 +249,7 @@ void FormAbilityA::FMS_acquireForm_1000(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1000, EVENT_CODE_1000, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1000, EVENT_CODE_1000, "false"); @@ -231,9 +272,10 @@ void FormAbilityA::FMS_acquireForm_1100(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1106, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1106, ""); } } void FormAbilityA::FMS_acquireForm_1200(std::string data) @@ -253,9 +295,10 @@ void FormAbilityA::FMS_acquireForm_1200(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1202, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1200, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1202, ""); } } @@ -276,9 +319,10 @@ void FormAbilityA::FMS_acquireForm_1500_1(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1512, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1512, ""); } } @@ -299,9 +343,10 @@ void FormAbilityA::FMS_acquireForm_1600(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1602, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1600, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1602, ""); } } void FormAbilityA::FMS_acquireForm_1600_1(std::string data) @@ -321,9 +366,10 @@ void FormAbilityA::FMS_acquireForm_1600_1(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1612, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1610, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1612, ""); } } void FormAbilityA::FMS_acquireForm_1800(std::string data) @@ -343,9 +389,10 @@ void FormAbilityA::FMS_acquireForm_1800(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1803, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1800, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1803, ""); } } void FormAbilityA::FMS_acquireForm_1800_1(std::string data) @@ -365,9 +412,10 @@ void FormAbilityA::FMS_acquireForm_1800_1(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1812, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1810, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1812, ""); } } void FormAbilityA::FMS_acquireForm_1900(std::string data) @@ -387,9 +435,10 @@ void FormAbilityA::FMS_acquireForm_1900(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1902, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1900, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1902, ""); } } void FormAbilityA::FMS_acquireForm_2100(std::string data) @@ -410,6 +459,7 @@ void FormAbilityA::FMS_acquireForm_2100(std::string data) bool bResult = AcquireForm(formId, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100, "false"); @@ -425,6 +475,7 @@ void FormAbilityA::FMS_acquireForm_2200(std::string data) bool bResult = CastTempForm(-1); if (bResult) { APP_LOGI("CastTempForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2200, EVENT_CODE_2200, "true"); } else { APP_LOGE("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2200, EVENT_CODE_2200, "false"); @@ -440,6 +491,7 @@ void FormAbilityA::FMS_acquireForm_2300(std::string data) bool bResult = CastTempForm(0); if (bResult) { APP_LOGI("CastTempForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2300, EVENT_CODE_2300, "true"); } else { APP_LOGE("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2300, EVENT_CODE_2300, "false"); @@ -462,9 +514,10 @@ void FormAbilityA::FMS_acquireForm_2400(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2402, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2400, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2402, ""); } } @@ -478,6 +531,7 @@ void FormAbilityA::FMS_acquireForm_2500(std::string data) bool bResult = CastTempForm(EVENT_CODE_1234); if (bResult) { APP_LOGI("CastTempForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2500, EVENT_CODE_2500, "true"); } else { APP_LOGE("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2500, EVENT_CODE_2500, "false"); @@ -500,9 +554,10 @@ void FormAbilityA::FMS_acquireForm_2600_1(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2612, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2610, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2612, ""); } } @@ -537,6 +592,7 @@ void FormAbilityA::FMS_acquireForm_2700(std::string data) bool bResult = CastTempForm(formId); if (bResult) { APP_LOGI("CastTempForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2700, EVENT_CODE_2700, "true"); } else { APP_LOGE("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2700, EVENT_CODE_2700, "false"); @@ -555,6 +611,7 @@ void FormAbilityA::FMS_acquireForm_2800(std::string data) bool bResult = CastTempForm(formId); if (bResult) { APP_LOGI("CastTempForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2800, EVENT_CODE_2800, "true"); } else { APP_LOGE("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2800, EVENT_CODE_2800, "false"); @@ -579,9 +636,10 @@ void FormAbilityA::FMS_acquireForm_2900(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2902, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2902, ""); } } @@ -623,6 +681,7 @@ void FormAbilityA::FMS_acquireForm_3000(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3000, EVENT_CODE_3000, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3000, EVENT_CODE_3000, "false"); @@ -645,9 +704,10 @@ void FormAbilityA::FMS_acquireForm_3100(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3102, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3102, ""); } } @@ -660,6 +720,81 @@ void FormAbilityA::FMS_acquireForm_3400(std::string data) void FormAbilityA::FMS_acquireForm_3500(std::string data) { } +void FormAbilityA::FMS_acquireForm_3700(std::string data) +{ + APP_LOGI("%{public}s called", __func__); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3700, EVENT_CODE_3700); + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + // Set Want info end + bool bResult = AcquireForm(0, want, callback); + if (bResult) { + APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3700, EVENT_CODE_3700, "true"); + } else { + APP_LOGE("AcquireForm error"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3700, EVENT_CODE_3700, "false"); + } +} + +void FormAbilityA::FMS_acquireForm_3800(std::string data) +{ + APP_LOGI("%{public}s called", __func__); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3800); + callback->ability_ = this; + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + // Set Want info end + bool bResult = AcquireForm(0, want, callback); + if (bResult) { + APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802, "true"); + } else { + APP_LOGE("AcquireForm error"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802, ""); + } +} + +void FormAbilityA::FMS_acquireForm_3800_1(std::string data) +{ + if (FormHostClient::GetInstance()->ContainsForm(std::stoll(data))) { + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3800 + TWO, "true"); + } + APP_LOGI("%{public}s called, formId: %{public}s", __func__, data.c_str()); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3800_1, EVENT_CODE_3801); + callback->ability_ = this; + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + // Set Want info end + bool bResult = AcquireForm(std::stoll(data), want, callback); + if (bResult) { + APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3800_1, EVENT_CODE_3801, "true"); + } else { + APP_LOGE("AcquireForm error"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3800_1, EVENT_CODE_3801, "false"); + } + + FMS_deleteFormCommon(data); +} void FormAbilityA::FMS_acquireForm_tempForm(std::string data) { @@ -826,6 +961,7 @@ void FormAbilityA::Init(const std::shared_ptr &abilityInfo, APP_LOGI("FormAbilityA::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0300] = &FormAbilityA::FMS_acquireForm_0300; + memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0300_1] = &FormAbilityA::FMS_acquireForm_0300_1; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0400] = &FormAbilityA::FMS_acquireForm_0400; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0500] = &FormAbilityA::FMS_acquireForm_0500; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0600] = &FormAbilityA::FMS_acquireForm_0600; @@ -852,6 +988,9 @@ void FormAbilityA::Init(const std::shared_ptr &abilityInfo, memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_2900_1] = &FormAbilityA::FMS_acquireForm_2900_1; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_3000] = &FormAbilityA::FMS_acquireForm_3000; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_3100] = &FormAbilityA::FMS_acquireForm_3100; + memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_3700] = &FormAbilityA::FMS_acquireForm_3700; + memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_3800] = &FormAbilityA::FMS_acquireForm_3800; + memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_3800_1] = &FormAbilityA::FMS_acquireForm_3800_1; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_COMMON] = &FormAbilityA::FMS_deleteFormCommon; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_TEMP] = &FormAbilityA::FMS_acquireForm_tempForm; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_BATCH] = &FormAbilityA::FMS_acquireFormBatch; @@ -901,4 +1040,4 @@ void FormEventSubscriber::KitTerminateAbility() REGISTER_AA(FormAbilityA) } // namespace AppExecFwk -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp index f50e5b4f7b..f7dedd295f 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp @@ -37,14 +37,19 @@ void FormAbilityDeleteForm::AcquireFormCallback::OnUpdate(const int32_t result, { APP_LOGI("%{public}s called", __func__); APP_LOGI("%{public}s receive formData:%{public}s", __func__, formJsInfo.formData.c_str()); + if (this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0700_1 || + this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0700_2) { + FormTestUtils::PublishEvent(this->caseName_, this->code_, std::to_string(formJsInfo.formId).c_str()); + } + if (this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0300 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0400 - || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0700 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0800 + || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0700 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1701 + || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0700_2 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0800 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0900 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1000 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1100 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1200 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1400 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1500 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1501 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1600 - || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1601 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1700 - || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1701) { + || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1601 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1700) { ability_->FMS_deleteForm_common(formJsInfo.formId, this->caseName_); } } @@ -66,6 +71,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_common(int64_t formId, std::string ca DeleteForm_0600(formId); } else if (caseName == FORM_EVENT_RECV_DELETE_FORM_0700) { DeleteForm_0700(formId); + } else if (caseName == FORM_EVENT_RECV_DELETE_FORM_0700_1) { + DeleteForm_0700_1(formId); + } else if (caseName == FORM_EVENT_RECV_DELETE_FORM_0700_2) { + DeleteForm_0700_2(formId); } else if (caseName == FORM_EVENT_RECV_DELETE_FORM_0800) { DeleteForm_0800(formId); } else if (caseName == FORM_EVENT_RECV_DELETE_FORM_0900) { @@ -98,7 +107,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_common(int64_t formId, std::string ca void FormAbilityDeleteForm::FMS_deleteForm_0300(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0300); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300); callback->ability_ = this; // Set Want info begin Want want; @@ -111,15 +120,16 @@ void FormAbilityDeleteForm::FMS_deleteForm_0300(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_310, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_310, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_0400(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0400); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400); callback->ability_ = this; // Set Want info begin Want want; @@ -132,9 +142,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0400(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_410, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_410, "false"); } } @@ -155,7 +166,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) { APP_LOGI("%{public}s start[%{public}s]", __func__, data.c_str()); std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0600); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600); callback->ability_ = this; // Set Want info begin Want want; @@ -168,16 +179,17 @@ void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_0700(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0700); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700); callback->ability_ = this; // Set Want info begin Want want; @@ -190,16 +202,62 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710, "false"); + } +} +void FormAbilityDeleteForm::FMS_deleteForm_0700_1(std::string data) +{ + APP_LOGI("%{public}s start.", __func__); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1); + callback->ability_ = this; + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + // Set Want info end + bool bResult = AcquireForm(0, want, callback); + if (bResult) { + APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1, "true"); + } else { + APP_LOGE("%{public}s AcquireForm error.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1, "false"); + } +} +void FormAbilityDeleteForm::FMS_deleteForm_0700_2(std::string data) +{ + APP_LOGI("%{public}s start.", __func__); + std::shared_ptr callback = + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); + callback->ability_ = this; + // Set Want info begin + Want want; + want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + // Set Want info end + bool bResult = AcquireForm(0, want, callback); + if (bResult) { + APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2, "true"); + } else { + APP_LOGE("%{public}s AcquireForm error.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2, "false"); } } - void FormAbilityDeleteForm::FMS_deleteForm_0800(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0800); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800); callback->ability_ = this; // Set Want info begin Want want; @@ -212,15 +270,16 @@ void FormAbilityDeleteForm::FMS_deleteForm_0800(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_0900(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0900); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900); callback->ability_ = this; // Set Want info begin Want want; @@ -233,16 +292,17 @@ void FormAbilityDeleteForm::FMS_deleteForm_0900(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_910, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_910, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_1000(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1000); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000); callback->ability_ = this; // Set Want info begin Want want; @@ -255,16 +315,17 @@ void FormAbilityDeleteForm::FMS_deleteForm_1000(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1010, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1010, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_1100(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1100); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100); callback->ability_ = this; // Set Want info begin Want want; @@ -277,16 +338,17 @@ void FormAbilityDeleteForm::FMS_deleteForm_1100(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_1200(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1200); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200); callback->ability_ = this; // Set Want info begin Want want; @@ -303,9 +365,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1200(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1210, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1210, "false"); } } @@ -315,7 +378,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1201(std::string data) bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { APP_LOGI("%{public}s DeleteForm end", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1201, EVENT_CODE_1201, "true"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1201, EVENT_CODE_1201, data.c_str()); } else { APP_LOGE("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1201, EVENT_CODE_1201, "false"); @@ -325,7 +388,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1201(std::string data) void FormAbilityDeleteForm::FMS_deleteForm_1400(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1400); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400); callback->ability_ = this; // Set Want info begin Want want; @@ -342,9 +405,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1400(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1410, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1410, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_1401(std::string data) @@ -363,7 +427,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1401(std::string data) void FormAbilityDeleteForm::FMS_deleteForm_1500(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1500); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500); callback->ability_ = this; // Set Want info begin Want want; @@ -376,9 +440,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1500(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500_1, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500_1, "false"); } } @@ -389,7 +454,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) if (bResult) { APP_LOGI("%{public}s DeleteForm end", __func__); std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1501); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510); callback->ability_ = this; // Set Want info begin Want want; @@ -402,13 +467,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510_1, "acquireSuccess"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510, "acquireError"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510_1, "acquireError"); } } else { APP_LOGE("%{public}s DeleteForm error", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510, "deleteError"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510_1, "deleteError"); } } void FormAbilityDeleteForm::FMS_deleteForm_1502(std::string data) @@ -426,7 +492,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1502(std::string data) void FormAbilityDeleteForm::FMS_deleteForm_1600(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1600); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600); callback->ability_ = this; // Set Want info begin Want want; @@ -439,9 +505,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1600(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600_1, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600_1, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) @@ -451,7 +518,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) if (bResult) { APP_LOGI("%{public}s DeleteForm end", __func__); std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1601); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610); callback->ability_ = this; // Set Want info begin Want want; @@ -464,13 +531,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610_1, "acquireSuccess"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610, "acquireError"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610_1, "acquireError"); } } else { APP_LOGE("%{public}s DeleteForm error", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610, "deleteError"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610_1, "deleteError"); } } void FormAbilityDeleteForm::FMS_deleteForm_1602(std::string data) @@ -489,7 +557,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1602(std::string data) void FormAbilityDeleteForm::FMS_deleteForm_1700(std::string data) { std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1700); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1700); callback->ability_ = this; // Set Want info begin Want want; @@ -502,9 +570,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1700(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1710, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1700, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1710, "false"); } } @@ -515,7 +584,7 @@ void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) if (bResult) { APP_LOGI("%{public}s DeleteForm end", __func__); std::shared_ptr callback = - std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1701); + std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701); callback->ability_ = this; // Set Want info begin Want want; @@ -528,13 +597,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1711, "acquireSuccess"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701, "acquireError"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1711, "acquireError"); } } else { APP_LOGE("%{public}s DeleteForm error", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701, "deleteError"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1711, "deleteError"); } } void FormAbilityDeleteForm::FMS_deleteForm_1702(std::string data) @@ -549,6 +619,28 @@ void FormAbilityDeleteForm::FMS_deleteForm_1702(std::string data) FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1702, EVENT_CODE_1702, "false"); } } + +void FormAbilityDeleteForm::FMS_deleteFormCommon(std::string strFormId) +{ + APP_LOGI("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); + if (strFormId.empty()) { + APP_LOGE("DeleteForm error, formId is 0"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); + return; + } + int64_t formId = std::stoll(strFormId); + sleep(1); + bool bResult = DeleteForm(formId); + sleep(1); + if (bResult) { + APP_LOGI("DeleteForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "true"); + } else { + APP_LOGE("DeleteForm error"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); + } +} + void FormAbilityDeleteForm::FMS_acquire_tempForm_batch(std::string data) { APP_LOGI("%{public}s called", __func__); @@ -662,7 +754,28 @@ void FormAbilityDeleteForm::DeleteForm_0700(int64_t form_id) FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700, "false"); } } - +void FormAbilityDeleteForm::DeleteForm_0700_1(int64_t form_id) +{ + bool bResult = DeleteForm(form_id); + if (bResult) { + APP_LOGI("%{public}s DeleteForm end", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1, std::to_string(form_id)); + } else { + APP_LOGE("%{public}s DeleteForm error", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1, "false"); + } +} +void FormAbilityDeleteForm::DeleteForm_0700_2(int64_t form_id) +{ + bool bResult = DeleteForm(form_id); + if (bResult) { + APP_LOGI("%{public}s DeleteForm end", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2, std::to_string(form_id)); + } else { + APP_LOGE("%{public}s DeleteForm error", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2, "false"); + } +} void FormAbilityDeleteForm::DeleteForm_0800(int64_t form_id) { bool bResult = DeleteForm(form_id); @@ -690,7 +803,7 @@ void FormAbilityDeleteForm::DeleteForm_0900(int64_t form_id) } } else { APP_LOGE("%{public}s DeleteForm1 error", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, "false"); } } @@ -702,14 +815,14 @@ void FormAbilityDeleteForm::DeleteForm_1000(int64_t form_id) bool realResult = DeleteForm(form_id); if (realResult) { APP_LOGI("%{public}s DeleteForm end", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, "true"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, std::to_string(form_id)); } else { APP_LOGE("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, "false"); } } else { APP_LOGE("%{public}s ReleaseForm error", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, "false"); } } void FormAbilityDeleteForm::DeleteForm_1100(int64_t form_id) @@ -766,6 +879,8 @@ void FormAbilityDeleteForm::OnStart(const Want &want) FORM_EVENT_REQ_DELETE_FORM_0500, FORM_EVENT_REQ_DELETE_FORM_0600, FORM_EVENT_REQ_DELETE_FORM_0700, + FORM_EVENT_REQ_DELETE_FORM_0700_1, + FORM_EVENT_REQ_DELETE_FORM_0700_2, FORM_EVENT_REQ_DELETE_FORM_0800, FORM_EVENT_REQ_DELETE_FORM_0900, FORM_EVENT_REQ_DELETE_FORM_1000, @@ -785,7 +900,8 @@ void FormAbilityDeleteForm::OnStart(const Want &want) FORM_EVENT_REQ_DELETE_FORM_1702, FORM_EVENT_REQ_ACQUIRE_FORM_BATCH, FORM_EVENT_REQ_ACQUIRE_TEMP_FORM_BATCH, - FORM_EVENT_REQ_CLEAR_FORM_BATCH + FORM_EVENT_REQ_CLEAR_FORM_BATCH, + FORM_EVENT_REQ_DELETE_FORM_COMMON }; SubscribeEvent(eventList); } @@ -840,6 +956,8 @@ void FormAbilityDeleteForm::Init(const std::shared_ptr &abilityInfo memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0500] = &FormAbilityDeleteForm::FMS_deleteForm_0500; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0600] = &FormAbilityDeleteForm::FMS_deleteForm_0600; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0700] = &FormAbilityDeleteForm::FMS_deleteForm_0700; + memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0700_1] = &FormAbilityDeleteForm::FMS_deleteForm_0700_1; + memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0700_2] = &FormAbilityDeleteForm::FMS_deleteForm_0700_2; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0800] = &FormAbilityDeleteForm::FMS_deleteForm_0800; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0900] = &FormAbilityDeleteForm::FMS_deleteForm_0900; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_1000] = &FormAbilityDeleteForm::FMS_deleteForm_1000; @@ -860,6 +978,7 @@ void FormAbilityDeleteForm::Init(const std::shared_ptr &abilityInfo memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_BATCH] = &FormAbilityDeleteForm::FMS_acquireForm_batch; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_TEMP_FORM_BATCH] = &FormAbilityDeleteForm::FMS_acquire_tempForm_batch; memberFuncMap_[FORM_EVENT_REQ_CLEAR_FORM_BATCH] = &FormAbilityDeleteForm::FMS_deleteFormBatch; + memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_COMMON] = &FormAbilityDeleteForm::FMS_deleteFormCommon; } void FormAbilityDeleteForm::handleEvent(std::string action, std::string data) diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index 1d2cdb7044..ba51ab4327 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -97,9 +97,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0300(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_310, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_310, "false"); } } void FormAbilityReleaseForm::FMS_releaseForm_0400(std::string data) @@ -118,9 +119,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0400(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_410, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_410, "false"); } } @@ -153,9 +155,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0600(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_610, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_610, "false"); } } @@ -175,9 +178,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0700(std::string data) bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_710, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_710, "false"); } } @@ -197,9 +201,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0800(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810, "false"); } } void FormAbilityReleaseForm::FMS_releaseForm_0900(std::string data) @@ -218,9 +223,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0900(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_910, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_910, "false"); } } @@ -240,9 +246,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1000(std::string data) bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010, "false"); } } @@ -262,9 +269,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1100(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110, "false"); } } @@ -284,9 +292,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1200(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1210, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1210, "false"); } } @@ -306,9 +315,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1300(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310, "false"); } } @@ -328,9 +338,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1400(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("%{public}s AcquireForm ok.", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1410, "true"); } else { APP_LOGE("%{public}s AcquireForm error.", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1410, "false"); } } void FormAbilityReleaseForm::FMS_releaseForm_common_del(std::string data) @@ -476,27 +487,31 @@ void FormAbilityReleaseForm::ReleaseForm_1300(int64_t form_id, std::string lastF FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, std::to_string(form_id)); } else { bool isReleaseCache = true; - bool bResult1 = ReleaseForm(form_id, isReleaseCache); bool bResult2 = ReleaseForm(atoll(lastFormId.c_str()), isReleaseCache); - Clear("FMS_releaseForm_1300", form_id); - Clear("FMS_releaseForm_1300", atoll(lastFormId.c_str())); - if (bResult1 && bResult2) { + if (bResult2) { APP_LOGI("%{public}s ReleaseForm end", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, "true"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, std::to_string(atoll(lastFormId.c_str()))); } else { APP_LOGE("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, "false"); } + bool bResult1 = ReleaseForm(form_id, isReleaseCache); + if (bResult1) { + APP_LOGI("%{public}s ReleaseForm end", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301, std::to_string(form_id)); + } else { + APP_LOGE("%{public}s ReleaseForm error", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301, "false"); + } } } void FormAbilityReleaseForm::ReleaseForm_1400(int64_t form_id) { bool isReleaseCache = true; bool bResult = ReleaseForm(form_id, isReleaseCache); - Clear("FMS_releaseForm_1400", form_id); if (bResult) { APP_LOGI("%{public}s ReleaseForm end", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, "true"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, std::to_string(form_id)); } else { APP_LOGE("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, "false"); @@ -617,7 +632,8 @@ void FormEventSubscriberForReleaseForm::OnReceiveEvent(const CommonEventData &da if ((data.GetCode() == EVENT_CODE_1300 && data.GetData() == "") || eventName == FORM_EVENT_REQ_RELEASE_FORM_0700 || eventName == FORM_EVENT_REQ_RELEASE_FORM_0800 || eventName == FORM_EVENT_REQ_RELEASE_FORM_0900 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1000 || - eventName == FORM_EVENT_REQ_RELEASE_FORM_1100 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1200) { + eventName == FORM_EVENT_REQ_RELEASE_FORM_1100 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1200 || + eventName == FORM_EVENT_REQ_RELEASE_FORM_1300 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1400) { return; } else { CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp old mode 100644 new mode 100755 index 437923559a..1fcfb3c801 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp @@ -96,6 +96,7 @@ void FormAbilityB::FMS_acquireForm_1400(std::string data) bool bResult = AcquireForm(formId, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1400, EVENT_CODE_1400, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1400, EVENT_CODE_1400, "false"); @@ -119,9 +120,10 @@ void FormAbilityB::FMS_acquireForm_1500(std::string data) bool bResult = AcquireForm(formId, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1501, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1500, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1501, ""); } } @@ -142,9 +144,10 @@ void FormAbilityB::FMS_acquireForm_1800_2(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1822, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1820, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1822, ""); } } void FormAbilityB::FMS_acquireForm_1800_3(std::string data) @@ -181,6 +184,7 @@ void FormAbilityB::FMS_acquireForm_2400_1(std::string data) bool bResult = CastTempForm(formId); if (bResult) { APP_LOGI("CastTempForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400_1, EVENT_CODE_2410, "true"); } else { APP_LOGE("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400_1, EVENT_CODE_2410, "false"); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp old mode 100644 new mode 100755 index dad17b4b4b..1df3c77e6a --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp @@ -105,6 +105,7 @@ void FormAbilityC::FMS_acquireForm_3200(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3200, EVENT_CODE_3200, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3200, EVENT_CODE_3200, "false"); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp old mode 100644 new mode 100755 index ef06ae7609..3a43f0f3d3 --- a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp @@ -50,6 +50,7 @@ void FormAbilityNotSys::FMS_acquireForm_0100() bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0100, EVENT_CODE_100, "true"); } else { APP_LOGE("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0100, EVENT_CODE_100, "false"); @@ -62,6 +63,7 @@ void FormAbilityNotSys::FMS_deleteForm_0100() bool bResult = DeleteForm(formId); if (bResult) { APP_LOGI("[FMS_deleteForm_0100] end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0100, EVENT_CODE_100, "true"); } else { APP_LOGE("[FMS_deleteForm_0100] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0100, EVENT_CODE_100, "false"); @@ -75,6 +77,7 @@ void FormAbilityNotSys::FMS_releaseForm_0100() bool bResult = ReleaseForm(formId, isReleaseCache); if (bResult) { APP_LOGI("[FMS_releaseForm_0100] end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0100, EVENT_CODE_100, "true"); } else { APP_LOGE("[FMS_releaseForm_0100] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0100, EVENT_CODE_100, "false"); diff --git a/test/systemtest/BUILD.gn b/test/systemtest/BUILD.gn index 9865e4bf44..ad06723297 100755 --- a/test/systemtest/BUILD.gn +++ b/test/systemtest/BUILD.gn @@ -26,6 +26,7 @@ group("systemtest") { "common/ams:systemtest", "common/bms:systemtest_bms", "common/ems:systemtest_ems", + "common/fms:systemtest", "common/task_dispatcher:systemtest_task", ] } diff --git a/test/systemtest/common/fms/common/include/form_st_common_info.h b/test/systemtest/common/fms/common/include/form_st_common_info.h index 122acb5cb5..cf602448d6 100755 --- a/test/systemtest/common/fms/common/include/form_st_common_info.h +++ b/test/systemtest/common/fms/common/include/form_st_common_info.h @@ -54,6 +54,8 @@ const std::string FORM_EVENT_RECV_ACQUIRE_FORM_0100 = "fms_recv_acquireForm_0100 const std::string FORM_EVENT_REQ_ACQUIRE_FORM_0200 = "fms_req_acquireForm_0200"; const std::string FORM_EVENT_RECV_ACQUIRE_FORM_0200 = "fms_recv_acquireForm_0200"; const std::string FORM_EVENT_REQ_ACQUIRE_FORM_0300 = "fms_req_acquireForm_0300"; +const std::string FORM_EVENT_RECV_ACQUIRE_FORM_0300_1 = "fms_recv_acquireForm_0300_1"; +const std::string FORM_EVENT_REQ_ACQUIRE_FORM_0300_1 = "fms_req_acquireForm_0300_1"; const std::string FORM_EVENT_RECV_ACQUIRE_FORM_0300 = "fms_recv_acquireForm_0300"; const std::string FORM_EVENT_REQ_ACQUIRE_FORM_0400 = "fms_req_acquireForm_0400"; const std::string FORM_EVENT_RECV_ACQUIRE_FORM_0400 = "fms_recv_acquireForm_0400"; @@ -128,6 +130,12 @@ const std::string FORM_EVENT_REQ_ACQUIRE_FORM_3200 = "fms_req_acquireForm_3200"; const std::string FORM_EVENT_RECV_ACQUIRE_FORM_3200 = "fms_recv_acquireForm_3200"; const std::string FORM_EVENT_REQ_ACQUIRE_FORM_3300 = "fms_req_acquireForm_3300"; const std::string FORM_EVENT_RECV_ACQUIRE_FORM_3300 = "fms_recv_acquireForm_3300"; +const std::string FORM_EVENT_REQ_ACQUIRE_FORM_3700 = "fms_req_acquireForm_3700"; +const std::string FORM_EVENT_RECV_ACQUIRE_FORM_3700 = "fms_recv_acquireForm_3700"; +const std::string FORM_EVENT_REQ_ACQUIRE_FORM_3800 = "fms_req_acquireForm_3800"; +const std::string FORM_EVENT_RECV_ACQUIRE_FORM_3800 = "fms_recv_acquireForm_3800"; +const std::string FORM_EVENT_REQ_ACQUIRE_FORM_3800_1 = "fms_req_acquireForm_3800_1"; +const std::string FORM_EVENT_RECV_ACQUIRE_FORM_3800_1 = "fms_recv_acquireForm_3800_1"; const std::string FORM_EVENT_REQ_ACQUIRE_FORM_BATCH = "fms_req_acquireForm_batch"; const std::string FORM_EVENT_RECV_ACQUIRE_FORM_BATCH = "fms_recv_acquireForm_batch"; const std::string FORM_EVENT_REQ_ACQUIRE_FORM_BATCH_B = "fms_req_acquireForm_batch_b"; @@ -153,6 +161,12 @@ const std::string FORM_EVENT_REQ_DELETE_FORM_0600 = "fms_req_deleteForm_0600"; const std::string FORM_EVENT_RECV_DELETE_FORM_0600 = "fms_recv_deleteForm_0600"; const std::string FORM_EVENT_REQ_DELETE_FORM_0700 = "fms_req_deleteForm_0700"; const std::string FORM_EVENT_RECV_DELETE_FORM_0700 = "fms_recv_deleteForm_0700"; +const std::string FORM_EVENT_REQ_DELETE_FORM_0710 = "fms_req_deleteForm_0710"; +const std::string FORM_EVENT_RECV_DELETE_FORM_0710 = "fms_recv_deleteForm_0710"; +const std::string FORM_EVENT_REQ_DELETE_FORM_0700_1 = "fms_req_deleteForm_0700_1"; +const std::string FORM_EVENT_RECV_DELETE_FORM_0700_1 = "fms_recv_deleteForm_0700_1"; +const std::string FORM_EVENT_REQ_DELETE_FORM_0700_2 = "fms_req_deleteForm_0700_2"; +const std::string FORM_EVENT_RECV_DELETE_FORM_0700_2 = "fms_recv_deleteForm_0700_2"; const std::string FORM_EVENT_REQ_DELETE_FORM_0800 = "fms_req_deleteForm_0800"; const std::string FORM_EVENT_RECV_DELETE_FORM_0800 = "fms_recv_deleteForm_0800"; const std::string FORM_EVENT_REQ_DELETE_FORM_0900 = "fms_req_deleteForm_0900"; @@ -189,6 +203,8 @@ const std::string FORM_EVENT_REQ_DELETE_FORM_1702 = "fms_req_deleteForm_1702"; const std::string FORM_EVENT_RECV_DELETE_FORM_1702 = "fms_recv_deleteForm_1702"; // OnDelete const std::string COMMON_EVENT_ON_DELETE = "usual.event.ondelete"; +// OnUpdate +const std::string COMMON_EVENT_ON_UPDATE = "usual.event.onupdate"; typedef enum { FORM_EVENT_TRIGGER_RESULT_NG = 0, FORM_EVENT_TRIGGER_RESULT_OK = 1, @@ -279,6 +295,10 @@ const std::string FORM_EVENT_REQ_ONE_NORMAL_FORM = "fms_req_one_normal_form"; const std::string FORM_EVENT_RECV_ONE_NORMAL_FORM = "fms_recv_one_normal_form"; const std::string FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL = "fms_req_one_normal_form_del"; const std::string FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL = "fms_recv_one_normal_form_del"; +const std::string FORM_EVENT_REQ_ONE_NORMAL_FORM_001 = "fms_req_one_normal_form_001"; +const std::string FORM_EVENT_RECV_ONE_NORMAL_FORM_001 = "fms_recv_one_normal_form_001"; +const std::string FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL_001 = "fms_req_one_normal_form_del_001"; +const std::string FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001 = "fms_recv_one_normal_form_del_001"; // CommonB(acquire one normal form) const std::string FORM_EVENT_REQ_ONE_NORMAL_FORM_B = "fms_req_one_normal_form_b"; @@ -318,8 +338,99 @@ const std::string FORM_EVENT_RECV_SELF_STARTING_TEST_0200 = "fms_recv_selfStarti const std::string FORM_EVENT_REQ_SELF_STARTING_TEST_0300 = "fms_req_selfStartingTest_0300"; const std::string FORM_EVENT_RECV_SELF_STARTING_TEST_0300 = "fms_recv_selfStartingTest_0300"; +// Uninstall App Test +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0100 = "fms_req_uninstallTest_0100"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0100 = "fms_recv_uninstallTest_0100"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0200 = "fms_req_uninstallTest_0200"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0200 = "fms_recv_uninstallTest_0200"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0300 = "fms_req_uninstallTest_0300"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0300 = "fms_recv_uninstallTest_0300"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0400 = "fms_req_uninstallTest_0400"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0400 = "fms_recv_uninstallTest_0400"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0500 = "fms_req_uninstallTest_0500"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0500 = "fms_recv_uninstallTest_0500"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0600 = "fms_req_uninstallTest_0600"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0600 = "fms_recv_uninstallTest_0600"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0700 = "fms_req_uninstallTest_0700"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0700 = "fms_recv_uninstallTest_0700"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0800 = "fms_req_uninstallTest_0800"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0800 = "fms_recv_uninstallTest_0800"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_0900 = "fms_req_uninstallTest_0900"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_0900 = "fms_recv_uninstallTest_0900"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1000 = "fms_req_uninstallTest_1000"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1000 = "fms_recv_uninstallTest_1000"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1100 = "fms_req_uninstallTest_1100"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1100 = "fms_recv_uninstallTest_1100"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1200 = "fms_req_uninstallTest_1200"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1200 = "fms_recv_uninstallTest_1200"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1300 = "fms_req_uninstallTest_1300"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1300 = "fms_recv_uninstallTest_1300"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1400 = "fms_req_uninstallTest_1400"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1400 = "fms_recv_uninstallTest_1400"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1500 = "fms_req_uninstallTest_1500"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1500 = "fms_recv_uninstallTest_1500"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1600 = "fms_req_uninstallTest_1600"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1600 = "fms_recv_uninstallTest_1600"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1700 = "fms_req_uninstallTest_1700"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1700 = "fms_recv_uninstallTest_1700"; +const std::string FORM_EVENT_REQ_UNINSTALL_TEST_1800 = "fms_req_uninstallTest_1800"; +const std::string FORM_EVENT_RECV_UNINSTALL_TEST_1800 = "fms_recv_uninstallTest_1800"; + +// Host Refresh +const std::string FORM_EVENT_REQ_HOST_REFRESH_0100 = "fms_req_hostRefresh_0100"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0100 = "fms_recv_hostRefresh_0100"; +const std::string FORM_EVENT_REQ_HOST_REFRESH_0200 = "fms_req_hostRefresh_0200"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0200 = "fms_recv_hostRefresh_0200"; +const std::string FORM_EVENT_REQ_HOST_REFRESH_0300 = "fms_req_hostRefresh_0300"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0300 = "fms_recv_hostRefresh_0300"; +const std::string FORM_EVENT_REQ_HOST_REFRESH_0400 = "fms_req_hostRefresh_0400"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0400 = "fms_recv_hostRefresh_0400"; +const std::string FORM_EVENT_REQ_HOST_REFRESH_0500 = "fms_req_hostRefresh_0500"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0500 = "fms_recv_hostRefresh_0500"; +const std::string FORM_EVENT_REQ_HOST_REFRESH_0600 = "fms_req_hostRefresh_0600"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0600 = "fms_recv_hostRefresh_0600"; +const std::string FORM_EVENT_REQ_HOST_REFRESH_0700 = "fms_req_hostRefresh_0700"; +const std::string FORM_EVENT_RECV_HOST_REFRESH_0700 = "fms_recv_hostRefresh_0700"; + +// UpdateForm +const std::string FORM_EVENT_REQ_UPDATE_FORM_CREATE_COMMON = "fms_req_updateForm_create_common"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_CREATE_COMMON = "fms_recv_updateForm_create_common"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_CREATE_CATCH_FORM = "fms_req_updateForm_create_cache_form"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_CREATE_CATCH_FORM = "fms_recv_updateForm_create_cache_form"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_DELETE_COMMON = "fms_req_updateForm_delete_common"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_DELETE_COMMON = "fms_recv_updateForm_delete_common"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_NOTIFY_INVISIBLE = "fms_req_updateForm_notify_invisible"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_NOTIFY_INVISIBLE = "fms_recv_updateForm_notify_invisible"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_DISABLE_UPDATE = "fms_req_updateForm_disable_update"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_DISABLE_UPDATE = "fms_recv_updateForm_disable_update"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0100 = "fms_req_updateForm_0100"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0100 = "fms_recv_updateForm_0100"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0200 = "fms_req_updateForm_0200"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0200 = "fms_recv_updateForm_0200"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0300 = "fms_req_updateForm_0300"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0300 = "fms_recv_updateForm_0300"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0400 = "fms_req_updateForm_0400"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0400 = "fms_recv_updateForm_0400"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0500 = "fms_req_updateForm_0500"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0500 = "fms_recv_updateForm_0500"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0600 = "fms_req_updateForm_0600"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0600 = "fms_recv_updateForm_0600"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0700 = "fms_req_updateForm_0700"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0700 = "fms_recv_updateForm_0700"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0800 = "fms_req_updateForm_0800"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0800 = "fms_recv_updateForm_0800"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_0900 = "fms_req_updateForm_0900"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_0900 = "fms_recv_updateForm_0900"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_1000 = "fms_req_updateForm_1000"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_1000 = "fms_recv_updateForm_1000"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_1100 = "fms_req_updateForm_1100"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_1100 = "fms_recv_updateForm_1100"; +const std::string FORM_EVENT_REQ_UPDATE_FORM_1200 = "fms_req_updateForm_1200"; +const std::string FORM_EVENT_RECV_UPDATE_FORM_1200 = "fms_recv_updateForm_1200"; + // common event data code const int EVENT_CODE_100 = 100; +const int EVENT_CODE_110 = 110; const int EVENT_CODE_101 = 101; const int EVENT_CODE_102 = 102; const int EVENT_CODE_103 = 103; @@ -330,83 +441,123 @@ const int EVENT_CODE_203 = 203; const int EVENT_CODE_204 = 204; const int EVENT_CODE_205 = 205; const int EVENT_CODE_300 = 300; +const int EVENT_CODE_310 = 310; +const int EVENT_CODE_300_1 = 301; const int EVENT_CODE_301 = 301; const int EVENT_CODE_302 = 302; const int EVENT_CODE_303 = 303; const int EVENT_CODE_304 = 304; const int EVENT_CODE_400 = 400; +const int EVENT_CODE_410 = 410; const int EVENT_CODE_401 = 401; const int EVENT_CODE_402 = 402; const int EVENT_CODE_500 = 500; const int EVENT_CODE_501 = 501; const int EVENT_CODE_502 = 502; const int EVENT_CODE_600 = 600; +const int EVENT_CODE_610 = 610; const int EVENT_CODE_700 = 700; +const int EVENT_CODE_710 = 710; +const int EVENT_CODE_700_1 = 701; +const int EVENT_CODE_710_1 = 711; +const int EVENT_CODE_700_2 = 702; +const int EVENT_CODE_710_2 = 712; const int EVENT_CODE_800 = 800; +const int EVENT_CODE_810 = 810; const int EVENT_CODE_900 = 900; +const int EVENT_CODE_910 = 910; const int EVENT_CODE_999 = 999; const int EVENT_CODE_1000 = 1000; +const int EVENT_CODE_1010 = 1010; const int EVENT_CODE_1100 = 1100; +const int EVENT_CODE_1110 = 1110; const int EVENT_CODE_1101 = 1101; const int EVENT_CODE_1102 = 1102; const int EVENT_CODE_1103 = 1103; const int EVENT_CODE_1104 = 1104; const int EVENT_CODE_1105 = 1105; +const int EVENT_CODE_1106 = 1106; const int EVENT_CODE_1200 = 1200; +const int EVENT_CODE_1210 = 1210; const int EVENT_CODE_1201 = 1201; +const int EVENT_CODE_1202 = 1202; const int EVENT_CODE_1234 = 1234; const int EVENT_CODE_1300 = 1300; +const int EVENT_CODE_1310 = 1310; const int EVENT_CODE_1301 = 1301; const int EVENT_CODE_1302 = 1302; const int EVENT_CODE_1303 = 1303; const int EVENT_CODE_1304 = 1304; const int EVENT_CODE_1305 = 1305; const int EVENT_CODE_1400 = 1400; +const int EVENT_CODE_1410 = 1410; const int EVENT_CODE_1401 = 1401; const int EVENT_CODE_1500 = 1500; +const int EVENT_CODE_1501 = 1501; +const int EVENT_CODE_1500_1 = 15001; const int EVENT_CODE_1510 = 1510; +const int EVENT_CODE_1510_1 = 15101; const int EVENT_CODE_1511 = 1511; +const int EVENT_CODE_1512 = 1512; const int EVENT_CODE_1600 = 1600; +const int EVENT_CODE_1600_1 = 16001; const int EVENT_CODE_1601 = 1601; +const int EVENT_CODE_1602 = 1602; const int EVENT_CODE_1610 = 1610; +const int EVENT_CODE_1610_1 = 16101; const int EVENT_CODE_1611 = 1611; +const int EVENT_CODE_1612 = 1612; const int EVENT_CODE_1700 = 1700; +const int EVENT_CODE_1710 = 1710; const int EVENT_CODE_1701 = 1701; +const int EVENT_CODE_1711 = 1711; const int EVENT_CODE_1702 = 1702; const int EVENT_CODE_1800 = 1800; const int EVENT_CODE_1801 = 1801; const int EVENT_CODE_1802 = 1802; +const int EVENT_CODE_1803 = 1803; const int EVENT_CODE_1810 = 1810; const int EVENT_CODE_1811 = 1811; +const int EVENT_CODE_1812 = 1812; const int EVENT_CODE_1820 = 1820; const int EVENT_CODE_1821 = 1821; +const int EVENT_CODE_1822 = 1822; const int EVENT_CODE_1830 = 1830; const int EVENT_CODE_1831 = 1831; const int EVENT_CODE_1900 = 1900; const int EVENT_CODE_1901 = 1901; +const int EVENT_CODE_1902 = 1902; const int EVENT_CODE_2000 = 2000; const int EVENT_CODE_2100 = 2100; const int EVENT_CODE_2200 = 2200; const int EVENT_CODE_2300 = 2300; const int EVENT_CODE_2400 = 2400; const int EVENT_CODE_2401 = 2401; +const int EVENT_CODE_2402 = 2402; const int EVENT_CODE_2410 = 2410; const int EVENT_CODE_2500 = 2500; const int EVENT_CODE_2600 = 2600; const int EVENT_CODE_2610 = 2610; const int EVENT_CODE_2611 = 2611; +const int EVENT_CODE_2612 = 2612; const int EVENT_CODE_2700 = 2700; const int EVENT_CODE_2800 = 2800; const int EVENT_CODE_2900 = 2900; const int EVENT_CODE_2901 = 2901; +const int EVENT_CODE_2902 = 2902; const int EVENT_CODE_2910 = 2910; const int EVENT_CODE_2911 = 2911; const int EVENT_CODE_3000 = 3000; const int EVENT_CODE_3100 = 3100; const int EVENT_CODE_3101 = 3101; +const int EVENT_CODE_3102 = 3102; const int EVENT_CODE_3200 = 3200; const int EVENT_CODE_3300 = 3300; const int EVENT_CODE_3301 = 3301; +const int EVENT_CODE_3700 = 3700; +const int EVENT_CODE_3800 = 3800; +const int EVENT_CODE_3801 = 3801; +const int EVENT_CODE_3802 = 3802; const int EVENT_CODE_BATCH = 9000; const int EVENT_CODE_BATCH_B = 9010; @@ -417,4 +568,4 @@ const int EVENT_CODE_TEMP = 9900; const int EVENT_CODE_TEMP_1 = 9901; } // namespace AppExecFwk } // namespace OHOS -#endif // FORM_ST_COMMON_INFO_H \ No newline at end of file +#endif // FORM_ST_COMMON_INFO_H diff --git a/test/systemtest/common/fms/common/include/system_test_form_util.h b/test/systemtest/common/fms/common/include/system_test_form_util.h old mode 100644 new mode 100755 index 2e4f801581..0a55a8ffdd --- a/test/systemtest/common/fms/common/include/system_test_form_util.h +++ b/test/systemtest/common/fms/common/include/system_test_form_util.h @@ -320,6 +320,21 @@ public: * @return Returns forms count to delete. */ static int ClearFormRecords(); + /** + * @brief Add forms to storage for st . + * @return Returns add result. + */ + static int DistributedDataAddForm(const AAFwk::Want &want); + /** + * @brief Delete form form storage for st. + * @return Returns delete result. + */ + static int DistributedDataDeleteForm(const std::string formId); + /** + * @brief Get form manager service. + * @return Returns form manager servic remoteObject. + */ + static sptr GetFmsService(); private: /** * diff --git a/test/systemtest/common/fms/common/src/system_test_form_util.cpp b/test/systemtest/common/fms/common/src/system_test_form_util.cpp index 4176c7a728..b2809defd5 100755 --- a/test/systemtest/common/fms/common/src/system_test_form_util.cpp +++ b/test/systemtest/common/fms/common/src/system_test_form_util.cpp @@ -682,5 +682,78 @@ sptr SystemTestFormUtil::GetFmsService() std::cout << "SendTransactCmd end." << std::endl; return remoteObject; } + +/** +* @brief Add forms to storage for st . +* @return Returns add result. +*/ +int SystemTestFormUtil::DistributedDataAddForm(const AAFwk::Want &want) +{ + sptr remoteObject = GetFmsService(); + if (!remoteObject) { + std::cout << "SendTransactCmd, failed to get remote object." << std::endl; + return ERR_APPEXECFWK_SERVICE_NOT_CONNECTED; + } + + MessageParcel data; + if (!WriteInterfaceToken(data)) { + std::cout << "DistributedDataAddForm, failed to write interface token." << std::endl; + return ERR_APPEXECFWK_PARCEL_ERROR; + } + if (!data.WriteParcelable(&want)) { + std::cout << "DistributedDataAddForm, failed to write want." << std::endl; + return ERR_APPEXECFWK_PARCEL_ERROR; + } + + MessageParcel reply; + MessageOption option; + int error = remoteObject->SendRequest( + static_cast(IFormMgr::Message::FORM_MGR_DISTRIBUTED_DATA_ADD_FORM__ST), + data, + reply, + option); + if (error != ERR_OK) { + std::cout << "DistributedDataAddForm, failed to SendRequest." << std::endl; + return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; + } + return reply.ReadInt32(); +} + +/** +* @brief Delete form form storage for st. +* @return Returns delete result. +*/ +int SystemTestFormUtil::DistributedDataDeleteForm(const std::string formId) +{ + sptr remoteObject = GetFmsService(); + if (!remoteObject) { + std::cout << "SendTransactCmd, failed to get remote object." << std::endl; + return ERR_APPEXECFWK_SERVICE_NOT_CONNECTED; + } + + MessageParcel data; + if (!WriteInterfaceToken(data)) { + std::cout << "DistributedDataAddForm, failed to write interface token." << std::endl; + return ERR_APPEXECFWK_PARCEL_ERROR; + } + if (!data.WriteString(formId)) { + std::cout << "DistributedDataAddForm, failed to write formId." << std::endl; + return ERR_APPEXECFWK_PARCEL_ERROR; + } + + MessageParcel reply; + MessageOption option; + int error = remoteObject->SendRequest( + static_cast(IFormMgr::Message::FORM_MGR_DISTRIBUTED_DATA_DELETE_FORM__ST), + data, + reply, + option); + if (error != ERR_OK) { + std::cout << "DistributedDataAddForm, failed to SendRequest." << std::endl; + return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; + } + return reply.ReadInt32(); +} + } // namespace STtools } // namespace OHOS \ No newline at end of file diff --git a/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn b/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn old mode 100644 new mode 100755 index 3437550f9f..1a1d1cf69c --- a/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn @@ -20,6 +20,7 @@ ohos_systemtest("FmsAcquireFormTest") { module_out_path = module_output_path include_dirs = [ "${aafwk_path}/interfaces/innerkits/ability_manager/include", + "${appexecfwk_path}/interfaces/innerkits/fmskit/native/include", "${appexecfwk_path}/test/systemtest/common/fms/common/include", "//base/notification/ces_standard/test/systemtest/common/resource", "//foundation/distributedschedule/safwk/services/safwk/include", @@ -45,6 +46,7 @@ ohos_systemtest("FmsAcquireFormTest") { "${aafwk_path}/frameworks/kits/ability/native:abilitykit_native", "${aafwk_path}/services/abilitymgr:abilityms", "${appexecfwk_path}/common:libappexecfwk_common", + "${appexecfwk_path}/interfaces/innerkits/fmskit:fmskit_native", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", "//third_party/googletest:gtest_main", diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp old mode 100644 new mode 100755 index a623fd2547..46aea62fb3 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -27,6 +27,7 @@ #include "common_event_manager.h" #include "context_deal.h" #include "form_event.h" +#include "form_host_client.h" #include "form_st_common_info.h" #include "iservice_registry.h" #include "nlohmann/json.hpp" @@ -87,9 +88,12 @@ public: void FmsAcquireForm1800A(); void FmsAcquireForm1800B(); void FmsAcquireForm1800C(); + void BeforeAcquireForm2100(); std::string FmsAcquireForm2400(); void FmsAcquireForm2400_1(std::string strFormId); void FmsAcquireFormDeleteA(std::string strFormId); + void FMS_deleteFormBatch(); + bool CompareForm(std::string formInfo); }; std::vector FmsAcquireFormTest::eventList = { @@ -103,7 +107,8 @@ std::vector FmsAcquireFormTest::eventList = { FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, FORM_EVENT_RECV_ACQUIRE_FORM_1900, FORM_EVENT_RECV_ACQUIRE_FORM_2100, FORM_EVENT_RECV_ACQUIRE_FORM_2200, FORM_EVENT_RECV_ACQUIRE_FORM_2300, FORM_EVENT_RECV_ACQUIRE_FORM_2500, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, FORM_EVENT_RECV_ACQUIRE_FORM_2600, FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, - FORM_EVENT_RECV_ACQUIRE_FORM_2400, FORM_EVENT_RECV_ACQUIRE_FORM_2400_1, + FORM_EVENT_RECV_ACQUIRE_FORM_2400, FORM_EVENT_RECV_ACQUIRE_FORM_2400_1, FORM_EVENT_RECV_CLEAR_FORM_BATCH, + FORM_EVENT_RECV_ACQUIRE_FORM_0300_1, FORM_EVENT_RECV_ACQUIRE_FORM_3800, FORM_EVENT_RECV_ACQUIRE_FORM_3800_1 }; @@ -160,7 +165,7 @@ bool FmsAcquireFormTest::SubscribeEvent() */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_1100" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -171,6 +176,11 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1100; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1100, EVENT_CODE_1100, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1106)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1106); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100); bool result = !strFormId.empty(); @@ -196,6 +206,13 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level std::string cachedData = SystemTestFormUtil::QueryFormInfoByFormId(formId); GTEST_LOG_(INFO) << "FMS_acquireForm_1100, cachedData:" << cachedData; + EXPECT_TRUE(CompareForm(cachedData)); + + int errorCode = STtools::SystemTestFormUtil::DistributedDataDeleteForm(std::to_string(formId)); + if (errorCode != 0) { + GTEST_LOG_(INFO) << "delete form failed, formId:" << formId << ", errorCode:" << errorCode; + } + std::cout << "END FMS_acquireForm_1100" << std::endl; } /** @@ -205,7 +222,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1200, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_1200" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -216,6 +233,11 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1200, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1200; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1200, EVENT_CODE_1200, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1202)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1202); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1200)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1200); bool result = !strFormId.empty(); @@ -246,7 +268,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1200, Function | MediumTest | Level bool result3 = data3 == "true"; EXPECT_TRUE(result3); GTEST_LOG_(INFO) << "FMS_acquireForm_1200, delete form, result:" << result3; - + std::cout << "END FMS_acquireForm_1200" << std::endl; } @@ -257,7 +279,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1200, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_1500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -269,6 +291,10 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1500_1; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1500_1, EVENT_CODE_1510, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510); bool result = !strFormId.empty(); EXPECT_TRUE(result); @@ -288,11 +314,11 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level } GTEST_LOG_(INFO) << "FMS_acquireForm_1500, add no catch form end"; + FMS_deleteFormBatch(); + sleep(1); FmsAcquireFormCatched1500(strFormId); - - sleep(1); - FmsAcquireFormDeleteA(strFormId); + std::cout << "END FMS_acquireForm_1500" << std::endl; } @@ -304,15 +330,15 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1600, Function | MediumTest | Level1) { - sleep(1); + sleep(3); int normalCount = 0; int tempCount = 0; - for (int iCount = 0; iCount < 2; iCount++) { - sleep(1); + for (int iCount = 0; iCount < 5; iCount++) { + sleep(7); FmsAcquireForm1600(); normalCount++; std::cout << "END FMS_acquireForm_1600, normal form end, count:" << normalCount << std::endl; - sleep(1); + sleep(7); FmsAcquireForm1600A(); tempCount++; std::cout << "END FMS_acquireForm_1600_1, temp form end, count:" << tempCount << std::endl; @@ -326,13 +352,13 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1600, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1800, Function | MediumTest | Level1) { - sleep(1); + sleep(7); FmsAcquireForm1800(); - sleep(1); + sleep(7); FmsAcquireForm1800A(); - sleep(1); + sleep(7); FmsAcquireForm1800B(); - sleep(1); + sleep(7); FmsAcquireForm1800C(); } @@ -343,7 +369,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1800, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1900, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_1900" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -354,6 +380,10 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1900, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1900; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1900, EVENT_CODE_1900, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1902)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1902); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1900)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1900); bool result = !strFormId.empty(); @@ -393,11 +423,11 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1900, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2400, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::string strFormId = FmsAcquireForm2400(); - sleep(1); + sleep(3); FmsAcquireForm2400_1(strFormId); - sleep(1); + sleep(3); FmsAcquireFormDeleteA(strFormId); } @@ -411,7 +441,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2400, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2600, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2600" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -421,6 +451,10 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2600, Function | MediumTest | Level EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_2600_1; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2600_1, EVENT_CODE_2610, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2612)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2612); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2610)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2610); bool result = !strFormId.empty(); @@ -464,7 +498,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2600, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0100, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0100" << std::endl; std::string bundleName = "com.ohos.form.manager.notsystemapp"; @@ -492,7 +526,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0100, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0200, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0200" << std::endl; std::string bundleName = "com.ohos.form.manager.nopermission"; @@ -520,7 +554,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0200, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -540,6 +574,34 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300, Function | MediumTest | Level std::cout << "END FMS_acquireForm_0300" << std::endl; } +/** + * @tc.number: FMS_acquireForm_0300_1 + * @tc.name: Failed to add form when parameter formId is wrong. + * @tc.desc: Failed to create form when verifying that the parameter (formId) of creating form is wrong. + */ +HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300_1, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "START FMS_acquireForm_0300_1" << std::endl; + + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityMs); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_0300_1; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_0300_1, EVENT_CODE_300_1, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_0300_1, EVENT_CODE_300_1)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_0300_1, EVENT_CODE_300_1); + bool result = data == "false"; + EXPECT_TRUE(result); + + GTEST_LOG_(INFO) << "FMS_acquireForm_0300_1, result:" << result; + std::cout << "END FMS_acquireForm_0300_1" << std::endl; +} + /** * @tc.number: FMS_acquireForm_0400 * @tc.name: Failed to add form when parameter bundlename is wrong. @@ -547,7 +609,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0400, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0400" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -574,7 +636,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0400, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0500, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -601,7 +663,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0500, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0600, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0600" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -629,7 +691,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0600, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0700, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_0700" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -657,7 +719,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0700, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1000, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_1000" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -684,7 +746,8 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1000, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1400, Function | MediumTest | Level1) { - sleep(1); + BeforeAcquireForm2100(); + sleep(3); std::cout << "START FMS_acquireForm_1400" << std::endl; std::string bundleName = "com.ohos.form.manager.normalb"; std::string abilityName = "FormAbilityB"; @@ -712,7 +775,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1400, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2100, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2100" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -724,12 +787,13 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2100, Function | MediumTest | Level std::string eventData = catchFormId; GTEST_LOG_(INFO) << "FMS_acquireForm_2100, formId:" << eventData; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2100, EVENT_CODE_2100, eventData); + sleep(7); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100); bool result = data == "false"; EXPECT_TRUE(result); GTEST_LOG_(INFO) << "FMS_acquireForm_2100, result:" << result; - sleep(1); + sleep(3); FmsAcquireFormDeleteA(catchFormId); std::cout << "END FMS_acquireForm_2100" << std::endl; } @@ -741,7 +805,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2100, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2200, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2200" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -768,7 +832,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2200, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2300, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -795,7 +859,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2300, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2500, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -815,6 +879,58 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2500, Function | MediumTest | Level std::cout << "END FMS_acquireForm_2500" << std::endl; } +/** + * @tc.number: FMS_acquireForm_3800 + * @tc.name: check the same host can't add the same form id twice. + * @tc.desc:the value of second add form is failed. + */ +HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_3800, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "START FMS_acquireForm_3800" << std::endl; + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityMs); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3800; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3800, EVENT_CODE_3800, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3800 + 1)); + std::string formIdStr = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3800 + 1); + bool result = (formIdStr != "false" && formIdStr != ""); + EXPECT_TRUE(result); + GTEST_LOG_(INFO) << "FMS_acquireForm_3800 first add form, result:" << result << ", formId:" << formIdStr; + + std::string eventData2 = FORM_EVENT_REQ_ACQUIRE_FORM_3800_1; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3800_1, EVENT_CODE_3801, eventData2); + + // Check host client contains this form + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3800 + 2)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800_1, EVENT_CODE_3801)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800_1, EVENT_CODE_3801); + result = data == "false"; + EXPECT_TRUE(result); + GTEST_LOG_(INFO) << "FMS_acquireForm_3800 second add form, result:" << result; + + // wait delete form + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_acquireForm_3800, delete form, result:" << result2; + } + + std::cout << "END FMS_acquireForm_3800" << std::endl; +} + void FmsAcquireFormTest::FmsAcquireFormCatched1500(std::string strFormId) { std::string bundleName1 = "com.ohos.form.manager.normalb"; @@ -828,6 +944,11 @@ void FmsAcquireFormTest::FmsAcquireFormCatched1500(std::string strFormId) std::string eventData2 = strFormId; GTEST_LOG_(INFO) << "FMS_acquireForm_1500, formId:" << eventData2; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1500, EVENT_CODE_1500, eventData2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1501)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1501); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1500)); std::string strFormId2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1500); bool result3 = !strFormId2.empty(); @@ -839,6 +960,13 @@ void FmsAcquireFormTest::FmsAcquireFormCatched1500(std::string strFormId) } GTEST_LOG_(INFO) << "FMS_acquireForm_1500, add catched form end"; + + int64_t formId = std::stoll(strFormId2); + std::string cachedData = SystemTestFormUtil::QueryFormInfoByFormId(formId); + GTEST_LOG_(INFO) << "FMS_acquireForm_1100, cachedData:" << cachedData; + + EXPECT_TRUE(CompareForm(cachedData)); + // wait delete form EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data5 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); @@ -859,6 +987,11 @@ void FmsAcquireFormTest::FmsAcquireForm1600() std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1600; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1600, EVENT_CODE_1600, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1602)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1602); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1600)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1600); bool result = !strFormId.empty(); @@ -869,6 +1002,7 @@ void FmsAcquireFormTest::FmsAcquireForm1600() GTEST_LOG_(INFO) << "FMS_acquireForm_1600, formId:" << strFormId; } + sleep(7); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1601)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1601); bool result2 = !data2.empty(); @@ -900,6 +1034,11 @@ void FmsAcquireFormTest::FmsAcquireForm1600A() std::string eventData1 = FORM_EVENT_REQ_ACQUIRE_FORM_1600_1; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1600_1, EVENT_CODE_1610, eventData1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1612)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1612); + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1610)); std::string strFormId1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1610); bool result4 = !strFormId1.empty(); @@ -910,6 +1049,7 @@ void FmsAcquireFormTest::FmsAcquireForm1600A() GTEST_LOG_(INFO) << "FMS_acquireForm_1600_1 formId:" << strFormId1; } + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1611)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1611); bool result5 = !data4.empty(); @@ -942,6 +1082,10 @@ void FmsAcquireFormTest::FmsAcquireForm1800() std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1800; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1800, EVENT_CODE_1800, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1803)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1803); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1800)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1800); bool result = !strFormId.empty(); @@ -952,6 +1096,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800() GTEST_LOG_(INFO) << "FMS_acquireForm_1800, formId:" << strFormId; } + sleep(7); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1801)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1801); bool result2 = !data2.empty(); @@ -988,6 +1133,10 @@ void FmsAcquireFormTest::FmsAcquireForm1800A() std::string eventData1 = FORM_EVENT_REQ_ACQUIRE_FORM_1800_1; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1800_1, EVENT_CODE_1810, eventData1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1812)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1812); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1810)); std::string strFormId1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1810); bool result4 = !strFormId1.empty(); @@ -998,6 +1147,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800A() GTEST_LOG_(INFO) << "FMS_acquireForm_1800_1 formId:" << strFormId1; } + sleep(7); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1811)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1811); bool result5 = !data4.empty(); @@ -1033,6 +1183,10 @@ void FmsAcquireFormTest::FmsAcquireForm1800B() std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1800_2; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1800_2, EVENT_CODE_1820, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1822)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1822); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1820)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1820); bool result = !strFormId.empty(); @@ -1043,6 +1197,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800B() GTEST_LOG_(INFO) << "FMS_acquireForm_1800_2, formId:" << strFormId; } + sleep(7); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1821)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1821); bool result2 = !data2.empty(); @@ -1089,6 +1244,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800C() GTEST_LOG_(INFO) << "FMS_acquireForm_1800_3 formId:" << strFormId1; } + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, EVENT_CODE_1831)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, EVENT_CODE_1831); bool result5 = !data4.empty(); @@ -1110,6 +1266,41 @@ void FmsAcquireFormTest::FmsAcquireForm1800C() std::cout << "END FMS_acquireForm_1800_3, temp form end, count:" << tempCount << std::endl; } +void FmsAcquireFormTest::BeforeAcquireForm2100() +{ + sleep(3); + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityMs); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1100; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1100, EVENT_CODE_1100, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100)); + std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100); + bool result = !strFormId.empty(); + EXPECT_TRUE(result); + if (!result) { + GTEST_LOG_(INFO) << "FMS_acquireForm_1100, result:" << result; + } else { + GTEST_LOG_(INFO) << "FMS_acquireForm_1100, formId:" << strFormId; + } + + catchFormId = strFormId; + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1101)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1101); + bool result2 = !data2.empty(); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_acquireForm_1100, result:" << result2; + } else { + GTEST_LOG_(INFO) << "FMS_acquireForm_1100, formData:" << data2; + } +} + std::string FmsAcquireFormTest::FmsAcquireForm2400() { int normalCount = 0; @@ -1125,6 +1316,10 @@ std::string FmsAcquireFormTest::FmsAcquireForm2400() std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_2400; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2400, EVENT_CODE_2400, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2402)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2402); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2400)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2400); bool result = !strFormId.empty(); @@ -1135,6 +1330,7 @@ std::string FmsAcquireFormTest::FmsAcquireForm2400() GTEST_LOG_(INFO) << "FMS_acquireForm_2400, formId:" << strFormId; } + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2401)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2401); bool result2 = !data2.empty(); @@ -1187,6 +1383,7 @@ void FmsAcquireFormTest::FmsAcquireFormDeleteA(std::string strFormId) std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form + sleep(7); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -1195,5 +1392,47 @@ void FmsAcquireFormTest::FmsAcquireFormDeleteA(std::string strFormId) std::cout << "END FmsAcquireFormDeleteA end" << std::endl; } + +void FmsAcquireFormTest::FMS_deleteFormBatch() +{ + std::cout << "START FMS_deleteFormBatch, delete form cache" << std::endl; + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityMs); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + std::string eventData = FORM_EVENT_REQ_CLEAR_FORM_BATCH; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_CLEAR_FORM_BATCH, EVENT_CODE_TEMP, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH); + bool result = data == "true"; + EXPECT_TRUE(result); + GTEST_LOG_(INFO) << "FMS_deleteFormBatch, result:" << result; + + std::cout << "END FMS_deleteFormBatch, delete form cache" << std::endl; +} +bool FmsAcquireFormTest::CompareForm(std::string formInfo) +{ + bool compare = true; + + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + } + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + } + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + } + pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + } + return compare; +} } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp index 0e8a711b45..526285982d 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp @@ -96,7 +96,7 @@ public: std::string FmsAcquireForm3100(const std::string &bundleName, const std::string &abilityName); void FmsAcquireForm2800(std::string strFormId); void FmsAcquireForm3200(); - + void FmsAcquireForm3700(); void FmsAcquireFormDeleteA(const std::string &strFormId); void FmsAcquireFormDeleteB(const std::string &strFormId); void FmsAcquireFormDeleteC(const std::string &strFormId); @@ -114,7 +114,7 @@ std::vector FmsAcquireFormTestBatch::eventList = { FORM_EVENT_RECV_ACQUIRE_FORM_2700, FORM_EVENT_RECV_ACQUIRE_FORM_2800, FORM_EVENT_RECV_ACQUIRE_FORM_2900, FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, FORM_EVENT_RECV_ACQUIRE_FORM_3000, FORM_EVENT_RECV_ACQUIRE_FORM_3100, FORM_EVENT_RECV_ACQUIRE_FORM_3200, FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, FORM_EVENT_RECV_ACQUIRE_FORM_BATCH_B, - FORM_EVENT_RECV_CLEAR_FORM_BATCH, FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, + FORM_EVENT_RECV_CLEAR_FORM_BATCH, FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, FORM_EVENT_RECV_ACQUIRE_FORM_3700, }; @@ -171,19 +171,20 @@ bool FmsAcquireFormTestBatch::SubscribeEvent() */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2900, Function | MediumTest | Level1) { + sleep(3); std::cout << "START FMS_acquireForm_2900" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; int countA = Constants::MAX_RECORD_PER_APP/2; int countB = Constants::MAX_RECORD_PER_APP/2 - 1; - sleep(1); + sleep(3); FMS_acquireFormBatchA(bundleName, abilityName, countA); - sleep(1); + sleep(3); FMS_acquireFormBatchB(bundleName, abilityName, countB); int count = Constants::MAX_RECORD_PER_APP - 1; std::cout << "FMS_acquireForm_2900, form size of the host A:" << count << std::endl; - sleep(1); + sleep(3); std::string strFormId = FmsAcquireForm2900A(); normalFormsMaxA.emplace_back(strFormId); std::cout << "END FMS_acquireForm_2900" << std::endl; @@ -195,7 +196,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2900, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3000, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_3000" << std::endl; std::cout << "FMS_acquireForm_3000, form size of the host A:" << normalFormsMaxA.size() << std::endl; FmsAcquireForm3000(); @@ -211,24 +212,25 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3000, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2700, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2700" << std::endl; std::cout << "FMS_acquireForm_2700, form size of the host A:" << normalFormsMaxA.size() << std::endl; std::string bundleNameA = "com.ohos.form.manager.normal"; std::string abilityNameA = "FormAbilityA"; std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - sleep(1); + sleep(3); FmsAcquireForm2700(strFormId); std::cout << "END FMS_acquireForm_2700" << std::endl; std::cout << "the host A, delete form start" << std::endl; + if (normalFormsMaxA.size() > 0) { - for (int count = 0; count < normalFormsMaxA.size(); count++) { + for (unsigned int count = 0; count < normalFormsMaxA.size(); count++) { FmsAcquireFormDeleteA(normalFormsMaxA[count]); } } - sleep(1); + sleep(3); FMS_deleteFormBatch(); std::cout << "the host A, delete form end" << std::endl; } @@ -240,7 +242,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2700, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_3100" << std::endl; std::cout << "START add form to the host A" << std::endl; @@ -252,7 +254,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | std::cout << "count:" << FORM_COUNT_200 << std::endl; std::cout << "END add form to the host A" << std::endl; - sleep(1); + sleep(3); std::cout << "START add form to the host B" << std::endl; std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; @@ -262,7 +264,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | std::cout << "count:" << FORM_COUNT_200 << std::endl; std::cout << "END add form to the host B" << std::endl; - sleep(1); + sleep(3); std::cout << "START add form to the host C" << std::endl; std::string bundleNameC = "com.ohos.form.manager.normalc"; std::string abilityNameC = "FormAbilityC"; @@ -272,7 +274,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | std::cout << "count:" << FORM_COUNT_111 << std::endl; std::cout << "END add form to the host C" << std::endl; - sleep(1); + sleep(3); std::string formId = FmsAcquireForm3100(bundleNameC, abilityNameC); normalFormsMaxC.emplace_back(formId); std::cout << "END FMS_acquireForm_3100" << std::endl; @@ -287,7 +289,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2800, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_2800" << std::endl; std::cout << "FMS_acquireForm_2800, form size of the host A:" << FORM_COUNT_200 << std::endl; std::cout << "FMS_acquireForm_2800, form size of the host B:" << FORM_COUNT_200 << std::endl; @@ -297,7 +299,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2800, Function | MediumTest | std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - sleep(1); + sleep(3); FmsAcquireForm2800(strFormId); std::cout << "END FMS_acquireForm_2800" << std::endl; @@ -311,7 +313,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2800, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3200, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_3200" << std::endl; std::cout << "FMS_acquireForm_3200, form size of the host A:" << FORM_COUNT_200 << std::endl; std::cout << "FMS_acquireForm_3200, form size of the host B:" << FORM_COUNT_200 << std::endl; @@ -322,11 +324,11 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3200, Function | MediumTest | std::cout << "dlete form start" << std::endl; if (normalFormsMaxC.size() > 0) { for (int count = 0; count < normalFormsMaxC.size(); count++) { - sleep(1); + sleep(3); FmsAcquireFormDeleteC(normalFormsMaxC[count]); } } - sleep(1); + sleep(3); FMS_deleteFormBatch(); std::cout << "dlete form end" << std::endl; } @@ -337,7 +339,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3200, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3300, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_3300" << std::endl; std::cout << "START add temp form to the host A" << std::endl; @@ -348,16 +350,16 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3300, Function | MediumTest | FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_256 - 1); std::cout << "FMS_acquireForm_3300, temp form size of the host A:" << (TEMP_FORM_COUNT_256 - 1)<< std::endl; - sleep(1); + sleep(3); std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); std::cout << "FMS_acquireForm_3300, temp form size of the host A:" << TEMP_FORM_COUNT_256 << std::endl; std::cout << "END add temp form to the host A" << std::endl; std::cout << "END FMS_acquireForm_3300" << std::endl; - sleep(1); + sleep(3); std::cout << "the host A, dlete temp form start" << std::endl; FmsAcquireFormDeleteA(strFormId); - sleep(1); + sleep(3); FMS_deleteFormBatch(); std::cout << "the host A, dlete temp form end" << std::endl; } @@ -368,7 +370,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3300, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_3400" << std::endl; std::cout << "START add temp form to the host A" << std::endl; @@ -380,7 +382,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | std::cout << "FMS_acquireForm_3400, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host A" << std::endl; - sleep(1); + sleep(3); std::cout << "START add temp form to the host B" << std::endl; std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; @@ -388,15 +390,15 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | std::cout << "abilityName: " << abilityNameB << std::endl; FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128 - 1); std::cout << "FMS_acquireForm_3400, temp form size:" << (TEMP_FORM_COUNT_128 - 1) << std::endl; - sleep(1); + sleep(3); std::string strFormId = FmsAcquireFormTemp(bundleNameB, abilityNameB); std::cout << "FMS_acquireForm_3400, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host B" << std::endl; - sleep(1); + sleep(3); std::cout << "FMS_acquireForm_3400, dlete temp form start" << std::endl; FmsAcquireFormDeleteB(strFormId); - sleep(1); + sleep(3); FMS_deleteFormBatch(); std::cout << "FMS_acquireForm_3400, dlete temp form end" << std::endl; @@ -410,7 +412,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | Level1) { - sleep(1); + sleep(3); std::cout << "START FMS_acquireForm_3500" << std::endl; std::cout << "START add temp form to the host A" << std::endl; std::string bundleNameA = "com.ohos.form.manager.normal"; @@ -420,7 +422,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3500, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host A" << std::endl; - sleep(1); + sleep(3); std::cout << "START add temp form to the host B" << std::endl; std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; @@ -429,13 +431,13 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3500, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host B" << std::endl; - sleep(1); + sleep(3); bool result = FmsAcquireFormTempForFailed(bundleNameB, abilityNameB); EXPECT_TRUE(result); if (result) { std::cout << "END add temp form to the host B, Failed to create the 257th temporary form." << std::endl; } - sleep(1); + sleep(3); std::cout << "FMS_acquireForm_3500, dlete temp form start" << std::endl; FMS_deleteFormBatch(); std::cout << "FMS_acquireForm_3500, dlete temp form end" << std::endl; @@ -443,6 +445,105 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | std::cout << "END FMS_acquireForm_3500" << std::endl; } +/** + * @tc.number: FMS_acquireForm_3600 + * @tc.name: Multiple hosts create 512 forms respectively. + * @tc.desc: Verify that multiple hosts can create 512 forms. + */ +HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3600, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "START FMS_acquireForm_3600" << std::endl; + std::string bundleNameA = "com.ohos.form.manager.normal"; + std::string abilityNameA = "FormAbilityA"; + std::cout << "bundleName: " << bundleNameA << std::endl; + std::cout << "abilityName: " << abilityNameA << std::endl; + FMS_acquireFormBatchA(bundleNameA, abilityNameA, FORM_COUNT_200); + std::cout << "FMS_acquireForm_3600, normal form size:" << FORM_COUNT_200 << std::endl; + sleep(3); + std::string bundleNameB = "com.ohos.form.manager.normalb"; + std::string abilityNameB = "FormAbilityB"; + std::cout << "bundleName: " << bundleNameB << std::endl; + std::cout << "abilityName: " << abilityNameB << std::endl; + FMS_acquireFormBatchA(bundleNameB, abilityNameB, FORM_COUNT_200); + std::cout << "FMS_acquireForm_3600, normal form size:" << FORM_COUNT_200 << std::endl; + sleep(3); + std::string bundleNameC = "com.ohos.form.manager.normalc"; + std::string abilityNameC = "FormAbilityC"; + std::cout << "bundleName: " << bundleNameC << std::endl; + std::cout << "abilityName: " << abilityNameC << std::endl; + FMS_acquireFormBatchA(bundleNameC, abilityNameC, FORM_COUNT_111); + std::cout << "FMS_acquireForm_3600, normal form size:" << FORM_COUNT_111 << std::endl; + sleep(3); + std::cout << "bundleName: " << bundleNameA << std::endl; + std::cout << "abilityName: " << abilityNameA << std::endl; + FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_128); + std::cout << "FMS_acquireForm_3600, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; + sleep(3); + std::cout << "bundleName: " << bundleNameB << std::endl; + std::cout << "abilityName: " << abilityNameB << std::endl; + FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128); + std::cout << "FMS_acquireForm_3600, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; + sleep(3); + bool result = FmsAcquireFormTempForFailed(bundleNameA, abilityNameA); + EXPECT_TRUE(result); + if (result) { + std::cout << "END add temp form to the host B, Failed to create the 257th temporary form." << std::endl; + } + sleep(3); + std::cout << "FMS_acquireForm_3600, dlete temp form start" << std::endl; + FMS_deleteFormBatch(); + std::cout << "FMS_acquireForm_3600, dlete temp form end" << std::endl; + std::cout << "END FMS_acquireForm_3600" << std::endl; +} + +/** + * @tc.number: FMS_acquireForm_3700 + * @tc.name: Multiple hosts create 512 forms respectively. + * @tc.desc: Verify that multiple hosts can create 512 forms. + */ +HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3700, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "START FMS_acquireForm_3700" << std::endl; + std::string bundleNameA = "com.ohos.form.manager.normal"; + std::string abilityNameA = "FormAbilityA"; + std::cout << "bundleName: " << bundleNameA << std::endl; + std::cout << "abilityName: " << abilityNameA << std::endl; + FMS_acquireFormBatchA(bundleNameA, abilityNameA, FORM_COUNT_200); + std::cout << "FMS_acquireForm_3700, normal form size:" << FORM_COUNT_200 << std::endl; + sleep(3); + std::string bundleNameB = "com.ohos.form.manager.normalb"; + std::string abilityNameB = "FormAbilityB"; + std::cout << "bundleName: " << bundleNameB << std::endl; + std::cout << "abilityName: " << abilityNameB << std::endl; + FMS_acquireFormBatchA(bundleNameB, abilityNameB, FORM_COUNT_200); + std::cout << "FMS_acquireForm_3700, normal form size:" << FORM_COUNT_200 << std::endl; + sleep(3); + std::string bundleNameC = "com.ohos.form.manager.normalc"; + std::string abilityNameC = "FormAbilityC"; + std::cout << "bundleName: " << bundleNameC << std::endl; + std::cout << "abilityName: " << abilityNameC << std::endl; + FMS_acquireFormBatchA(bundleNameC, abilityNameC, FORM_COUNT_112); + std::cout << "FMS_acquireForm_3700, normal form size:" << FORM_COUNT_112 << std::endl; + sleep(3); + std::cout << "bundleName: " << bundleNameA << std::endl; + std::cout << "abilityName: " << abilityNameA << std::endl; + FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_128); + std::cout << "FMS_acquireForm_3700, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; + sleep(3); + std::cout << "bundleName: " << bundleNameB << std::endl; + std::cout << "abilityName: " << abilityNameB << std::endl; + FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128); + std::cout << "FMS_acquireForm_3700, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; + sleep(3); + FmsAcquireForm3700(); + sleep(3); + std::cout << "FMS_acquireForm_3700, dlete temp form start" << std::endl; + FMS_deleteFormBatch(); + std::cout << "FMS_acquireForm_3700, dlete temp form end" << std::endl; + std::cout << "END FMS_acquireForm_3700" << std::endl; +} std::string FmsAcquireFormTestBatch::FmsAcquireForm3100(const std::string &bundleName, const std::string &abilityName) { MAP_STR_STR params; @@ -452,7 +553,10 @@ std::string FmsAcquireFormTestBatch::FmsAcquireForm3100(const std::string &bundl std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3100; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3100, EVENT_CODE_3100, eventData); - + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3102)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3102); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100); bool result = !strFormId.empty(); @@ -489,6 +593,7 @@ void FmsAcquireFormTestBatch::FmsAcquireForm2700(std::string strFormId) EXPECT_TRUE(result3); GTEST_LOG_(INFO) << "FmsAcquireForm2700, result:" << result3; // wait delete form + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result4 = data4 == "true"; @@ -555,6 +660,11 @@ std::string FmsAcquireFormTestBatch::FmsAcquireForm2900A() std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_2900; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2900, EVENT_CODE_2900, eventData); + sleep(3); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2902)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2902); + bool result1 = data == "true"; + EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900)); std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900); bool result = !strFormId.empty(); @@ -596,6 +706,28 @@ void FmsAcquireFormTestBatch::FmsAcquireForm3000() std::cout << "END FmsAcquireForm3000" << std::endl; } +void FmsAcquireFormTestBatch::FmsAcquireForm3700() +{ + std::cout << "START FmsAcquireForm3700" << std::endl; + + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityMs); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3700; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3700, EVENT_CODE_3700, eventData); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3700, EVENT_CODE_3700)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3700, EVENT_CODE_3700); + bool result = data == "false"; + EXPECT_TRUE(result); + GTEST_LOG_(INFO) << "FmsAcquireForm3700, result:" << result; + + std::cout << "END FmsAcquireForm3700" << std::endl; +} + void FmsAcquireFormTestBatch::FMS_acquireFormBatchA(const std::string &bundleName, const std::string &abilityName, const int count) { @@ -724,6 +856,7 @@ bool FmsAcquireFormTestBatch::FmsAcquireFormTempForFailed(const std::string &bun void FmsAcquireFormTestBatch::FmsAcquireFormDeleteA(const std::string &strFormId) { + sleep(3); std::cout << "START FmsAcquireFormDeleteA, start." << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -736,6 +869,7 @@ void FmsAcquireFormTestBatch::FmsAcquireFormDeleteA(const std::string &strFormId std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -759,6 +893,7 @@ void FmsAcquireFormTestBatch::FmsAcquireFormDeleteB(const std::string &strFormId std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -781,6 +916,7 @@ void FmsAcquireFormTestBatch::FmsAcquireFormDeleteC(const std::string &strFormId std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form + sleep(3); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -800,6 +936,7 @@ void FmsAcquireFormTestBatch::FMS_deleteFormBatch() SystemTestFormUtil::StartAbility(want, abilityMs); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_CLEAR_FORM_BATCH; + sleep(3); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_CLEAR_FORM_BATCH, EVENT_CODE_TEMP, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH); diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp deleted file mode 100644 index 340d8d8c9c..0000000000 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp +++ /dev/null @@ -1,763 +0,0 @@ -/* - * Copyright (c) 2021 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include - -#include "ability_handler.h" -#include "ability_info.h" -#include "ability_local_record.h" -#include "ability_start_setting.h" -#include "app_log_wrapper.h" -#include "common_event.h" -#include "common_event_manager.h" -#include "context_deal.h" -#include "form_event.h" -#include "form_st_common_info.h" -#include "iservice_registry.h" -#include "nlohmann/json.hpp" -#include "system_ability_definition.h" -#include "system_test_form_util.h" - -using OHOS::AAFwk::Want; -using namespace testing::ext; -using namespace std::chrono_literals; -using namespace OHOS::STtools; - -namespace { -const int FORM_COUNT_200 = 200; -const int FORM_COUNT_112 = 112; -const int TEMP_FORM_COUNT_256 = 256; -const int TEMP_FORM_COUNT_128 = 128; - -std::vector bundleNameList = { - "com.form.formsystemtestservicea", - "com.form.formsystemtestserviceb", -}; -std::vector hapNameList = { - "formSystemTestServiceA-signed", - "formSystemTestServiceB-signed", -}; - -std::vector normalFormsMaxA; -std::vector normalFormsMaxB; -std::vector normalFormsMaxC; - -std::vector tempFormsMaxA; -std::vector tempFormsMaxB; -} // namespace - -namespace OHOS { -namespace AppExecFwk { -class FmsAcquireFormTestMax : public testing::Test { -public: - static void SetUpTestCase(); - static void TearDownTestCase(); - - static bool SubscribeEvent(); - - void SetUp(); - void TearDown(); - - void StartAbilityKitTest(const std::string &abilityName, const std::string &bundleName); - void TerminateAbility(const std::string &eventName, const std::string &abilityName); - - class FormEventSubscriber : public CommonEventSubscriber { - public: - explicit FormEventSubscriber(const CommonEventSubscribeInfo &sp) : CommonEventSubscriber(sp) {}; - virtual void OnReceiveEvent(const CommonEventData &data) override; - ~FormEventSubscriber() = default; - }; - - static sptr abilityMs; - static FormEvent event; - static std::vector eventList; - static std::shared_ptr subscriber; - - void FmsAcquireForm2700(std::string strFormId); - std::string FmsAcquireForm2900A(); - std::string FmsAcquireForm2900B(); - void FmsAcquireForm3000(); - std::string FmsAcquireForm3100(const std::string &bundleName, const std::string &abilityName); - void FmsAcquireForm2800(std::string strFormId); - void FmsAcquireForm3200(); - - void FmsAcquireFormDeleteA(const std::string &strFormId); - void FmsAcquireFormDeleteB(const std::string &strFormId); - void FmsAcquireFormDeleteC(const std::string &strFormId); - std::string FmsAcquireFormTemp(const std::string &bundleName, const std::string &abilityName); - bool FmsAcquireFormTempForFailed(const std::string &bundleName, const std::string &abilityName); -}; -std::vector FmsAcquireFormTestMax::eventList = { - FORM_EVENT_RECV_DELETE_FORM_COMMON, FORM_EVENT_ABILITY_ONACTIVED, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, - FORM_EVENT_RECV_ACQUIRE_FORM_2700, FORM_EVENT_RECV_ACQUIRE_FORM_2800, FORM_EVENT_RECV_ACQUIRE_FORM_2900, - FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, FORM_EVENT_RECV_ACQUIRE_FORM_3000, FORM_EVENT_RECV_ACQUIRE_FORM_3100, - FORM_EVENT_RECV_ACQUIRE_FORM_3200, -}; - - -FormEvent FmsAcquireFormTestMax::event = FormEvent(); -sptr FmsAcquireFormTestMax::abilityMs = nullptr; -std::shared_ptr FmsAcquireFormTestMax::subscriber = nullptr; -void FmsAcquireFormTestMax::FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) -{ - GTEST_LOG_(INFO) << "OnReceiveEvent: event=" << data.GetWant().GetAction(); - GTEST_LOG_(INFO) << "OnReceiveEvent: data=" << data.GetData(); - GTEST_LOG_(INFO) << "OnReceiveEvent: code=" << data.GetCode(); - SystemTestFormUtil::Completed(event, data.GetWant().GetAction(), data.GetCode(), data.GetData()); -} - -void FmsAcquireFormTestMax::SetUpTestCase() -{ - if (!SubscribeEvent()) { - GTEST_LOG_(INFO) << "SubscribeEvent error"; - } -} - -void FmsAcquireFormTestMax::TearDownTestCase() -{ - GTEST_LOG_(INFO) << "UnSubscribeCommonEvent calld"; - CommonEventManager::UnSubscribeCommonEvent(subscriber); -} - -void FmsAcquireFormTestMax::SetUp() -{ -} - -void FmsAcquireFormTestMax::TearDown() -{ - GTEST_LOG_(INFO) << "CleanMsg calld"; - SystemTestFormUtil::CleanMsg(event); -} -bool FmsAcquireFormTestMax::SubscribeEvent() -{ - GTEST_LOG_(INFO) << "SubscribeEvent calld"; - MatchingSkills matchingSkills; - for (const auto &e : eventList) { - matchingSkills.AddEvent(e); - } - CommonEventSubscribeInfo subscribeInfo(matchingSkills); - subscribeInfo.SetPriority(1); - subscriber = std::make_shared(subscribeInfo); - return CommonEventManager::SubscribeCommonEvent(subscriber); -} - -/** - * @tc.number: FMS_acquireForm_2900 - * @tc.name: A single host creates 256 different provider forms. - * @tc.desc: The single host can successfully create 256 different provider forms. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_2900, Function | MediumTest | Level1) -{ - std::cout << "START FMS_acquireForm_2900" << std::endl; - for (int count = 0; count < Constants::MAX_RECORD_PER_APP/2; count++) { - sleep(7); - std::string strFormId1 = FmsAcquireForm2900A(); - normalFormsMaxA.emplace_back(strFormId1); - std::cout << "FMS_acquireForm_2900, form size of the host A:" << normalFormsMaxA.size() << std::endl; - sleep(7); - std::string strFormId2 = FmsAcquireForm2900B(); - normalFormsMaxA.emplace_back(strFormId2); - std::cout << "FMS_acquireForm_2900, form size of the host A:" << normalFormsMaxA.size() << std::endl; - } - - std::cout << "END FMS_acquireForm_2900" << std::endl; -} -/** - * @tc.number: FMS_acquireForm_3000 - * @tc.name: Create limit value verification using single party form. - * @tc.desc: Failed to create the 257th host form. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_3000, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_3000" << std::endl; - std::cout << "FMS_acquireForm_3000, form size of the host A:" << normalFormsMaxA.size() << std::endl; - FmsAcquireForm3000(); - std::cout << "END FMS_acquireForm_3000" << std::endl; -} - -/** - * @tc.number: FMS_acquireForm_2700 - * @tc.name: When the normal form reaches the maximum value (256) created by the host, - * the temporary form is transferred to the normal form. - * @tc.desc: Verify that when the normal form reaches the maximum value (256) created by the single host, - * the conversion of the temporary form to the normal form fails. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_2700, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_2700" << std::endl; - std::cout << "FMS_acquireForm_2700, form size of the host A:" << normalFormsMaxA.size() << std::endl; - std::string bundleNameA = "com.ohos.form.manager.normal"; - std::string abilityNameA = "FormAbilityA"; - std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - - sleep(7); - FmsAcquireForm2700(strFormId); - std::cout << "END FMS_acquireForm_2700" << std::endl; - - std::cout << "the host A, dlete form start" << std::endl; - for (int count = 0; count < normalFormsMaxA.size(); count++) { - sleep(7); - FmsAcquireFormDeleteA(normalFormsMaxA[count]); - std::cout << "delete form count:" << count + 1 << std::endl; - } - normalFormsMaxA.clear(); - std::cout << "the host A, dlete form end" << std::endl; -} - -/** - * @tc.number: FMS_acquireForm_3100 - * @tc.name: Multiple hosts create 512 forms respectively. - * @tc.desc: Verify that multiple hosts can create 512 forms. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_3100, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_3100" << std::endl; - - std::cout << "START add form to the host A" << std::endl; - std::string bundleNameA = "com.ohos.form.manager.normal"; - std::string abilityNameA = "FormAbilityA"; - std::cout << "bundleName: " << bundleNameA << std::endl; - std::cout << "abilityName: " << abilityNameA << std::endl; - for (int count = 0; count < FORM_COUNT_200; count++) { - sleep(7); - std::string strFormId = FmsAcquireForm3100(bundleNameA, abilityNameA); - normalFormsMaxA.emplace_back(strFormId); - std::cout << "add form count:" << count + 1 << std::endl; - } - std::cout << "END add form to the host A" << std::endl; - - std::cout << "START add form to the host B" << std::endl; - std::string bundleNameB = "com.ohos.form.manager.normalb"; - std::string abilityNameB = "FormAbilityB"; - std::cout << "bundleName: " << bundleNameB << std::endl; - std::cout << "abilityName: " << abilityNameB << std::endl; - for (int count = 0; count < FORM_COUNT_200; count++) { - sleep(7); - std::string strFormId = FmsAcquireForm3100(bundleNameB, abilityNameB); - normalFormsMaxB.emplace_back(strFormId); - std::cout << "add form count:" << count + 1 << std::endl; - } - std::cout << "END add form to the host B" << std::endl; - - std::cout << "START add form to the host C" << std::endl; - std::string bundleNameC = "com.ohos.form.manager.normalc"; - std::string abilityNameC = "FormAbilityC"; - std::cout << "bundleName: " << bundleNameC << std::endl; - std::cout << "abilityName: " << abilityNameC << std::endl; - for (int count = 0; count < FORM_COUNT_112; count++) { - sleep(7); - std::string strFormId = FmsAcquireForm3100(bundleNameC, abilityNameC); - normalFormsMaxC.emplace_back(strFormId); - std::cout << "add form count:" << count + 1 << std::endl; - } - std::cout << "END add form to the host C" << std::endl; - - std::cout << "END FMS_acquireForm_3100" << std::endl; -} - -/** - * @tc.number: FMS_acquireForm_2800 - * @tc.name: When the normal form reaches the maximum value (512) of the form created by FMS, - * the temporary form will be transferred to the normal form. - * @tc.desc: When the normal form reaches the maximum value (512) created by FMS, - * the conversion of temporary form to normal form fails. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_2800, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_2800" << std::endl; - std::cout << "FMS_acquireForm_2800, form size of the host A:" << normalFormsMaxA.size() << std::endl; - std::cout << "FMS_acquireForm_2800, form size of the host B:" << normalFormsMaxB.size() << std::endl; - std::cout << "FMS_acquireForm_2800, form size of the host C:" << normalFormsMaxC.size() << std::endl; - std::string bundleNameA = "com.ohos.form.manager.normal"; - std::string abilityNameA = "FormAbilityA"; - - std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - - sleep(7); - FmsAcquireForm2800(strFormId); - std::cout << "END FMS_acquireForm_2800" << std::endl; -} - -/** - * @tc.number: FMS_acquireForm_2800 - * @tc.name: When the normal form reaches the maximum value (512) of the form created by FMS, - * the temporary form will be transferred to the normal form. - * @tc.desc: When the normal form reaches the maximum value (512) created by FMS, - * the conversion of temporary form to normal form fails. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_3200, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_3200" << std::endl; - std::cout << "FMS_acquireForm_3200, form size of the host A:" << normalFormsMaxA.size() << std::endl; - std::cout << "FMS_acquireForm_3200, form size of the host B:" << normalFormsMaxB.size() << std::endl; - std::cout << "FMS_acquireForm_3200, form size of the host C:" << normalFormsMaxC.size() << std::endl; - FmsAcquireForm3200(); - std::cout << "END FMS_acquireForm_3200" << std::endl; - - std::cout << "the host A, dlete form start" << std::endl; - for (int count = 0; count < normalFormsMaxA.size(); count++) { - sleep(7); - FmsAcquireFormDeleteA(normalFormsMaxA[count]); - std::cout << "delete form count:" << count + 1 << std::endl; - } - normalFormsMaxA.clear(); - std::cout << "the host A, dlete form end" << std::endl; - - std::cout << "the host B, dlete form start" << std::endl; - for (int count = 0; count < normalFormsMaxB.size(); count++) { - sleep(7); - FmsAcquireFormDeleteB(normalFormsMaxB[count]); - std::cout << "delete form count:" << count + 1 << std::endl; - } - normalFormsMaxB.clear(); - std::cout << "the host B, dlete form end" << std::endl; - - std::cout << "the host C, dlete form start" << std::endl; - for (int count = 0; count < normalFormsMaxC.size(); count++) { - sleep(7); - FmsAcquireFormDeleteC(normalFormsMaxC[count]); - std::cout << "delete form count:" << count + 1 << std::endl; - } - normalFormsMaxC.clear(); - std::cout << "the host C, dlete form end" << std::endl; -} -/** - * @tc.number: FMS_acquireForm_3300 - * @tc.name: A single host can create 256 temporary forms. - * @tc.desc: The host of the verification form can successfully create 256 temporary forms. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_3300, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_3300" << std::endl; - - std::cout << "START add temp form to the host A" << std::endl; - std::string bundleNameA = "com.ohos.form.manager.normal"; - std::string abilityNameA = "FormAbilityA"; - std::cout << "bundleName: " << bundleNameA << std::endl; - std::cout << "abilityName: " << abilityNameA << std::endl; - for (int count = 0; count < TEMP_FORM_COUNT_256; count++) { - sleep(7); - std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - tempFormsMaxA.emplace_back(strFormId); - std::cout << "FMS_acquireForm_3300, form size of the host A:" << tempFormsMaxA.size() << std::endl; - } - std::cout << "END add temp form to the host A" << std::endl; - - std::cout << "END FMS_acquireForm_3300" << std::endl; - - std::cout << "the host A, dlete temp form start" << std::endl; - for (int count = 0; count < tempFormsMaxA.size(); count++) { - sleep(7); - FmsAcquireFormDeleteA(tempFormsMaxA[count]); - std::cout << "delete temp form count:" << count + 1 << std::endl; - } - tempFormsMaxA.clear(); - std::cout << "the host A, dlete temp form end" << std::endl; -} -/** - * @tc.number: FMS_acquireForm_3400 - * @tc.name: 256 temporary forms can be created by multiple hosts. - * @tc.desc: Verify that multiple hosts can successfully create 256 temporary forms. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_3400, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_3400" << std::endl; - - std::cout << "START add temp form to the host A" << std::endl; - std::string bundleNameA = "com.ohos.form.manager.normal"; - std::string abilityNameA = "FormAbilityA"; - std::cout << "bundleName: " << bundleNameA << std::endl; - std::cout << "abilityName: " << abilityNameA << std::endl; - for (int count = 0; count < TEMP_FORM_COUNT_128; count++) { - sleep(7); - std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - tempFormsMaxA.emplace_back(strFormId); - std::cout << "FMS_acquireForm_3400, temp form size of the host A:" << tempFormsMaxA.size() << std::endl; - } - std::cout << "END add temp form to the host A" << std::endl; - - std::cout << "START add temp form to the host B" << std::endl; - std::string bundleNameB = "com.ohos.form.manager.normalb"; - std::string abilityNameB = "FormAbilityB"; - std::cout << "bundleName: " << bundleNameB << std::endl; - std::cout << "abilityName: " << abilityNameB << std::endl; - for (int count = 0; count < TEMP_FORM_COUNT_128; count++) { - sleep(7); - std::string strFormId = FmsAcquireFormTemp(bundleNameB, abilityNameB); - tempFormsMaxB.emplace_back(strFormId); - std::cout << "FMS_acquireForm_3400, temp form size of the host B:" << tempFormsMaxB.size() << std::endl; - } - std::cout << "END add temp form to the host B" << std::endl; - - std::cout << "END FMS_acquireForm_3400" << std::endl; -} - -/** - * @tc.number: FMS_acquireForm_3500 - * @tc.name: Create temporary form limit value (256) verification. - * @tc.desc: Failed to create the 257th temporary form for multiple users. - */ -HWTEST_F(FmsAcquireFormTestMax, FMS_acquireForm_3500, Function | MediumTest | Level1) -{ - sleep(7); - std::cout << "START FMS_acquireForm_3500" << std::endl; - - std::cout << "START add temp form to the host B" << std::endl; - std::string bundleNameB = "com.ohos.form.manager.normalb"; - std::string abilityNameB = "FormAbilityB"; - std::cout << "bundleName: " << bundleNameB << std::endl; - std::cout << "abilityName: " << abilityNameB << std::endl; - - bool result = FmsAcquireFormTempForFailed(bundleNameB, abilityNameB); - EXPECT_TRUE(result); - if (result) { - std::cout << "END add temp form to the host B, Failed to create the 257th temporary form." << std::endl; - } - std::cout << "END FMS_acquireForm_3500" << std::endl; - - std::cout << "the host A, dlete temp form start" << std::endl; - for (int count = 0; count < tempFormsMaxA.size(); count++) { - sleep(7); - FmsAcquireFormDeleteA(tempFormsMaxA[count]); - std::cout << "delete temp form count:" << count + 1 << std::endl; - } - tempFormsMaxA.clear(); - std::cout << "the host A, dlete temp form end" << std::endl; - - std::cout << "the host B, dlete temp form start" << std::endl; - for (int count = 0; count < tempFormsMaxB.size(); count++) { - sleep(7); - FmsAcquireFormDeleteB(tempFormsMaxB[count]); - std::cout << "delete temp form count:" << count + 1 << std::endl; - } - tempFormsMaxB.clear(); - std::cout << "the host B, dlete temp form end" << std::endl; -} - -std::string FmsAcquireFormTestMax::FmsAcquireForm3100(const std::string &bundleName, const std::string &abilityName) -{ - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3100; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3100, EVENT_CODE_3100, eventData); - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100)); - std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100); - bool result = !strFormId.empty(); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FmsAcquireForm3100, result:" << result; - } else { - GTEST_LOG_(INFO) << "FmsAcquireForm3100, formId:" << strFormId; - } - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3101)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3101); - bool result2 = !data2.empty(); - EXPECT_TRUE(result2); - GTEST_LOG_(INFO) << "FmsAcquireForm3100, result:" << result2; - - return strFormId; -} - -void FmsAcquireFormTestMax::FmsAcquireForm2700(std::string strFormId) -{ - std::cout << "START FmsAcquireForm2700, cast temp form" << std::endl; - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityA"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData1 = strFormId; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2700, EVENT_CODE_2700, eventData1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2700, EVENT_CODE_2700)); - std::string data3 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2700, EVENT_CODE_2700); - bool result3 = data3 == "false"; - EXPECT_TRUE(result3); - GTEST_LOG_(INFO) << "FmsAcquireForm2700, result:" << result3; - // wait delete form - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); - std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); - bool result4 = data4 == "true"; - EXPECT_TRUE(result4); - GTEST_LOG_(INFO) << "FmsAcquireForm2700, delete form, result:" << result4; - std::cout << "END FmsAcquireForm2700, cast temp form" << std::endl; -} -void FmsAcquireFormTestMax::FmsAcquireForm3200() -{ - std::cout << "START FmsAcquireForm3200" << std::endl; - - std::string bundleName = "com.ohos.form.manager.normalc"; - std::string abilityName = "FormAbilityC"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3200; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3200, EVENT_CODE_3200, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3200, EVENT_CODE_3200)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3200, EVENT_CODE_3200); - bool result = data == "false"; - EXPECT_TRUE(result); - GTEST_LOG_(INFO) << "FmsAcquireForm3200, result:" << result; - - std::cout << "END FmsAcquireForm3200" << std::endl; -} -void FmsAcquireFormTestMax::FmsAcquireForm2800(std::string strFormId) -{ - std::cout << "START FmsAcquireForm2800, cast temp form" << std::endl; - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityA"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData1 = strFormId; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2800, EVENT_CODE_2800, eventData1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2800, EVENT_CODE_2800)); - std::string data3 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2800, EVENT_CODE_2800); - bool result3 = data3 == "false"; - EXPECT_TRUE(result3); - GTEST_LOG_(INFO) << "FmsAcquireForm2800, result:" << result3; - // wait delete form - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); - std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); - bool result4 = data4 == "true"; - EXPECT_TRUE(result4); - GTEST_LOG_(INFO) << "FmsAcquireForm2800, delete form, result:" << result4; - std::cout << "END FmsAcquireForm2800, cast temp form" << std::endl; -} - -std::string FmsAcquireFormTestMax::FmsAcquireForm2900A() -{ - std::cout << "START FmsAcquireForm2900A, Provider A" << std::endl; - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityA"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_2900; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2900, EVENT_CODE_2900, eventData); - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900)); - std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900); - bool result = !strFormId.empty(); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FmsAcquireForm2900A, result:" << result; - } else { - GTEST_LOG_(INFO) << "FmsAcquireForm2900A, formId:" << strFormId; - } - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2901)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2901); - bool result2 = !data2.empty(); - EXPECT_TRUE(result2); - GTEST_LOG_(INFO) << "FmsAcquireForm2900A, result:" << result2; - - std::cout << "END FmsAcquireForm2900A, Provider A" << std::endl; - return strFormId; -} -std::string FmsAcquireFormTestMax::FmsAcquireForm2900B() -{ - std::cout << "START FmsAcquireForm2900B, Provider B" << std::endl; - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityA"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_2900_1; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2900_1, EVENT_CODE_2910, eventData); - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, EVENT_CODE_2910)); - std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, EVENT_CODE_2910); - bool result = !strFormId.empty(); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FmsAcquireForm2900B, result:" << result; - } else { - GTEST_LOG_(INFO) << "FmsAcquireForm2900B, formId:" << strFormId; - } - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, EVENT_CODE_2911)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, EVENT_CODE_2911); - bool result2 = !data2.empty(); - EXPECT_TRUE(result2); - GTEST_LOG_(INFO) << "FmsAcquireForm2900B, result:" << result2; - - std::cout << "END FmsAcquireForm2900B, Provider B" << std::endl; - return strFormId; -} -void FmsAcquireFormTestMax::FmsAcquireForm3000() -{ - std::cout << "START FmsAcquireForm3000" << std::endl; - - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityA"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3000; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3000, EVENT_CODE_3000, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3000, EVENT_CODE_3000)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3000, EVENT_CODE_3000); - bool result = data == "false"; - EXPECT_TRUE(result); - GTEST_LOG_(INFO) << "FmsAcquireForm3000, result:" << result; - - std::cout << "END FmsAcquireForm3000" << std::endl; -} -std::string FmsAcquireFormTestMax::FmsAcquireFormTemp(const std::string &bundleName, const std::string &abilityName) -{ - std::cout << "START FmsAcquireFormTemp, add temp form" << std::endl; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_TEMP; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP)); - std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP); - bool result = !strFormId.empty(); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FmsAcquireFormTemp, result:" << result; - } else { - GTEST_LOG_(INFO) << "FmsAcquireFormTemp, formId:" << strFormId; - } - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP_1)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP_1); - bool result2 = !data2.empty(); - EXPECT_TRUE(result2); - if (!result2) { - GTEST_LOG_(INFO) << "FmsAcquireFormTemp, result:" << result2; - } else { - GTEST_LOG_(INFO) << "FmsAcquireFormTemp, formData:" << data2; - } - std::cout << "END FmsAcquireFormTemp, add temp form" << std::endl; - - return strFormId; -} - -bool FmsAcquireFormTestMax::FmsAcquireFormTempForFailed(const std::string &bundleName, const std::string &abilityName) -{ - std::cout << "START FmsAcquireFormTempForFailed, add temp form" << std::endl; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_TEMP; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP)); - std::string strFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP); - bool result = strFormId.empty(); - EXPECT_TRUE(result); - GTEST_LOG_(INFO) << "FmsAcquireFormTempForFailed, result:" << result; - - std::cout << "END FmsAcquireFormTempForFailed, add temp form" << std::endl; - - return result; -} - -void FmsAcquireFormTestMax::FmsAcquireFormDeleteA(const std::string &strFormId) -{ - std::cout << "START FmsAcquireFormDeleteA, start." << std::endl; - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityA"; - std::cout << "START FmsAcquireFormDeleteA, bundleName: " << bundleName << std::endl; - std::cout << "START FmsAcquireFormDeleteA, abilityName: " << abilityName << std::endl; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = strFormId; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); - // wait delete form - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); - bool result = data == "true"; - EXPECT_TRUE(result); - GTEST_LOG_(INFO) << "FmsAcquireFormDeleteA, delete form, result:" << result; - - std::cout << "END FmsAcquireFormDeleteA end" << std::endl; -} - -void FmsAcquireFormTestMax::FmsAcquireFormDeleteB(const std::string &strFormId) -{ - std::cout << "START FmsAcquireFormDeleteB, start." << std::endl; - std::string bundleName = "com.ohos.form.manager.normalb"; - std::string abilityName = "FormAbilityB"; - std::cout << "START FmsAcquireFormDeleteB, bundleName: " << bundleName << std::endl; - std::cout << "START FmsAcquireFormDeleteB, abilityName: " << abilityName << std::endl; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = strFormId; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); - // wait delete form - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); - bool result = data == "true"; - EXPECT_TRUE(result); - GTEST_LOG_(INFO) << "FmsAcquireFormDeleteB, delete form, result:" << result; - - std::cout << "END FmsAcquireFormDeleteB end" << std::endl; -} -void FmsAcquireFormTestMax::FmsAcquireFormDeleteC(const std::string &strFormId) -{ - std::cout << "START FmsAcquireFormDeleteC, start." << std::endl; - std::string bundleName = "com.ohos.form.manager.normalc"; - std::string abilityName = "FormAbilityC"; - std::cout << "START FmsAcquireFormDeleteC, bundleName: " << bundleName << std::endl; - std::cout << "START FmsAcquireFormDeleteC, abilityName: " << abilityName << std::endl; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityMs); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = strFormId; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); - // wait delete form - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); - bool result = data == "true"; - EXPECT_TRUE(result); - GTEST_LOG_(INFO) << "FmsAcquireFormDeleteC, delete form, result:" << result; - - std::cout << "END FmsAcquireFormDeleteC end" << std::endl; -} -} // namespace AppExecFwk -} // namespace OHOS \ No newline at end of file diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index 4aae43bb0d..d7de1362ba 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -38,6 +38,19 @@ using namespace testing::ext; using namespace std::chrono_literals; using namespace OHOS::STtools; +namespace { +std::vector bundleNameList = { + "com.ohos.form.manager.notsystemapp", + "com.form.formsystemtestservicea", + "com.form.formsystemtestserviceb" +}; +std::vector hapNameList = { + "fmsSystemTestHostNotSys-signed", + "formSystemTestServiceA-signed", + "formSystemTestServiceB-signed" +}; +} // namespace + namespace OHOS { namespace AppExecFwk { class FmsDeleteFormTest : public testing::Test { @@ -90,6 +103,7 @@ public: void FMS_acquireNormalFormBatch(const std::string &bundleName, const std::string &abilityName, const int count); void FMS_deleteFormBatch(const std::string &bundleName, const std::string &abilityName); + void FMS_deleteFormDeleteA(std::string delFormId); }; std::vector FmsDeleteFormTest::eventList = { @@ -101,6 +115,8 @@ std::vector FmsDeleteFormTest::eventList = { FORM_EVENT_RECV_DELETE_FORM_0500, FORM_EVENT_RECV_DELETE_FORM_0600, FORM_EVENT_RECV_DELETE_FORM_0700, + FORM_EVENT_RECV_DELETE_FORM_0700_1, + FORM_EVENT_RECV_DELETE_FORM_0700_2, FORM_EVENT_RECV_DELETE_FORM_0800, FORM_EVENT_RECV_DELETE_FORM_0900, FORM_EVENT_RECV_DELETE_FORM_1000, @@ -123,9 +139,12 @@ std::vector FmsDeleteFormTest::eventList = { FORM_EVENT_RECV_ONE_NORMAL_FORM_B, FORM_EVENT_RECV_ONE_NORMAL_FORM_B_DEL, COMMON_EVENT_ON_DELETE, + FORM_EVENT_RECV_DELETE_FORM_COMMON, FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, - FORM_EVENT_RECV_CLEAR_FORM_BATCH + FORM_EVENT_RECV_CLEAR_FORM_BATCH, + FORM_EVENT_RECV_ONE_NORMAL_FORM_001, + FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001 }; FormEvent FmsDeleteFormTest::event = FormEvent(); @@ -142,6 +161,7 @@ void FmsDeleteFormTest::FormEventSubscriber::OnReceiveEvent(const CommonEventDat void FmsDeleteFormTest::SetUpTestCase() { std::cout << "START Install============" << std::endl; + SystemTestFormUtil::InstallHaps(hapNameList); if (!SubscribeEvent()) { GTEST_LOG_(INFO) << "SubscribeEvent error"; } @@ -150,6 +170,7 @@ void FmsDeleteFormTest::SetUpTestCase() void FmsDeleteFormTest::TearDownTestCase() { std::cout << "START Uninstall============" << std::endl; + SystemTestFormUtil::UninstallBundle(bundleNameList); CommonEventManager::UnSubscribeCommonEvent(subscriber); } @@ -172,6 +193,8 @@ bool FmsDeleteFormTest::SubscribeEvent() FORM_EVENT_RECV_DELETE_FORM_0500, FORM_EVENT_RECV_DELETE_FORM_0600, FORM_EVENT_RECV_DELETE_FORM_0700, + FORM_EVENT_RECV_DELETE_FORM_0700_1, + FORM_EVENT_RECV_DELETE_FORM_0700_2, FORM_EVENT_RECV_DELETE_FORM_0800, FORM_EVENT_RECV_DELETE_FORM_0900, FORM_EVENT_RECV_DELETE_FORM_1000, @@ -194,9 +217,13 @@ bool FmsDeleteFormTest::SubscribeEvent() FORM_EVENT_RECV_ONE_NORMAL_FORM_B, FORM_EVENT_RECV_ONE_NORMAL_FORM_B_DEL, COMMON_EVENT_ON_DELETE, + FORM_EVENT_RECV_DELETE_FORM_COMMON, FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, - FORM_EVENT_RECV_CLEAR_FORM_BATCH + FORM_EVENT_RECV_CLEAR_FORM_BATCH, + FORM_EVENT_RECV_ONE_NORMAL_FORM_001, + FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001 + }; MatchingSkills matchingSkills; for (const auto &e : eventList) { @@ -216,6 +243,7 @@ bool FmsDeleteFormTest::SubscribeEvent() */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0100, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_deleteForm_0100" << std::endl; std::string bundleName = "com.ohos.form.manager.notsystemapp"; @@ -246,6 +274,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0100, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0200, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_deleteForm_0200" << std::endl; std::string bundleName = "com.ohos.form.manager.nopermission"; @@ -276,6 +305,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0200, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0300, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_deleteForm_0300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -287,12 +317,20 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0300, Function | MediumTest | Level0) std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0300; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0300, EVENT_CODE_300, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_310)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_310); + GTEST_LOG_(INFO) << "FMS_deleteForm_0300, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300); - bool result = data == "false"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0300, result:" << result; + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300); + GTEST_LOG_(INFO) << "FMS_deleteForm_0300, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "false"; + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_0300, result2:" << result2; } // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, @@ -309,6 +347,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0300, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0400, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_deleteForm_0400" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -320,12 +359,19 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0400, Function | MediumTest | Level0) std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0400; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0400, EVENT_CODE_400, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_410)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_410); + GTEST_LOG_(INFO) << "FMS_deleteForm_0400, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400); - bool result = data == "false"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0400, result:" << result; + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400); + bool result2 = data2 == "false"; + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_0400, result2:" << result2; } // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, @@ -343,6 +389,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0400, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0500, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_deleteForm_0500" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; @@ -354,14 +401,21 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0500, Function | MediumTest | Level1) std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_0500, acquire data:" << data << std::endl; + bool result = data == "true"; + EXPECT_TRUE(result); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); + std::string formId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); - GTEST_LOG_(INFO) << "FMS_deleteForm_0500, data:[" << data << "]" << std::endl; - bool result1 = data != ""; + GTEST_LOG_(INFO) << "FMS_deleteForm_0500, formId:[" << formId << "]" << std::endl; + bool result1 = formId != ""; EXPECT_TRUE(result1); - if (data != "") { + if (formId != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; std::string abilityName2 = "FormAbilityDeleteForm"; MAP_STR_STR params2; @@ -369,16 +423,16 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0500, Function | MediumTest | Level1) SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = data; + std::string eventData2 = formId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0500, EVENT_CODE_500, eventData2); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0500, EVENT_CODE_500)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0500, EVENT_CODE_500); - bool result2 = data2 == "false"; + std::string formId2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0500, EVENT_CODE_500); + bool result2 = formId2 == "false"; EXPECT_TRUE(result2); if (!result2) { GTEST_LOG_(INFO) << "FMS_deleteForm_0500, result2:" << result2; } - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, data); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formId); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, @@ -398,6 +452,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0500, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_deleteForm_0600" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -408,6 +463,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_0600, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0600, formOne:[" << formOne << "]" << std::endl; @@ -421,6 +483,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0600, EVENT_CODE_600, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610); + GTEST_LOG_(INFO) << "FMS_deleteForm_0600, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600); bool result = formTwo == "true"; @@ -456,6 +525,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_deleteForm_0700" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -466,6 +536,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formOne:[" << formOne << "]" << std::endl; @@ -478,8 +555,16 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(7); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700, EVENT_CODE_700, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700); GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formTwo:[" << formTwo << "]" << std::endl; @@ -500,6 +585,15 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) EXPECT_FALSE(cacheRes); EXPECT_FALSE(storageRes); EXPECT_FALSE(timerRes); + + GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formOne:" << std::endl; + bool cacheRes2 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); + bool storageRes2 = FmsGetStorageFormInfos(atoll(formOne.c_str())); + bool timerRes2 = FmsGetFormTimerTask(atoll(formOne.c_str())); + EXPECT_TRUE(cacheRes2); + EXPECT_TRUE(storageRes2); + EXPECT_TRUE(timerRes2); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, @@ -509,6 +603,168 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) std::cout << "============END FMS_deleteForm_0700" << std::endl; } +/** + * @tc.number: FMS_deleteForm_0700_1 + * @tc.name: After deleting a normal form, the form reference is 0. + * After deleting a form, there are still created normal forms in FMS. + * @tc.desc: 1.host A an host B create one normal card respectively + * 2.host A delete the form and verify the result is true + */ +HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "============START FMS_deleteForm_0700_1" << std::endl; + std::string bundleName = "com.ohos.form.manager.commona"; + std::string abilityName = "FormAbilityCommonA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData = "false"; // normal form + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_001, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100)); + std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formOne:[" << formOne << "]" << std::endl; + EXPECT_TRUE(formOne != ""); + if (formOne != "") { + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(3); + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_1, EVENT_CODE_700_1, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1)); + std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); + if (!result) { + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, result:" << result; + } + + want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + // can receive onDelete + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101, formOne); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, + FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(formOne.c_str())); + bool timerResA = FmsGetFormTimerTask(atoll(formOne.c_str())); + bool timerResB = FmsGetFormTimerTask(atoll(formTwo.c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(storageRes); + EXPECT_FALSE(timerResA); + EXPECT_TRUE(timerResB); + + FMS_deleteFormDeleteA(formTwo); + + } + SystemTestFormUtil::CleanMsg(event); + std::cout << "============END FMS_deleteForm_0700_1" << std::endl; +} + +/** + * @tc.number: FMS_deleteForm_0700_2 + * @tc.name: After deleting a normal form, the form reference is 0. + * After deleting a form, there are still created normal forms in FMS. + * @tc.desc: 1.host A an host B create one normal card respectively + * 2.host A delete the form and verify the result is true + */ +HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "============START FMS_deleteForm_0700_2" << std::endl; + std::string bundleName = "com.ohos.form.manager.commona"; + std::string abilityName = "FormAbilityCommonA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + std::string eventData = "false"; // normal form + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_001, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100)); + std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, formOne:[" << formOne << "]" << std::endl; + EXPECT_TRUE(formOne != ""); + if (formOne != "") { + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(3); + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_2, EVENT_CODE_700_2, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); + std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, acquire formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); + if (!result) { + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, result:" << result; + } + // can receive onDelete + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2,EVENT_CODE_700_2)); + std::string onDeleteData = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, + EVENT_CODE_700_2); + EXPECT_TRUE(onDeleteData == formTwo); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(formTwo.c_str())); + bool timerResA = FmsGetFormTimerTask(atoll(formOne.c_str())); + bool timerResB = FmsGetFormTimerTask(atoll(formTwo.c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(storageRes); + EXPECT_TRUE(timerResA); + EXPECT_FALSE(timerResB); + want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101, formOne); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, + FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); + } + SystemTestFormUtil::CleanMsg(event); + std::cout << "============END FMS_deleteForm_0700_2" << std::endl; +} + /** * @tc.number: FMS_deleteForm_0800 * @tc.name: After deleting a normal form, there is no created normal form in FMS. @@ -517,36 +773,73 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) { + sleep(7); std::cout << "============START FMS_deleteForm_0800" << std::endl; - - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityDeleteForm"; + std::string bundleName = "com.ohos.form.manager.commona"; + std::string abilityName = "FormAbilityCommonA"; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + std::string eventData = "false"; // normal form + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); - std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0800; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0800, EVENT_CODE_800, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800); - bool result = (data != "false" && data != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0800, result:" << result; + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_0800, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); + std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); + GTEST_LOG_(INFO) << "FMS_deleteForm_0800, formOne:[" << formOne << "]" << std::endl; + sleep(7); + EXPECT_TRUE(formOne != ""); + if (formOne != "") { + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityDeleteForm"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0800; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0800, EVENT_CODE_800, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810); + GTEST_LOG_(INFO) << "FMS_deleteForm_0800, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800); + bool result = (data != "false" && data != ""); + EXPECT_TRUE(result); + if (!result) { + GTEST_LOG_(INFO) << "FMS_deleteForm_0800, result:" << result; + } + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, + FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); + std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, + FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK); + EXPECT_TRUE(onDeleteData == data); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, + FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); + bool cacheResA = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); + bool storageResA = FmsGetStorageFormInfos(atoll(formOne.c_str())); + bool cacheResB = FmsGetCacheInfoByFormId(atoll(data.c_str())); + bool storageResB = FmsGetStorageFormInfos(atoll(data.c_str())); + bool timerResA = FmsGetFormTimerTask(atoll(formOne.c_str())); + bool timerResB = FmsGetFormTimerTask(atoll(data.c_str())); + EXPECT_FALSE(cacheResA); + EXPECT_FALSE(storageResA); + EXPECT_FALSE(cacheResB); + EXPECT_FALSE(storageResB); + EXPECT_FALSE(timerResA); + EXPECT_FALSE(timerResB); } - // can receive onDelete - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, - FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); - std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, - FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK); - EXPECT_TRUE(onDeleteData == data); - bool cacheRes = FmsGetCacheInfoByFormId(atoll(data.c_str())); - bool storageRes = FmsGetStorageFormInfos(atoll(data.c_str())); - bool timerRes = FmsGetFormTimerTask(atoll(data.c_str())); - EXPECT_FALSE(cacheRes); - EXPECT_FALSE(storageRes); - EXPECT_FALSE(timerRes); SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_deleteForm_0800" << std::endl; } @@ -560,6 +853,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0900, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_deleteForm_0900" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -571,6 +865,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0900, Function | MediumTest | Level1) std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0900; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0900, EVENT_CODE_900, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_910)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_910); + GTEST_LOG_(INFO) << "FMS_deleteForm_0900, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900); bool result = data == "false"; @@ -595,6 +896,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0900, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_deleteForm_1000" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -606,18 +908,30 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) std::string eventData = FORM_EVENT_REQ_DELETE_FORM_1000; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1000, EVENT_CODE_1000, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1010)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1010); + GTEST_LOG_(INFO) << "FMS_deleteForm_1000, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000); - bool result = data == "true"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1000, result:" << result; + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000); + bool result2 = (data2 != "false" && data2 != ""); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_1000, result2:" << result2; } // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); SystemTestFormUtil::CleanMsg(event); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(data2.c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(storageRes); + std::cout << "============END FMS_deleteForm_1000" << std::endl; } @@ -629,6 +943,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_deleteForm_1100" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; @@ -640,8 +955,16 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) std::string eventData = "true"; // temp form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_1100, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); + sleep(3); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formOne:[" << formOne << "]" << std::endl; if (formOne != "") { @@ -654,6 +977,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1100, EVENT_CODE_1100, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110); + GTEST_LOG_(INFO) << "FMS_deleteForm_1100, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formTwo:[" << formTwo << "]" << std::endl; @@ -692,6 +1022,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) { + sleep(3); int createFormCount = 10; std::string formIds[10] = {""}; std::cout << "============START FMS_deleteForm_1200" << std::endl; @@ -700,12 +1031,20 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) MAP_STR_STR params; for (int i=0; i>index:" << i; @@ -716,19 +1055,24 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) } } for (int i=0; i>index:" << i; - bool result = data == "true"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1201, result:" << result; + bool result2 = (data2 != "false" && data2 != ""); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_1201, result2:" << result2; } + bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(data2.c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(storageRes); } SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_deleteForm_1200" << std::endl; @@ -742,6 +1086,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1400, Function | MediumTest | Level2) { + sleep(3); std::cout << "============START FMS_deleteForm_1400" << std::endl; FMS_deleteForm_1400_A(); FMS_deleteForm_1400_B(); @@ -757,6 +1102,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1400, Function | MediumTest | Level2) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1500, Function | MediumTest | Level2) { + sleep(3); std::cout << "============START FMS_deleteForm_1500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; @@ -777,6 +1123,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1500, Function | MediumTest | Level2) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1600, Function | MediumTest | Level2) { + sleep(3); std::cout << "============START FMS_deleteForm_1600" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; @@ -800,6 +1147,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1600, Function | MediumTest | Level2) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1700, Function | MediumTest | Level2) { + sleep(3); std::cout << "============START FMS_deleteForm_1700" << std::endl; std::string bundleNameA = "com.ohos.form.manager.commona"; std::string abilityNameA = "FormAbilityCommonA"; @@ -890,12 +1238,20 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_A() MAP_STR_STR params; for (int i = 0; i < createFormCount; i++) { + sleep(7); Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); int tmp = 5; std::string eventData = ((i / tmp == 1) ? "true" : "false"); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_1400, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_deleteForm_1400[A], acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "========FMS_deleteForm_1400[A][#Create#]formId:[" << formIds[i] << "]======>>index:" << i; @@ -906,6 +1262,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_A() } } for (int i = 0; i < createFormCount; i++) { + sleep(7); Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); @@ -921,6 +1278,10 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_A() } EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formIds[i].c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(formIds[i].c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(storageRes); } } void FmsDeleteFormTest::FMS_deleteForm_1400_B() @@ -932,12 +1293,20 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_B() MAP_STR_STR params; for (int i = 0; i < createFormCount; i++) { + sleep(7); Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); int tmp = 5; std::string eventData = ((i / tmp == 1) ? "true" : "false"); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1400, EVENT_CODE_1400, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1410)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1410); + GTEST_LOG_(INFO) << "FMS_deleteForm_1400[B], acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400)); formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400); GTEST_LOG_(INFO) << "========FMS_deleteForm_1400[B][#Create#]formId:[" << formIds[i] << "]======>>index:" << i; @@ -948,6 +1317,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_B() } } for (int i = 0; i < createFormCount; i++) { + sleep(7); Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); @@ -963,10 +1333,15 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_B() } EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formIds[i].c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(formIds[i].c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(storageRes); } } void FmsDeleteFormTest::FMS_deleteForm_1500_Create_Delete(std::string delFormId, std::string &createFormId) { + sleep(3); std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; MAP_STR_STR params; @@ -976,8 +1351,16 @@ void FmsDeleteFormTest::FMS_deleteForm_1500_Create_Delete(std::string delFormId, // delete one and create one SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1501, EVENT_CODE_1510, delFormId); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510_1)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_1501, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "acquireSuccess"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510)); createFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510); + GTEST_LOG_(INFO) << "FMS_deleteForm_1501, createFormId:" << createFormId << std::endl; bool result = (createFormId != "deleteError" && createFormId != "acquireError" && createFormId != ""); EXPECT_TRUE(result); if (!result) { @@ -986,6 +1369,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1500_Create_Delete(std::string delFormId, } void FmsDeleteFormTest::FMS_deleteForm_1600_Delete_Create(std::string delFormId, std::string &createFormId) { + sleep(3); std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; MAP_STR_STR params; @@ -995,8 +1379,16 @@ void FmsDeleteFormTest::FMS_deleteForm_1600_Delete_Create(std::string delFormId, // delete one and create one SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1601, EVENT_CODE_1610, delFormId); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610_1)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_1601, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "acquireSuccess"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610)); createFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610); + GTEST_LOG_(INFO) << "FMS_deleteForm_1601, createFormId:" << createFormId << std::endl; bool result = (createFormId != "deleteError" && createFormId != "acquireError" && createFormId != ""); EXPECT_TRUE(result); if (!result) { @@ -1005,6 +1397,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1600_Delete_Create(std::string delFormId, } void FmsDeleteFormTest::FMS_deleteForm_1700_Delete_Create(std::string delFormId, std::string &createFormId) { + sleep(3); std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; MAP_STR_STR params; @@ -1014,23 +1407,39 @@ void FmsDeleteFormTest::FMS_deleteForm_1700_Delete_Create(std::string delFormId, // delete one and create one SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1701, EVENT_CODE_1701, delFormId); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1711)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1711); + GTEST_LOG_(INFO) << "FMS_deleteForm_1701, acquire data:" << data << std::endl; + bool result1 = data == "acquireSuccess"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701)); createFormId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701); - bool result = (createFormId != "deleteError" && createFormId != "acquireError" && createFormId != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1701, result:" << result; + GTEST_LOG_(INFO) << "FMS_deleteForm_1701, createFormId:" << createFormId << std::endl; + bool result2 = (createFormId != "deleteError" && createFormId != "acquireError" && createFormId != ""); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_1701, result2:" << result2; } } void FmsDeleteFormTest::FMS_deleteForm_1500_acquireForm(const std::string &bundleName, const std::string &abilityName, std::string &outformId) { + sleep(3); MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_DELETE_FORM_1500; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1500, EVENT_CODE_1500, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500_1)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_1500, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500)); std::string formId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500); GTEST_LOG_(INFO) << "========FMS_deleteForm_1500 [#Create#]formId:[" << formId << "]"; @@ -1044,6 +1453,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1500_acquireForm(const std::string &bundl void FmsDeleteFormTest::FMS_deleteForm_1500_clearForm(const std::string &bundleName, const std::string &abilityName, std::string &outformId) { + sleep(3); MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); @@ -1063,25 +1473,34 @@ void FmsDeleteFormTest::FMS_deleteForm_1500_clearForm(const std::string &bundleN void FmsDeleteFormTest::FMS_deleteForm_1600_acquireForm(const std::string &bundleName, const std::string &abilityName, std::string &outformId) { + sleep(3); MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_DELETE_FORM_1600; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1600, EVENT_CODE_1600, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600_1)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_1600, acquire data:" << data << std::endl; + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600)); std::string formId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600); GTEST_LOG_(INFO) << "========FMS_deleteForm_1600 [#Create#]formId:[" << formId << "]"; - bool result = (formId != "false" && formId != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1600, result:" << result; + bool result2 = (formId != "false" && formId != ""); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_1600, result2:" << result2; } FMS_deleteForm_1600_Delete_Create(formId, outformId); } void FmsDeleteFormTest::FMS_deleteForm_1600_clearForm(const std::string &bundleName, const std::string &abilityName, std::string &outformId) { + sleep(3); MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); @@ -1101,25 +1520,34 @@ void FmsDeleteFormTest::FMS_deleteForm_1600_clearForm(const std::string &bundleN void FmsDeleteFormTest::FMS_deleteForm_1700_acquireForm(const std::string &bundleName, const std::string &abilityName, std::string &outformId) { + sleep(7); MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_DELETE_FORM_1700; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1700, EVENT_CODE_1700, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1710)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1710); + GTEST_LOG_(INFO) << "FMS_deleteForm_1700, acquire data:" << data << std::endl; + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1700)); std::string formId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1700); GTEST_LOG_(INFO) << "========FMS_deleteForm_1700 [#Create#]formId:[" << formId << "]"; - bool result = (formId != "false" && formId != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1700, result:" << result; + bool result2 = (formId != "false" && formId != ""); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_deleteForm_1700, result2:" << result2; } FMS_deleteForm_1700_Delete_Create(formId, outformId); } void FmsDeleteFormTest::FMS_deleteForm_1700_clearForm(const std::string &bundleName, const std::string &abilityName, std::string &outformId) { + sleep(7); MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); @@ -1139,6 +1567,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1700_clearForm(const std::string &bundleN void FmsDeleteFormTest::FMS_acquireTempFormBatch(const std::string &bundleName, const std::string &abilityName, const int count) { + sleep(3); std::cout << "START FMS_acquireTempFormBatch" << std::endl; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); @@ -1164,6 +1593,7 @@ void FmsDeleteFormTest::FMS_acquireTempFormBatch(const std::string &bundleName, void FmsDeleteFormTest::FMS_acquireNormalFormBatch(const std::string &bundleName, const std::string &abilityName, const int count) { + sleep(3); std::cout << "START FMS_acquireNormalFormBatch" << std::endl; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); @@ -1186,6 +1616,7 @@ void FmsDeleteFormTest::FMS_acquireNormalFormBatch(const std::string &bundleName } void FmsDeleteFormTest::FMS_deleteFormBatch(const std::string &bundleName, const std::string &abilityName) { + sleep(3); std::cout << "START FMS_deleteFormBatch, delete forms" << std::endl; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); @@ -1200,5 +1631,29 @@ void FmsDeleteFormTest::FMS_deleteFormBatch(const std::string &bundleName, const GTEST_LOG_(INFO) << "FMS_deleteFormBatch, result:" << result; std::cout << "END FMS_deleteFormBatch, delete forms" << std::endl; } + +void FmsDeleteFormTest::FMS_deleteFormDeleteA(std::string strFormId) +{ + sleep(3); + std::cout << "START FMS_deleteFormDeleteA, start." << std::endl; + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityDeleteForm"; + std::cout << "START FMS_deleteFormDeleteA, bundleName: " << bundleName << std::endl; + std::cout << "START FMS_deleteFormDeleteA, abilityName: " << abilityName << std::endl; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + std::string eventData = strFormId; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); + // wait delete form + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); + bool result = data == "true"; + EXPECT_TRUE(result); + GTEST_LOG_(INFO) << "FMS_deleteFormDeleteA, delete form, result:" << result; + + std::cout << "END FMS_deleteFormDeleteA end" << std::endl; +} } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp index 57b6502c06..f546b55606 100644 --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -38,6 +38,19 @@ using namespace testing::ext; using namespace std::chrono_literals; using namespace OHOS::STtools; +namespace { +std::vector bundleNameList = { + "com.ohos.form.manager.notsystemapp", + "com.form.formsystemtestservicea", + "com.form.formsystemtestserviceb", +}; +std::vector hapNameList = { + "fmsSystemTestHostNotSys-signed", + "formSystemTestServiceA-signed", + "formSystemTestServiceB-signed", +}; +} // namespace + namespace OHOS { namespace AppExecFwk { class FmsReleaseFormTest : public testing::Test { @@ -105,6 +118,7 @@ void FmsReleaseFormTest::FormEventSubscriber::OnReceiveEvent(const CommonEventDa void FmsReleaseFormTest::SetUpTestCase() { std::cout << "START Install============" << std::endl; + SystemTestFormUtil::InstallHaps(hapNameList); if (!SubscribeEvent()) { GTEST_LOG_(INFO) << "SubscribeEvent error"; } @@ -113,6 +127,7 @@ void FmsReleaseFormTest::SetUpTestCase() void FmsReleaseFormTest::TearDownTestCase() { std::cout << "START Uninstall============" << std::endl; + SystemTestFormUtil::UninstallBundle(bundleNameList); CommonEventManager::UnSubscribeCommonEvent(subscriber); } @@ -163,6 +178,7 @@ bool FmsReleaseFormTest::SubscribeEvent() */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0100, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_releaseForm_0100" << std::endl; std::string bundleName = "com.ohos.form.manager.notsystemapp"; @@ -193,6 +209,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0100, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0200, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_releaseForm_0200" << std::endl; std::string bundleName = "com.ohos.form.manager.nopermission"; @@ -223,6 +240,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0200, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0300, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_releaseForm_0300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -234,12 +252,19 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0300, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_RELEASE_FORM_0300; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0300, EVENT_CODE_300, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_310)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_310); + GTEST_LOG_(INFO) << "FMS_releaseForm_0300, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300); - bool result = data == "false"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_0300, result:" << result; + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300); + bool result2 = data2 == "false"; + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_releaseForm_0300, result2:" << result2; } SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_releaseForm_0300" << std::endl; @@ -253,6 +278,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0300, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0400, Function | MediumTest | Level0) { + sleep(7); std::cout << "============START FMS_releaseForm_0400" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -264,12 +290,19 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0400, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_RELEASE_FORM_0400; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0400, EVENT_CODE_400, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_410)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_410); + GTEST_LOG_(INFO) << "FMS_releaseForm_0400, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400); - bool result = data == "false"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_0400, result:" << result; + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400); + bool result2 = data2 == "false"; + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_releaseForm_0400, result2:" << result2; } SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_releaseForm_0400" << std::endl; @@ -284,6 +317,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0400, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0500, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_releaseForm_0500" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -294,11 +328,19 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0500, Function | MediumTest | Level std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_releaseForm_0500, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); + std::string formID = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); + sleep(3); - GTEST_LOG_(INFO) << "FMS_releaseForm_0500, data:[" << data << "]" << std::endl; - if (data != "") { + GTEST_LOG_(INFO) << "FMS_releaseForm_0500, formID:[" << formID << "]" << std::endl; + if (formID != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; std::string abilityName2 = "FormAbilityReleaseForm"; MAP_STR_STR params2; @@ -306,7 +348,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0500, Function | MediumTest | Level SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = data; + std::string eventData2 = formID; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0500, EVENT_CODE_500, eventData2); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0500, EVENT_CODE_500)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0500, EVENT_CODE_500); @@ -315,7 +357,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0500, Function | MediumTest | Level if (!result) { GTEST_LOG_(INFO) << "FMS_releaseForm_0500, result:" << result; } - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, data); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formID); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); } SystemTestFormUtil::CleanMsg(event); @@ -331,6 +373,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0500, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0600, Function | MediumTest | Level0) { + sleep(3); std::cout << "============START FMS_releaseForm_0600" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -342,12 +385,19 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0600, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_RELEASE_FORM_0600; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0600, EVENT_CODE_600, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_610)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_610); + GTEST_LOG_(INFO) << "FMS_releaseForm_0600, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600); - bool result = data == "false"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_0600, result:" << result; + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600); + bool result2 = data2 == "false"; + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_releaseForm_0600, result2:" << result2; } SystemTestFormUtil::CleanMsg(event); @@ -363,6 +413,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0600, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_releaseForm_0700" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; @@ -374,9 +425,17 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_releaseForm_0700, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_releaseForm_0700, formOne:[" << formOne << "]" << std::endl; + sleep(3); if (formOne != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; std::string abilityName2 = "FormAbilityReleaseForm"; @@ -385,8 +444,16 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(7); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0700, EVENT_CODE_700, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_710)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_710); + GTEST_LOG_(INFO) << "FMS_releaseForm_0700, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700); bool result = formTwo == "true"; @@ -418,6 +485,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0800, Function | MediumTest | Level1) { + sleep(7); std::cout << "============START FMS_releaseForm_0800" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; @@ -429,9 +497,17 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0800, Function | MediumTest | Level std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_releaseForm_0800, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_releaseForm_0800, formOne:[" << formOne << "]" << std::endl; + sleep(7); if (formOne != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; std::string abilityName2 = "FormAbilityReleaseForm"; @@ -442,6 +518,13 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0800, Function | MediumTest | Level std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0800, EVENT_CODE_800, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810); + GTEST_LOG_(INFO) << "FMS_releaseForm_0800, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800); GTEST_LOG_(INFO) << "FMS_releaseForm_0800, formTwo:[" << formTwo << "]" << std::endl; @@ -450,6 +533,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0800, Function | MediumTest | Level if (!result) { GTEST_LOG_(INFO) << "FMS_releaseForm_0800, result:" << result; } + sleep(7); bool cacheRes = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); bool storageRes = FmsGetStorageFormInfos(atoll(formTwo.c_str())); bool timerRes = FmsGetFormTimerTask(atoll(formTwo.c_str())); @@ -473,6 +557,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0800, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0900, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_releaseForm_0900" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -484,27 +569,109 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0900, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_RELEASE_FORM_0900; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0900, EVENT_CODE_900, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_910)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_910); + GTEST_LOG_(INFO) << "FMS_releaseForm_0900, acquire data:" << data << std::endl; + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900); - GTEST_LOG_(INFO) << "FMS_releaseForm_0900, data:[" << data << "]" << std::endl; - bool result = (data != "false" && data != ""); + std::string formId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900); + GTEST_LOG_(INFO) << "FMS_releaseForm_0900, formId:[" << formId << "]" << std::endl; + bool result = (formId != "false" && formId != ""); EXPECT_TRUE(result); if (!result) { GTEST_LOG_(INFO) << "FMS_releaseForm_0900, result:" << result; } - bool cacheRes = FmsGetCacheInfoByFormId(atoll(data.c_str())); - bool hostRes = FmsGetHostInfoByFormId(atoll(data.c_str()), "com.ohos.form.manager.normal"); - bool storageRes = FmsGetStorageFormInfos(atoll(data.c_str())); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formId.c_str())); + bool hostRes = FmsGetHostInfoByFormId(atoll(formId.c_str()), "com.ohos.form.manager.normal"); + bool storageRes = FmsGetStorageFormInfos(atoll(formId.c_str())); + bool timerRes = FmsGetFormTimerTask(atoll(formId.c_str())); EXPECT_TRUE(cacheRes); EXPECT_FALSE(hostRes); EXPECT_TRUE(storageRes); - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, data); + EXPECT_FALSE(timerRes); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formId); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_releaseForm_0900" << std::endl; } +/** + * @tc.number: FMS_releaseForm_1000 + * @tc.name: form reference is not 0 after release form(isReleaseCache:true) + * @tc.desc: 1.host A create a normal formA + * 2.host B create a form with formA's ID + * 3.release formA(isReleaseCache:true), and verify the result is true + */ +HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1000, Function | MediumTest | Level1) +{ + sleep(3); + std::cout << "============START FMS_releaseForm_1000" << std::endl; + + std::string bundleName = "com.ohos.form.manager.commona"; + std::string abilityName = "FormAbilityCommonA"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData = "false"; // normal form + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_releaseForm_1000, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); + std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); + sleep(3); + + GTEST_LOG_(INFO) << "FMS_releaseForm_1000, formOne:[" << formOne << "]" << std::endl; + if (formOne != "") { + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityReleaseForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1000, EVENT_CODE_1000, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010); + GTEST_LOG_(INFO) << "FMS_releaseForm_1000, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000)); + std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000); + bool result = formTwo == "true"; + EXPECT_TRUE(result); + if (!result) { + GTEST_LOG_(INFO) << "FMS_releaseForm_1000, result:" << result; + } + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); + bool hostRes = FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal"); + bool storageRes = FmsGetStorageFormInfos(atoll(formOne.c_str())); + EXPECT_TRUE(cacheRes); + EXPECT_FALSE(hostRes); + EXPECT_TRUE(storageRes); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formOne); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); + } + SystemTestFormUtil::CleanMsg(event); + + std::cout << "============END FMS_releaseForm_1000" << std::endl; +} + /** * @tc.number: FMS_releaseForm_1100 * @tc.name: After releasing a normal form, the form reference is 0.(isReleaseCache:true) @@ -514,6 +681,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0900, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1100, Function | MediumTest | Level1) { + sleep(7); std::cout << "============START FMS_releaseForm_1100" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; @@ -525,9 +693,17 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1100, Function | MediumTest | Level std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); + GTEST_LOG_(INFO) << "FMS_releaseForm_1100, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_releaseForm_1100, formOne:[" << formOne << "]" << std::endl; + sleep(7); if (formOne != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; std::string abilityName2 = "FormAbilityReleaseForm"; @@ -538,6 +714,13 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1100, Function | MediumTest | Level std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1100, EVENT_CODE_1100, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110); + GTEST_LOG_(INFO) << "FMS_releaseForm_1100, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100); GTEST_LOG_(INFO) << "FMS_releaseForm_1100, formTwo:[" << formTwo << "]" << std::endl; @@ -570,6 +753,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1100, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1200, Function | MediumTest | Level1) { + sleep(7); std::cout << "============START FMS_releaseForm_1200" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -581,21 +765,30 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1200, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_RELEASE_FORM_1200; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1200, EVENT_CODE_1200, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1210)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1210); + GTEST_LOG_(INFO) << "FMS_releaseForm_1200, acquire data:" << data << std::endl; + bool result1 = data == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200); - GTEST_LOG_(INFO) << "FMS_releaseForm_1200, data:[" << data << "]" << std::endl; - bool result = (data != "false" && data != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1200, result:" << result; + std::string formID = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200); + GTEST_LOG_(INFO) << "FMS_releaseForm_1200, formID:[" << formID << "]" << std::endl; + bool result2 = (formID != "false" && formID != ""); + EXPECT_TRUE(result2); + if (!result2) { + GTEST_LOG_(INFO) << "FMS_releaseForm_1200, result2:" << result2; } - bool cacheRes = FmsGetCacheInfoByFormId(atoll(data.c_str())); - bool hostRes = FmsGetHostInfoByFormId(atoll(data.c_str()), "com.ohos.form.manager.normal"); - bool storageRes = FmsGetStorageFormInfos(atoll(data.c_str())); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formID.c_str())); + bool hostRes = FmsGetHostInfoByFormId(atoll(formID.c_str()), "com.ohos.form.manager.normal"); + bool timerRes = FmsGetFormTimerTask(atoll(formID.c_str())); + bool storageRes = FmsGetStorageFormInfos(atoll(formID.c_str())); EXPECT_FALSE(cacheRes); EXPECT_FALSE(hostRes); + EXPECT_FALSE(timerRes); EXPECT_TRUE(storageRes); - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, data); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formID); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_releaseForm_1200" << std::endl; @@ -609,6 +802,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1200, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level2) { + sleep(3); std::cout << "============START FMS_releaseForm_1300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -620,27 +814,58 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level std::string eventData = ""; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1300, EVENT_CODE_1300, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300); - bool result = data != ""; + std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300); + bool result = formOne != ""; EXPECT_TRUE(result); if (!result) { GTEST_LOG_(INFO) << "FMS_releaseForm_1300, result:" << result; } - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, data:[" << data << "]" << std::endl; - if (data != "") { - std::string eventData2 = data; + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formOne:[" << formOne << "]" << std::endl; + sleep(3); + if (formOne != "") { + std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1300, EVENT_CODE_1300, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, acquire data2:" << data1 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - if (!result2) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, result2:" << result2; + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301)); + std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301); + bool result3 = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result3); + if (!result3) { + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, result3:" << result3; } + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formTwo:[" << formTwo << "]" << std::endl; + + bool cacheRes1 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); + bool timerRes1 = FmsGetFormTimerTask(atoll(formOne.c_str())); + bool storageRes1 = FmsGetStorageFormInfos(atoll(formOne.c_str())); + EXPECT_FALSE(cacheRes1); + EXPECT_FALSE(timerRes1); + EXPECT_TRUE(storageRes1); + bool cacheRes2 = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); + bool timerRes2 = FmsGetFormTimerTask(atoll(formTwo.c_str())); + bool storageRes2 = FmsGetStorageFormInfos(atoll(formTwo.c_str())); + EXPECT_FALSE(cacheRes2); + EXPECT_FALSE(timerRes2); + EXPECT_TRUE(storageRes2); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formOne); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); } - SystemTestFormUtil::CleanMsg(event); + SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_releaseForm_1300" << std::endl; } @@ -652,6 +877,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level */ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1400, Function | MediumTest | Level1) { + sleep(3); std::cout << "============START FMS_releaseForm_1400" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -663,72 +889,31 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1400, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_RELEASE_FORM_1400; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1400, EVENT_CODE_1400, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1410)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1410); + GTEST_LOG_(INFO) << "FMS_releaseForm_1400, acquire data1:" << data1 << std::endl; + bool result1 = data1 == "true"; + EXPECT_TRUE(result1); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400); - bool result = data == "true"; + std::string formId = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400); + GTEST_LOG_(INFO) << "FMS_releaseForm_1400, formId:[" << formId << "]" << std::endl; + bool result = (formId != "false" && formId != ""); EXPECT_TRUE(result); if (!result) { GTEST_LOG_(INFO) << "FMS_releaseForm_1400, result:" << result; } - SystemTestFormUtil::CleanMsg(event); - - std::cout << "============END FMS_releaseForm_1400" << std::endl; -} -/** - * @tc.number: FMS_releaseForm_1000 - * @tc.name: form reference is not 0 after release form(isReleaseCache:true) - * @tc.desc: 1.host A create a normal formA - * 2.host B create a form with formA's ID - * 3.release formA(isReleaseCache:true), and verify the result is true - */ -HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1000, Function | MediumTest | Level1) -{ - std::cout << "============START FMS_releaseForm_1000" << std::endl; - - std::string bundleName = "com.ohos.form.manager.commona"; - std::string abilityName = "FormAbilityCommonA"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = "false"; // normal form - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); - std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); - - GTEST_LOG_(INFO) << "FMS_releaseForm_1000, formOne:[" << formOne << "]" << std::endl; - if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityReleaseForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formId.c_str())); + bool timerRes = FmsGetFormTimerTask(atoll(formId.c_str())); + EXPECT_FALSE(cacheRes); + EXPECT_FALSE(timerRes); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formId); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1000, EVENT_CODE_1000, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000); - bool result = formTwo == "true"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1000, result:" << result; - } - bool cacheRes = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); - bool hostRes = FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal"); - bool storageRes = FmsGetStorageFormInfos(atoll(formOne.c_str())); - EXPECT_TRUE(cacheRes); - EXPECT_FALSE(hostRes); - EXPECT_TRUE(storageRes); - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formOne); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); - } SystemTestFormUtil::CleanMsg(event); - - std::cout << "============END FMS_releaseForm_1000" << std::endl; + std::cout << "============END FMS_releaseForm_1400" << std::endl; } bool FmsReleaseFormTest::FmsGetCacheInfoByFormId(std::int64_t formId) { diff --git a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp index 9fdbbdb5da..6d106d6ed7 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp +++ b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp @@ -50,25 +50,19 @@ namespace OHOS { namespace AppExecFwk { static SelfStartingTestInfo selfStarting; static SelfStartingTestConfigParser selfStartingParser; -const int ADD_FORM_A_NUMBER = 10; -const int ADD_FORM_LENGTH = 20; +const int ADD_FORM_A_NUMBER = 256; +const int ADD_FORM_LENGTH = 512; class FmsSelfStartingTest : public testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); static bool SubscribeEvent(); - bool CompareA(); - bool CompareB(); + static bool CompareA(); + static bool CompareB(); void SetUp(); void TearDown(); - - void StartAbilityKitTest(const std::string &abilityName, const std::string &bundleName); - void TerminateAbility(const std::string &eventName, const std::string &abilityName); - void ClearStorage(); - bool CheckKvStore(); - void TryTwice(const std::function &func); class FormEventSubscriber : public CommonEventSubscriber { public: @@ -155,30 +149,48 @@ void FmsSelfStartingTest::SetUpTestCase() bool FmsSelfStartingTest::CompareA() { - bool compare = true; + bool compare = false; for (int iCount = 0; iCount < ADD_FORM_A_NUMBER; iCount++) { + compare = false; int64_t formId = iCount + 1; - InnerFormInfo innerFormInfo; - selfStartingParser.GetStorageFormInfoById(std::to_string(formId), innerFormInfo); - if (innerFormInfo.GetFormId() != formId) { - compare = false; - break; - } - if (innerFormInfo.GetModuleName() != PARAM_PROVIDER_MODULE_NAME1) { - compare = false; - break; - } - if (innerFormInfo.GetBundleName() != FORM_PROVIDER_BUNDLE_NAME1) { - compare = false; - break; + std::string formInfos = STtools::SystemTestFormUtil::QueryStorageFormInfos(); + if(formInfos.length() == 0){ + GTEST_LOG_(INFO) << "get formInfos failed"; + return compare; } - if (innerFormInfo.GetAbilityName() != FORM_PROVIDER_ABILITY_NAME1) { - compare = false; - break; + char *token = strtok(formInfos.data(), LINE_SEPARATOR.data()); + std::string formInfo; + while(token!=NULL){ + formInfo = token; + size_t pos = formInfo.find(" FormId #" + std::to_string(formId) + " "); + if(pos != std::string::npos){ + compare = true; + break; + } + token = strtok(NULL, LINE_SEPARATOR.data()); } - if (innerFormInfo.GetFormName() != PARAM_FORM_NAME1) { - compare = false; - break; + + if(compare){ + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } + pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } } } return compare; @@ -186,30 +198,48 @@ bool FmsSelfStartingTest::CompareA() bool FmsSelfStartingTest::CompareB() { - bool compare = true; + bool compare = false; for (int iCount = ADD_FORM_A_NUMBER; iCount < ADD_FORM_LENGTH; iCount++) { + compare = false; int64_t formId = iCount + 1; - InnerFormInfo innerFormInfo; - selfStartingParser.GetStorageFormInfoById(std::to_string(formId), innerFormInfo); - if (innerFormInfo.GetFormId() != formId) { - compare = false; - break; - } - if (innerFormInfo.GetModuleName() != PARAM_PROVIDER_MODULE_NAME2) { - compare = false; - break; + std::string formInfos = STtools::SystemTestFormUtil::QueryStorageFormInfos(); + if(formInfos.length() == 0){ + GTEST_LOG_(INFO) << "get formInfos failed"; + return compare; } - if (innerFormInfo.GetBundleName() != FORM_PROVIDER_BUNDLE_NAME2) { - compare = false; - break; - } - if (innerFormInfo.GetAbilityName() != FORM_PROVIDER_ABILITY_NAME2) { - compare = false; - break; + char *token = strtok(formInfos.data(), LINE_SEPARATOR.data()); + std::string formInfo; + while(token!=NULL){ + formInfo = token; + size_t pos = formInfo.find(" FormId #" + std::to_string(formId) + " "); + if(pos != std::string::npos){ + compare = true; + break; + } + token = strtok(NULL, LINE_SEPARATOR.data()); } - if (innerFormInfo.GetFormName() != PARAM_FORM_NAME2) { - compare = false; - break; + + if(compare){ + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME2 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME2 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME2 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } + pos = formInfo.find(" formName [" + PARAM_FORM_NAME2 + "]"); + if(pos == std::string::npos){ + compare = false; + break; + } } } return compare; @@ -234,7 +264,7 @@ void FmsSelfStartingTest::TearDownTestCase() int64_t formId = iCount + 1; int errorCode = STtools::SystemTestFormUtil::DistributedDataDeleteForm(std::to_string(formId)); if (errorCode != 0) { - GTEST_LOG_(INFO) << "delete form failed, iCount:" << ", errorCode:" << errorCode; + GTEST_LOG_(INFO) << "delete form failed, iCount:" << iCount << ", errorCode:" << errorCode; } } selfStartingParser.ClearStorage(); @@ -272,26 +302,27 @@ HWTEST_F(FmsSelfStartingTest, FMS_Start_0300_03, Function | MediumTest | Level1) { std::cout << "START FMS_Start_0300_03" << std::endl; - if (selfStarting.compareStatus) { + if(selfStarting.compareStatus){ std::ifstream opbefore("/data/formmgr/beforeKill.txt"); std::ifstream opafter("/data/formmgr/afterKill.txt"); std::string beforeKill; std::string afterKill; - while (!opbefore.eof()) { + while(!opbefore.eof()){ beforeKill += opbefore.get(); } - while (!opafter.eof()) { + while(!opafter.eof()){ afterKill += opafter.get(); } opbefore.close(); opafter.close(); EXPECT_TRUE(beforeKill != afterKill); - - EXPECT_TRUE(CompareA()); - EXPECT_TRUE(CompareB()); + EXPECT_TRUE(FmsSelfStartingTest::CompareA()); + + EXPECT_TRUE(FmsSelfStartingTest::CompareB()); } std::cout << "END FMS_Start_0300_03" << std::endl; } + } // namespace AppExecFwk -} // namespace OHOS +} // namespace OHOS \ No newline at end of file diff --git a/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h b/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h index ea7898007a..bc31c7d145 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h +++ b/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h @@ -148,49 +148,6 @@ public: return status; } - bool GetStorageFormInfoById(const std::string &formId, InnerFormInfo &innerFormInfo) - { - { - std::lock_guard lock(kvStorePtrMutex_); - if (!CheckKvStore()) { - GTEST_LOG_(INFO) << "kvStore is nullptr"; - return false; - } - } - bool ret = true; - APP_LOGD("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); - - DistributedKv::Status status = DistributedKv::Status::ERROR; - std::vector allEntries; - DistributedKv::Key key(formId); - if (kvStorePtr_) { - // sync call GetEntries, the callback will be trigger at once - status = kvStorePtr_->GetEntries(key, allEntries); - } - - if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("get entries error: %{public}d", status); - ret = false; - } else { - if (allEntries.empty()) { - APP_LOGE("%{public}s not match any FormInfo", formId.c_str()); - ret = false; - } else { - nlohmann::json jsonObject = nlohmann::json::parse(allEntries.front().value.ToString(), nullptr, false); - if (jsonObject.is_discarded()) { - APP_LOGE("error key: %{private}s", allEntries.front().key.ToString().c_str()); - ret = false; - } - if (innerFormInfo.FromJson(jsonObject) != true) { - APP_LOGE("error key: %{private}s", allEntries.front().key.ToString().c_str()); - ret = false; - } - } - } - - return ret; - } - const DistributedKv::AppId appId_ {"form_storage"}; const DistributedKv::StoreId storeId_ {"installed_form_datas"}; DistributedKv::DistributedKvDataManager dataManager_; @@ -199,6 +156,8 @@ public: const int32_t MAX_TIMES = 600; // 1min const int32_t SLEEP_INTERVAL = 100 * 1000; // 100ms }; + + } // namespace AppExecFwk } // namespace OHOS diff --git a/tools/fm/src/fms_command.cpp b/tools/fm/src/fms_command.cpp index 462165df9a..bcc3b184ed 100755 --- a/tools/fm/src/fms_command.cpp +++ b/tools/fm/src/fms_command.cpp @@ -445,7 +445,7 @@ int FormMgrShellCommand::GetStringInfo(IFormMgr::Message code, MessageParcel &da std::vector stringInfoList; if (!reply.ReadStringVector(&stringInfoList)) { APP_LOGE("%{public}s, failed to read string vector from reply", __func__); - return false; + return ERR_APPEXECFWK_PARCEL_ERROR; } if (stringInfoList.empty()) { APP_LOGI("%{public}s, No string info", __func__); -- Gitee From 6541142580e4894daa9b7e33da28567128f3a02d Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 14:37:55 +0800 Subject: [PATCH 02/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../common/fms/common/include/system_test_form_util.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/systemtest/common/fms/common/include/system_test_form_util.h b/test/systemtest/common/fms/common/include/system_test_form_util.h index 0a55a8ffdd..666a65f8d0 100755 --- a/test/systemtest/common/fms/common/include/system_test_form_util.h +++ b/test/systemtest/common/fms/common/include/system_test_form_util.h @@ -348,12 +348,6 @@ private: */ static sptr GetInstallerProxy(); - /** - * @brief Get form manager service. - * @return Returns form manager servic remoteObject. - */ - static sptr GetFmsService(); - static bool WriteInterfaceToken(MessageParcel &data); static int GetStringInfo(AppExecFwk::IFormMgr::Message code, MessageParcel &data, std::string &stringInfo); static int SendTransactCmd(AppExecFwk::IFormMgr::Message code, MessageParcel &data, MessageParcel &reply); -- Gitee From de2f814d21ce5778c3eb44f3c0658c99f7840aca Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 15:00:59 +0800 Subject: [PATCH 03/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms/fms_acquire_form_test/fms_acquire_form_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index 46aea62fb3..a0ff0df225 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -898,8 +898,8 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_3800, Function | MediumTest | Level std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_3800; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_3800, EVENT_CODE_3800, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802); - bool result1 = data == "true"; + std::string data3 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3802); + bool result1 = data3 == "true"; EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_3800, EVENT_CODE_3800 + 1)); @@ -1435,4 +1435,4 @@ bool FmsAcquireFormTest::CompareForm(std::string formInfo) return compare; } } // namespace AppExecFwk -} // namespace OHOS \ No newline at end of file +} // namespace OHOS -- Gitee From d8d082f1dacec4763a11ab21dac2c9cf75b96ded Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 15:09:03 +0800 Subject: [PATCH 04/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../include/fuzz_test_config_parser.h | 32 ++++++++----------- .../fms_fuzz_test/include/fuzz_test_manager.h | 8 +++-- .../fms/fms_fuzz_test/src/fms_fuzz_test.cpp | 2 +- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h index d042b5684e..e4ec9f973d 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h @@ -50,26 +50,22 @@ public: continue; } - PushBackParam(it, ftd); - } - } - void PushBackParam(const auto &it, FuzzTestData &ftd) - { - auto className = it.key(); - if (it->is_structured()) { - for (auto itm = it->begin(); itm != it->end(); ++itm) { - auto methodName = itm.key(); - if (!(it->is_structured() && (it->size() != 0))) { - ftd.methodVec.push_back(className + methodName); - continue; - } + auto className = it.key(); + if (it->is_structured()) { + for (auto itm = it->begin(); itm != it->end(); ++itm) { + auto methodName = itm.key(); + if (!(it->is_structured() && (it->size() != 0))) { + ftd.methodVec.push_back(className + methodName); + continue; + } - std::string param {}; - for (auto itp = itm->begin(); itp != itm->end(); ++itp) { - auto tp = itp.value(); - param += tp; + std::string param {}; + for (auto itp = itm->begin(); itp != itm->end(); ++itp) { + auto tp = itp.value(); + param += tp; + } + ftd.methodVec.push_back(className + methodName + param); } - ftd.methodVec.push_back(className + methodName + param); } } } diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index 913b6924e0..6cb77dbc08 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -16,7 +16,6 @@ #define FormManagerFuzzTest_H #include -#include #include #include @@ -25,13 +24,13 @@ namespace OHOS { namespace AppExecFwk { class FuzzTestManager { public: - using std::shared_ptr Ptr; + typedef std::shared_ptr Ptr; ~FuzzTestManager() {} static Ptr GetInstance() { if (fuzzTestInstance == nullptr) { - fuzzTestInstance = std::shared_ptr(std::make_shared FuzzTestManager); + fuzzTestInstance = std::shared_ptr(new FuzzTestManager); } return fuzzTestInstance; } @@ -39,6 +38,9 @@ public: void StartFuzzTest(); private: + void RegisterFormManagerAbilityA(); + void RegisterFormManagerAbilityB(); + void RegisterFormManagerAbilityC(); void SetJsonFunction(std::string); void SetExecutionTimes(uint16_t executionTimes); FuzzTestManager(); diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp index ee78075c9c..ca972a6468 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp @@ -65,7 +65,7 @@ HWTEST_F(FmsFuzzTest, FMS_fuzztest_0100, Function | MediumTest | Level1) { std::cout << "Begin FMS_fuzztest_0100" << std::endl; - FormManagerFuzzTest::GetInstance()->StartFuzzTest(); + FuzzTestManager::GetInstance()->StartFuzzTest(); std::cout << "End FMS_fuzztest_0100" << std::endl; } -- Gitee From 2f48f961a61fbf94fec63b540c851f2107b929c5 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 15:28:46 +0800 Subject: [PATCH 05/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp index b5c2ec92fc..dd4ee4707d 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp @@ -29,9 +29,8 @@ namespace OHOS { namespace AppExecFwk { const int zero = 0; const int two = 2; -const int CHAR_MIN = -128; -const int CHAR_MAX = 127; -const int STRING_MAX = 256; +const int MINCHAR = -128; +const int MAXCHAR = 127; bool GetBoolParam() { bool param; @@ -197,7 +196,7 @@ float GetFloatParam() char GetCharParam() { std::random_device rd; - static uniform_int_distribution<> u(CHAR_MIN, CHAR_MAX); + static uniform_int_distribution<> u(MINCHAR, MAXCHAR); static default_random_engine e(rd()); char param = u(e); return param; -- Gitee From 520f00835bb83936d2852938699da1b5503bcb5f Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 15:50:29 +0800 Subject: [PATCH 06/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms/fms_acquire_form_test/fms_acquire_form_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index a0ff0df225..ce892b21e0 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -290,8 +290,8 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_acquireForm_1500, add no catch form start"; std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_1500_1; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_1500_1, EVENT_CODE_1510, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1512)); + std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1512); bool result1 = data == "true"; EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510)); -- Gitee From 5ea5113dc3d1572ba4ce6fa37aa709a43c9253d1 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 15:54:27 +0800 Subject: [PATCH 07/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../formsystemtestability/fmsSystemTestHostNormal/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn index 97d3331b98..acf930d530 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn @@ -26,6 +26,7 @@ config("fmsSystemTestHostNormalConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/kits/appkit/native/app", "${appexecfwk_path}/services/bundlemgr/include", + "${appexecfwk_path}/interfaces/innerkits/fmskit/native/include", "//foundation/distributedschedule/dmsfwk/services/dtbschedmgr/include", "//utils/system/safwk/native/include", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/appmgr", @@ -61,6 +62,7 @@ ohos_shared_library("fmsSystemTestHostNormal") { "${appexecfwk_path}/common:libappexecfwk_common", "${appexecfwk_path}/kits:appkit_native", "${appexecfwk_path}/services/bundlemgr:libbms", + "${appexecfwk_path}/interfaces/innerkits/fmskit:fmskit_native", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", "//foundation/distributedschedule/dmsfwk/interfaces/innerkits/uri:zuri", "//third_party/jsoncpp:jsoncpp", -- Gitee From e9a4c4ca12a072f4c8eac489a7bdcfc200f23e15 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 16:45:22 +0800 Subject: [PATCH 08/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fmsSystemTestHostNormalC/src/form_ability_c.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp index 1df3c77e6a..ff2ffae966 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp @@ -82,9 +82,10 @@ void FormAbilityC::FMS_acquireForm_3100(std::string data) bool bResult = AcquireForm(0, want, callback); if (bResult) { APP_LOGI("AcquireForm end"); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3102, "true"); } else { APP_LOGE("AcquireForm error"); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100, ""); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3102, ""); } } @@ -265,4 +266,4 @@ void FormEventSubscriber::KitTerminateAbility() REGISTER_AA(FormAbilityC) } // namespace AppExecFwk -} // namespace OHOS \ No newline at end of file +} // namespace OHOS -- Gitee From f8fb74bd16763daaf09101d79c5ca15f11e9d924 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 16:48:26 +0800 Subject: [PATCH 09/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../formsystemtestability/fmsSystemTestHostNormal/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn index acf930d530..80b1e2ee7f 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn @@ -60,9 +60,9 @@ ohos_shared_library("fmsSystemTestHostNormal") { "${aafwk_path}/frameworks/kits/ability/native:abilitykit_native", "${aafwk_path}/services/abilitymgr:abilityms", "${appexecfwk_path}/common:libappexecfwk_common", + "${appexecfwk_path}/interfaces/innerkits/fmskit:fmskit_native", "${appexecfwk_path}/kits:appkit_native", "${appexecfwk_path}/services/bundlemgr:libbms", - "${appexecfwk_path}/interfaces/innerkits/fmskit:fmskit_native", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", "//foundation/distributedschedule/dmsfwk/interfaces/innerkits/uri:zuri", "//third_party/jsoncpp:jsoncpp", -- Gitee From 61390ba8cc0684b9486a0fca5fc53fb2d80df132 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 19:12:17 +0800 Subject: [PATCH 10/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .vscode/settings.json | 5 + .../src/form_ability_releaseform.cpp | 3 +- .../fms/common/src/system_test_form_util.cpp | 1 - .../fms_acquire_form_test.cpp | 92 +++++------ .../fms_acquire_form_test_batch.cpp | 102 ++++++------ .../fms_delete_form_test.cpp | 153 ++++++------------ .../fms_release_form_test.cpp | 35 ---- .../fms_self_starting_test.cpp | 43 +++-- .../self_starting_test_config_parser.h | 2 - 9 files changed, 176 insertions(+), 260 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..930ff05066 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.tcc": "cpp" + } +} \ No newline at end of file diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index ba51ab4327..1e7fe329d5 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -490,7 +490,8 @@ void FormAbilityReleaseForm::ReleaseForm_1300(int64_t form_id, std::string lastF bool bResult2 = ReleaseForm(atoll(lastFormId.c_str()), isReleaseCache); if (bResult2) { APP_LOGI("%{public}s ReleaseForm end", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, std::to_string(atoll(lastFormId.c_str()))); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, + std::to_string(atoll(lastFormId.c_str()))); } else { APP_LOGE("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, "false"); diff --git a/test/systemtest/common/fms/common/src/system_test_form_util.cpp b/test/systemtest/common/fms/common/src/system_test_form_util.cpp index b2809defd5..1f35dddb5d 100755 --- a/test/systemtest/common/fms/common/src/system_test_form_util.cpp +++ b/test/systemtest/common/fms/common/src/system_test_form_util.cpp @@ -754,6 +754,5 @@ int SystemTestFormUtil::DistributedDataDeleteForm(const std::string formId) } return reply.ReadInt32(); } - } // namespace STtools } // namespace OHOS \ No newline at end of file diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index ce892b21e0..d2ef077229 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -57,6 +57,8 @@ std::string catchFormId; // FormId when creating a cached form namespace OHOS { namespace AppExecFwk { class FmsAcquireFormTest : public testing::Test { +const int THREE = 3; +const int SEVEN = 7; public: static void SetUpTestCase(); static void TearDownTestCase(); @@ -165,7 +167,7 @@ bool FmsAcquireFormTest::SubscribeEvent() */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_1100" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -222,7 +224,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1200, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_1200" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -279,7 +281,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1200, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_1500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -330,15 +332,15 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1500, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1600, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); int normalCount = 0; int tempCount = 0; for (int iCount = 0; iCount < 5; iCount++) { - sleep(7); + sleep(SEVEN); FmsAcquireForm1600(); normalCount++; std::cout << "END FMS_acquireForm_1600, normal form end, count:" << normalCount << std::endl; - sleep(7); + sleep(SEVEN); FmsAcquireForm1600A(); tempCount++; std::cout << "END FMS_acquireForm_1600_1, temp form end, count:" << tempCount << std::endl; @@ -352,13 +354,13 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1600, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1800, Function | MediumTest | Level1) { - sleep(7); + sleep(SEVEN); FmsAcquireForm1800(); - sleep(7); + sleep(SEVEN); FmsAcquireForm1800A(); - sleep(7); + sleep(SEVEN); FmsAcquireForm1800B(); - sleep(7); + sleep(SEVEN); FmsAcquireForm1800C(); } @@ -369,7 +371,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1800, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1900, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_1900" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -423,11 +425,11 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1900, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2400, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::string strFormId = FmsAcquireForm2400(); - sleep(3); + sleep(THREE); FmsAcquireForm2400_1(strFormId); - sleep(3); + sleep(THREE); FmsAcquireFormDeleteA(strFormId); } @@ -441,7 +443,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2400, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2600, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2600" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -498,7 +500,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2600, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0100, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0100" << std::endl; std::string bundleName = "com.ohos.form.manager.notsystemapp"; @@ -526,7 +528,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0100, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0200, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0200" << std::endl; std::string bundleName = "com.ohos.form.manager.nopermission"; @@ -554,7 +556,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0200, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -581,7 +583,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300_1, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0300_1" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -609,7 +611,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0300_1, Function | MediumTest | Lev */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0400, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0400" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -636,7 +638,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0400, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0500, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -663,7 +665,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0500, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0600, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0600" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -691,7 +693,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0600, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0700, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_0700" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -719,7 +721,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_0700, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1000, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_1000" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -747,7 +749,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1000, Function | MediumTest | Level HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1400, Function | MediumTest | Level1) { BeforeAcquireForm2100(); - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_1400" << std::endl; std::string bundleName = "com.ohos.form.manager.normalb"; std::string abilityName = "FormAbilityB"; @@ -775,7 +777,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1400, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2100, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2100" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -787,13 +789,13 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2100, Function | MediumTest | Level std::string eventData = catchFormId; GTEST_LOG_(INFO) << "FMS_acquireForm_2100, formId:" << eventData; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2100, EVENT_CODE_2100, eventData); - sleep(7); + sleep(SEVEN); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100); bool result = data == "false"; EXPECT_TRUE(result); GTEST_LOG_(INFO) << "FMS_acquireForm_2100, result:" << result; - sleep(3); + sleep(THREE); FmsAcquireFormDeleteA(catchFormId); std::cout << "END FMS_acquireForm_2100" << std::endl; } @@ -805,7 +807,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2100, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2200, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2200" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -832,7 +834,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2200, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2300, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -859,7 +861,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2300, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2500, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2500" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -886,7 +888,7 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_2500, Function | MediumTest | Level */ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_3800, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3800" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -1002,7 +1004,7 @@ void FmsAcquireFormTest::FmsAcquireForm1600() GTEST_LOG_(INFO) << "FMS_acquireForm_1600, formId:" << strFormId; } - sleep(7); + sleep(SEVEN); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1601)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1601); bool result2 = !data2.empty(); @@ -1049,7 +1051,7 @@ void FmsAcquireFormTest::FmsAcquireForm1600A() GTEST_LOG_(INFO) << "FMS_acquireForm_1600_1 formId:" << strFormId1; } - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1611)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1611); bool result5 = !data4.empty(); @@ -1096,7 +1098,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800() GTEST_LOG_(INFO) << "FMS_acquireForm_1800, formId:" << strFormId; } - sleep(7); + sleep(SEVEN); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1801)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1801); bool result2 = !data2.empty(); @@ -1147,7 +1149,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800A() GTEST_LOG_(INFO) << "FMS_acquireForm_1800_1 formId:" << strFormId1; } - sleep(7); + sleep(SEVEN); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1811)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1811); bool result5 = !data4.empty(); @@ -1197,7 +1199,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800B() GTEST_LOG_(INFO) << "FMS_acquireForm_1800_2, formId:" << strFormId; } - sleep(7); + sleep(SEVEN); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1821)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1821); bool result2 = !data2.empty(); @@ -1244,7 +1246,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800C() GTEST_LOG_(INFO) << "FMS_acquireForm_1800_3 formId:" << strFormId1; } - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, EVENT_CODE_1831)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, EVENT_CODE_1831); bool result5 = !data4.empty(); @@ -1268,7 +1270,7 @@ void FmsAcquireFormTest::FmsAcquireForm1800C() void FmsAcquireFormTest::BeforeAcquireForm2100() { - sleep(3); + sleep(THREE); std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; MAP_STR_STR params; @@ -1330,7 +1332,7 @@ std::string FmsAcquireFormTest::FmsAcquireForm2400() GTEST_LOG_(INFO) << "FMS_acquireForm_2400, formId:" << strFormId; } - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2401)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2401); bool result2 = !data2.empty(); @@ -1383,7 +1385,7 @@ void FmsAcquireFormTest::FmsAcquireFormDeleteA(std::string strFormId) std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form - sleep(7); + sleep(SEVEN); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -1417,19 +1419,19 @@ bool FmsAcquireFormTest::CompareForm(std::string formInfo) bool compare = true; size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); - if(pos == std::string::npos){ + if (pos == std::string::npos) { compare = false; } pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); - if(pos == std::string::npos){ + if (pos == std::string::npos) { compare = false; } pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); - if(pos == std::string::npos){ + if (pos == std::string::npos) { compare = false; } pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); - if(pos == std::string::npos){ + if (pos == std::string::npos) { compare = false; } return compare; diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp index 526285982d..8b77e75f4f 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp @@ -171,20 +171,20 @@ bool FmsAcquireFormTestBatch::SubscribeEvent() */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2900, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2900" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; int countA = Constants::MAX_RECORD_PER_APP/2; int countB = Constants::MAX_RECORD_PER_APP/2 - 1; - sleep(3); + sleep(THREE); FMS_acquireFormBatchA(bundleName, abilityName, countA); - sleep(3); + sleep(THREE); FMS_acquireFormBatchB(bundleName, abilityName, countB); int count = Constants::MAX_RECORD_PER_APP - 1; std::cout << "FMS_acquireForm_2900, form size of the host A:" << count << std::endl; - sleep(3); + sleep(THREE); std::string strFormId = FmsAcquireForm2900A(); normalFormsMaxA.emplace_back(strFormId); std::cout << "END FMS_acquireForm_2900" << std::endl; @@ -196,7 +196,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2900, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3000, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3000" << std::endl; std::cout << "FMS_acquireForm_3000, form size of the host A:" << normalFormsMaxA.size() << std::endl; FmsAcquireForm3000(); @@ -212,14 +212,14 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3000, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2700, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2700" << std::endl; std::cout << "FMS_acquireForm_2700, form size of the host A:" << normalFormsMaxA.size() << std::endl; std::string bundleNameA = "com.ohos.form.manager.normal"; std::string abilityNameA = "FormAbilityA"; std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - sleep(3); + sleep(THREE); FmsAcquireForm2700(strFormId); std::cout << "END FMS_acquireForm_2700" << std::endl; @@ -230,7 +230,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2700, Function | MediumTest | FmsAcquireFormDeleteA(normalFormsMaxA[count]); } } - sleep(3); + sleep(THREE); FMS_deleteFormBatch(); std::cout << "the host A, delete form end" << std::endl; } @@ -242,7 +242,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2700, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3100" << std::endl; std::cout << "START add form to the host A" << std::endl; @@ -254,7 +254,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | std::cout << "count:" << FORM_COUNT_200 << std::endl; std::cout << "END add form to the host A" << std::endl; - sleep(3); + sleep(THREE); std::cout << "START add form to the host B" << std::endl; std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; @@ -264,7 +264,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | std::cout << "count:" << FORM_COUNT_200 << std::endl; std::cout << "END add form to the host B" << std::endl; - sleep(3); + sleep(THREE); std::cout << "START add form to the host C" << std::endl; std::string bundleNameC = "com.ohos.form.manager.normalc"; std::string abilityNameC = "FormAbilityC"; @@ -274,7 +274,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | std::cout << "count:" << FORM_COUNT_111 << std::endl; std::cout << "END add form to the host C" << std::endl; - sleep(3); + sleep(THREE); std::string formId = FmsAcquireForm3100(bundleNameC, abilityNameC); normalFormsMaxC.emplace_back(formId); std::cout << "END FMS_acquireForm_3100" << std::endl; @@ -289,7 +289,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3100, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2800, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_2800" << std::endl; std::cout << "FMS_acquireForm_2800, form size of the host A:" << FORM_COUNT_200 << std::endl; std::cout << "FMS_acquireForm_2800, form size of the host B:" << FORM_COUNT_200 << std::endl; @@ -299,7 +299,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2800, Function | MediumTest | std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); - sleep(3); + sleep(THREE); FmsAcquireForm2800(strFormId); std::cout << "END FMS_acquireForm_2800" << std::endl; @@ -313,7 +313,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2800, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3200, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3200" << std::endl; std::cout << "FMS_acquireForm_3200, form size of the host A:" << FORM_COUNT_200 << std::endl; std::cout << "FMS_acquireForm_3200, form size of the host B:" << FORM_COUNT_200 << std::endl; @@ -324,11 +324,11 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3200, Function | MediumTest | std::cout << "dlete form start" << std::endl; if (normalFormsMaxC.size() > 0) { for (int count = 0; count < normalFormsMaxC.size(); count++) { - sleep(3); + sleep(THREE); FmsAcquireFormDeleteC(normalFormsMaxC[count]); } } - sleep(3); + sleep(THREE); FMS_deleteFormBatch(); std::cout << "dlete form end" << std::endl; } @@ -339,7 +339,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3200, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3300, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3300" << std::endl; std::cout << "START add temp form to the host A" << std::endl; @@ -350,16 +350,16 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3300, Function | MediumTest | FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_256 - 1); std::cout << "FMS_acquireForm_3300, temp form size of the host A:" << (TEMP_FORM_COUNT_256 - 1)<< std::endl; - sleep(3); + sleep(THREE); std::string strFormId = FmsAcquireFormTemp(bundleNameA, abilityNameA); std::cout << "FMS_acquireForm_3300, temp form size of the host A:" << TEMP_FORM_COUNT_256 << std::endl; std::cout << "END add temp form to the host A" << std::endl; std::cout << "END FMS_acquireForm_3300" << std::endl; - sleep(3); + sleep(THREE); std::cout << "the host A, dlete temp form start" << std::endl; FmsAcquireFormDeleteA(strFormId); - sleep(3); + sleep(THREE); FMS_deleteFormBatch(); std::cout << "the host A, dlete temp form end" << std::endl; } @@ -370,7 +370,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3300, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3400" << std::endl; std::cout << "START add temp form to the host A" << std::endl; @@ -382,7 +382,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | std::cout << "FMS_acquireForm_3400, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host A" << std::endl; - sleep(3); + sleep(THREE); std::cout << "START add temp form to the host B" << std::endl; std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; @@ -390,15 +390,15 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | std::cout << "abilityName: " << abilityNameB << std::endl; FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128 - 1); std::cout << "FMS_acquireForm_3400, temp form size:" << (TEMP_FORM_COUNT_128 - 1) << std::endl; - sleep(3); + sleep(THREE); std::string strFormId = FmsAcquireFormTemp(bundleNameB, abilityNameB); std::cout << "FMS_acquireForm_3400, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host B" << std::endl; - sleep(3); + sleep(THREE); std::cout << "FMS_acquireForm_3400, dlete temp form start" << std::endl; FmsAcquireFormDeleteB(strFormId); - sleep(3); + sleep(THREE); FMS_deleteFormBatch(); std::cout << "FMS_acquireForm_3400, dlete temp form end" << std::endl; @@ -412,7 +412,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3400, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3500" << std::endl; std::cout << "START add temp form to the host A" << std::endl; std::string bundleNameA = "com.ohos.form.manager.normal"; @@ -422,7 +422,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3500, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host A" << std::endl; - sleep(3); + sleep(THREE); std::cout << "START add temp form to the host B" << std::endl; std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; @@ -431,13 +431,13 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3500, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; std::cout << "END add temp form to the host B" << std::endl; - sleep(3); + sleep(THREE); bool result = FmsAcquireFormTempForFailed(bundleNameB, abilityNameB); EXPECT_TRUE(result); if (result) { std::cout << "END add temp form to the host B, Failed to create the 257th temporary form." << std::endl; } - sleep(3); + sleep(THREE); std::cout << "FMS_acquireForm_3500, dlete temp form start" << std::endl; FMS_deleteFormBatch(); std::cout << "FMS_acquireForm_3500, dlete temp form end" << std::endl; @@ -452,7 +452,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3500, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3600, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3600" << std::endl; std::string bundleNameA = "com.ohos.form.manager.normal"; std::string abilityNameA = "FormAbilityA"; @@ -460,37 +460,37 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3600, Function | MediumTest | std::cout << "abilityName: " << abilityNameA << std::endl; FMS_acquireFormBatchA(bundleNameA, abilityNameA, FORM_COUNT_200); std::cout << "FMS_acquireForm_3600, normal form size:" << FORM_COUNT_200 << std::endl; - sleep(3); + sleep(THREE); std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; std::cout << "bundleName: " << bundleNameB << std::endl; std::cout << "abilityName: " << abilityNameB << std::endl; FMS_acquireFormBatchA(bundleNameB, abilityNameB, FORM_COUNT_200); std::cout << "FMS_acquireForm_3600, normal form size:" << FORM_COUNT_200 << std::endl; - sleep(3); + sleep(THREE); std::string bundleNameC = "com.ohos.form.manager.normalc"; std::string abilityNameC = "FormAbilityC"; std::cout << "bundleName: " << bundleNameC << std::endl; std::cout << "abilityName: " << abilityNameC << std::endl; FMS_acquireFormBatchA(bundleNameC, abilityNameC, FORM_COUNT_111); std::cout << "FMS_acquireForm_3600, normal form size:" << FORM_COUNT_111 << std::endl; - sleep(3); + sleep(THREE); std::cout << "bundleName: " << bundleNameA << std::endl; std::cout << "abilityName: " << abilityNameA << std::endl; FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3600, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; - sleep(3); + sleep(THREE); std::cout << "bundleName: " << bundleNameB << std::endl; std::cout << "abilityName: " << abilityNameB << std::endl; FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3600, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; - sleep(3); + sleep(THREE); bool result = FmsAcquireFormTempForFailed(bundleNameA, abilityNameA); EXPECT_TRUE(result); if (result) { std::cout << "END add temp form to the host B, Failed to create the 257th temporary form." << std::endl; } - sleep(3); + sleep(THREE); std::cout << "FMS_acquireForm_3600, dlete temp form start" << std::endl; FMS_deleteFormBatch(); std::cout << "FMS_acquireForm_3600, dlete temp form end" << std::endl; @@ -504,7 +504,7 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3600, Function | MediumTest | */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3700, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "START FMS_acquireForm_3700" << std::endl; std::string bundleNameA = "com.ohos.form.manager.normal"; std::string abilityNameA = "FormAbilityA"; @@ -512,33 +512,33 @@ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_3700, Function | MediumTest | std::cout << "abilityName: " << abilityNameA << std::endl; FMS_acquireFormBatchA(bundleNameA, abilityNameA, FORM_COUNT_200); std::cout << "FMS_acquireForm_3700, normal form size:" << FORM_COUNT_200 << std::endl; - sleep(3); + sleep(THREE); std::string bundleNameB = "com.ohos.form.manager.normalb"; std::string abilityNameB = "FormAbilityB"; std::cout << "bundleName: " << bundleNameB << std::endl; std::cout << "abilityName: " << abilityNameB << std::endl; FMS_acquireFormBatchA(bundleNameB, abilityNameB, FORM_COUNT_200); std::cout << "FMS_acquireForm_3700, normal form size:" << FORM_COUNT_200 << std::endl; - sleep(3); + sleep(THREE); std::string bundleNameC = "com.ohos.form.manager.normalc"; std::string abilityNameC = "FormAbilityC"; std::cout << "bundleName: " << bundleNameC << std::endl; std::cout << "abilityName: " << abilityNameC << std::endl; FMS_acquireFormBatchA(bundleNameC, abilityNameC, FORM_COUNT_112); std::cout << "FMS_acquireForm_3700, normal form size:" << FORM_COUNT_112 << std::endl; - sleep(3); + sleep(THREE); std::cout << "bundleName: " << bundleNameA << std::endl; std::cout << "abilityName: " << abilityNameA << std::endl; FMS_acquireTempFormBatch(bundleNameA, abilityNameA, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3700, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; - sleep(3); + sleep(THREE); std::cout << "bundleName: " << bundleNameB << std::endl; std::cout << "abilityName: " << abilityNameB << std::endl; FMS_acquireTempFormBatch(bundleNameB, abilityNameB, TEMP_FORM_COUNT_128); std::cout << "FMS_acquireForm_3700, temp form size:" << TEMP_FORM_COUNT_128 << std::endl; - sleep(3); + sleep(THREE); FmsAcquireForm3700(); - sleep(3); + sleep(THREE); std::cout << "FMS_acquireForm_3700, dlete temp form start" << std::endl; FMS_deleteFormBatch(); std::cout << "FMS_acquireForm_3700, dlete temp form end" << std::endl; @@ -593,7 +593,7 @@ void FmsAcquireFormTestBatch::FmsAcquireForm2700(std::string strFormId) EXPECT_TRUE(result3); GTEST_LOG_(INFO) << "FmsAcquireForm2700, result:" << result3; // wait delete form - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result4 = data4 == "true"; @@ -660,7 +660,7 @@ std::string FmsAcquireFormTestBatch::FmsAcquireForm2900A() std::string eventData = FORM_EVENT_REQ_ACQUIRE_FORM_2900; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ACQUIRE_FORM_2900, EVENT_CODE_2900, eventData); - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2902)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2902); bool result1 = data == "true"; @@ -856,7 +856,7 @@ bool FmsAcquireFormTestBatch::FmsAcquireFormTempForFailed(const std::string &bun void FmsAcquireFormTestBatch::FmsAcquireFormDeleteA(const std::string &strFormId) { - sleep(3); + sleep(THREE); std::cout << "START FmsAcquireFormDeleteA, start." << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityA"; @@ -869,7 +869,7 @@ void FmsAcquireFormTestBatch::FmsAcquireFormDeleteA(const std::string &strFormId std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -893,7 +893,7 @@ void FmsAcquireFormTestBatch::FmsAcquireFormDeleteB(const std::string &strFormId std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -916,7 +916,7 @@ void FmsAcquireFormTestBatch::FmsAcquireFormDeleteC(const std::string &strFormId std::string eventData = strFormId; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_COMMON, EVENT_CODE_999, eventData); // wait delete form - sleep(3); + sleep(THREE); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999); bool result = data == "true"; @@ -936,7 +936,7 @@ void FmsAcquireFormTestBatch::FMS_deleteFormBatch() SystemTestFormUtil::StartAbility(want, abilityMs); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_CLEAR_FORM_BATCH; - sleep(3); + sleep(THREE); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_CLEAR_FORM_BATCH, EVENT_CODE_TEMP, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH); diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index d7de1362ba..9e0a8dec3a 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -54,6 +54,8 @@ std::vector hapNameList = { namespace OHOS { namespace AppExecFwk { class FmsDeleteFormTest : public testing::Test { +const int SEVEN = 7; +const int THREE = 3; public: static void SetUpTestCase(); static void TearDownTestCase(); @@ -103,7 +105,7 @@ public: void FMS_acquireNormalFormBatch(const std::string &bundleName, const std::string &abilityName, const int count); void FMS_deleteFormBatch(const std::string &bundleName, const std::string &abilityName); - void FMS_deleteFormDeleteA(std::string delFormId); + void FMS_deleteFormDeleteA(std::string strFormId); }; std::vector FmsDeleteFormTest::eventList = { @@ -243,7 +245,7 @@ bool FmsDeleteFormTest::SubscribeEvent() */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0100, Function | MediumTest | Level0) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0100" << std::endl; std::string bundleName = "com.ohos.form.manager.notsystemapp"; @@ -274,7 +276,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0100, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0200, Function | MediumTest | Level0) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0200" << std::endl; std::string bundleName = "com.ohos.form.manager.nopermission"; @@ -305,7 +307,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0200, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0300, Function | MediumTest | Level0) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0300" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -347,7 +349,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0300, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0400, Function | MediumTest | Level0) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0400" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -389,7 +391,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0400, Function | MediumTest | Level0) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0500, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0500" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; @@ -452,7 +454,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0500, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0600" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -460,16 +462,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_deleteForm_0600, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0600, formOne:[" << formOne << "]" << std::endl; @@ -480,16 +479,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0600, EVENT_CODE_600, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610); GTEST_LOG_(INFO) << "FMS_deleteForm_0600, acquire data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600); bool result = formTwo == "true"; @@ -500,7 +496,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) // can't receive onDelete EXPECT_EQ(-1, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); - bool cacheRes = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool hostRes = FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal"); bool storageRes = FmsGetStorageFormInfos(atoll(formOne.c_str())); @@ -525,7 +520,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0700" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -533,16 +528,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_deleteForm_0700, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formOne:[" << formOne << "]" << std::endl; @@ -554,17 +546,14 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - sleep(7); + sleep(SEVEN); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700, EVENT_CODE_700, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710); GTEST_LOG_(INFO) << "FMS_deleteForm_0700, acquire data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700); GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formTwo:[" << formTwo << "]" << std::endl; @@ -573,7 +562,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) if (!result) { GTEST_LOG_(INFO) << "FMS_deleteForm_0700, result:" << result; } - // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, @@ -585,7 +573,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) EXPECT_FALSE(cacheRes); EXPECT_FALSE(storageRes); EXPECT_FALSE(timerRes); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formOne:" << std::endl; bool cacheRes2 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool storageRes2 = FmsGetStorageFormInfos(atoll(formOne.c_str())); @@ -593,7 +580,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) EXPECT_TRUE(cacheRes2); EXPECT_TRUE(storageRes2); EXPECT_TRUE(timerRes2); - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, @@ -612,7 +598,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0700_1" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -620,16 +606,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_001, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formOne:[" << formOne << "]" << std::endl; @@ -641,16 +624,14 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(3); + sleep(THREE); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_1, EVENT_CODE_700_1, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, acquire data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formTwo:[" << formTwo << "]" << std::endl; @@ -659,12 +640,9 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level if (!result) { GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, result:" << result; } - want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - // can receive onDelete SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL_001, EVENT_CODE_101)); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, @@ -677,9 +655,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level EXPECT_FALSE(storageRes); EXPECT_FALSE(timerResA); EXPECT_TRUE(timerResB); - - FMS_deleteFormDeleteA(formTwo); - + FMS_deleteFormDeleteA(formTwo); } SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_deleteForm_0700_1" << std::endl; @@ -694,7 +670,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0700_2" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -704,13 +680,11 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_001, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_001, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, formOne:[" << formOne << "]" << std::endl; @@ -722,16 +696,14 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(3); + sleep(THREE); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_2, EVENT_CODE_700_2, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, acquire formTwo:[" << formTwo << "]" << std::endl; @@ -740,7 +712,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level if (!result) { GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, result:" << result; } - // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2,EVENT_CODE_700_2)); std::string onDeleteData = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); @@ -773,7 +744,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) { - sleep(7); + sleep(SEVEN); std::cout << "============START FMS_deleteForm_0800" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -783,17 +754,15 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = "false"; // normal form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_deleteForm_0800, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0800, formOne:[" << formOne << "]" << std::endl; - sleep(7); + sleep(SEVEN); EXPECT_TRUE(formOne != ""); if (formOne != "") { std::string bundleName = "com.ohos.form.manager.normal"; @@ -804,13 +773,11 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0800; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0800, EVENT_CODE_800, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810); GTEST_LOG_(INFO) << "FMS_deleteForm_0800, acquire data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800); bool result = (data != "false" && data != ""); @@ -853,25 +820,21 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0900, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_0900" << std::endl; - std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0900; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0900, EVENT_CODE_900, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_910)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_910); GTEST_LOG_(INFO) << "FMS_deleteForm_0900, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900)); std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900); bool result = data == "false"; @@ -879,11 +842,9 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0900, Function | MediumTest | Level1) if (!result) { GTEST_LOG_(INFO) << "FMS_deleteForm_0900, result:" << result; } - // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); SystemTestFormUtil::CleanMsg(event); - std::cout << "============END FMS_deleteForm_0900" << std::endl; } @@ -896,7 +857,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0900, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_1000" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; @@ -927,7 +888,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); SystemTestFormUtil::CleanMsg(event); - bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); bool storageRes = FmsGetStorageFormInfos(atoll(data2.c_str())); EXPECT_FALSE(cacheRes); EXPECT_FALSE(storageRes); @@ -943,29 +904,24 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) { - sleep(3); + sleep(THREE); std::cout << "============START FMS_deleteForm_1100" << std::endl; - std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = "true"; // temp form SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, acquire data1:" << data1 << std::endl; bool result1 = data1 == "true"; EXPECT_TRUE(result1); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); - sleep(3); - + sleep(THREE); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formOne:[" << formOne << "]" << std::endl; if (formOne != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; @@ -974,16 +930,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1100, EVENT_CODE_1100, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, acquire data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100)); std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formTwo:[" << formTwo << "]" << std::endl; @@ -992,14 +945,12 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) if (!result) { GTEST_LOG_(INFO) << "FMS_deleteForm_1100, result:" << result; } - // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK); GTEST_LOG_(INFO) << "00000, onDeleteData:[" << onDeleteData << "]" << std::endl; EXPECT_TRUE(onDeleteData == formTwo); - bool cacheRes = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); EXPECT_FALSE(cacheRes); bool cacheRes2 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); @@ -1010,7 +961,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); } SystemTestFormUtil::CleanMsg(event); - std::cout << "============END FMS_deleteForm_1100" << std::endl; } @@ -1022,29 +972,26 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) { - sleep(3); + sleep(THREE); int createFormCount = 10; std::string formIds[10] = {""}; std::cout << "============START FMS_deleteForm_1200" << std::endl; std::string bundleName = "com.ohos.form.manager.normal"; std::string abilityName = "FormAbilityDeleteForm"; MAP_STR_STR params; - for (int i=0; i>index:" << i; @@ -1055,7 +1002,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) } } for (int i=0; i Date: Wed, 1 Dec 2021 19:50:21 +0800 Subject: [PATCH 11/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp | 2 +- .../common/fms/fms_delete_form_test/fms_delete_form_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index d2ef077229..64d44b21f6 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -56,9 +56,9 @@ std::string catchFormId; // FormId when creating a cached form namespace OHOS { namespace AppExecFwk { -class FmsAcquireFormTest : public testing::Test { const int THREE = 3; const int SEVEN = 7; +class FmsAcquireFormTest : public testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index 9e0a8dec3a..2ddf18f868 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -53,9 +53,9 @@ std::vector hapNameList = { namespace OHOS { namespace AppExecFwk { -class FmsDeleteFormTest : public testing::Test { const int SEVEN = 7; const int THREE = 3; +class FmsDeleteFormTest : public testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); -- Gitee From a087f5ae96c4086227b81b3a202c8f1ed091f91d Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 20:26:42 +0800 Subject: [PATCH 12/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms_acquire_form_test.cpp | 97 ++++++++++++------- .../fms_acquire_form_test_batch.cpp | 2 + 2 files changed, 66 insertions(+), 33 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index 64d44b21f6..babc351df3 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -95,7 +95,7 @@ public: void FmsAcquireForm2400_1(std::string strFormId); void FmsAcquireFormDeleteA(std::string strFormId); void FMS_deleteFormBatch(); - bool CompareForm(std::string formInfo); + bool CompareCacheFormData(std::string formInfo); }; std::vector FmsAcquireFormTest::eventList = { @@ -196,19 +196,14 @@ HWTEST_F(FmsAcquireFormTest, FMS_acquireForm_1100, Function | MediumTest | Level catchFormId = strFormId; EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1101)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1101); - bool result2 = !data2.empty(); - EXPECT_TRUE(result2); - if (!result2) { - GTEST_LOG_(INFO) << "FMS_acquireForm_1100, result:" << result2; - } else { - GTEST_LOG_(INFO) << "FMS_acquireForm_1100, formData:" << data2; - } + std::string formData = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1101); + GTEST_LOG_(INFO) << "FMS_acquireForm_1100, formData:" << formData; + EXPECT_EQ("{\"city\":\"beijingA\"}", formData); + int64_t formId = std::stoll(strFormId); std::string cachedData = SystemTestFormUtil::QueryFormInfoByFormId(formId); GTEST_LOG_(INFO) << "FMS_acquireForm_1100, cachedData:" << cachedData; - - EXPECT_TRUE(CompareForm(cachedData)); + EXPECT_TRUE(CompareCacheFormData(cachedData)); int errorCode = STtools::SystemTestFormUtil::DistributedDataDeleteForm(std::to_string(formId)); if (errorCode != 0) { @@ -965,9 +960,13 @@ void FmsAcquireFormTest::FmsAcquireFormCatched1500(std::string strFormId) int64_t formId = std::stoll(strFormId2); std::string cachedData = SystemTestFormUtil::QueryFormInfoByFormId(formId); - GTEST_LOG_(INFO) << "FMS_acquireForm_1100, cachedData:" << cachedData; + GTEST_LOG_(INFO) << "FMS_acquireForm_1500, cachedData:" << cachedData; + + EXPECT_TRUE(CompareCacheFormData(cachedData)); - EXPECT_TRUE(CompareForm(cachedData)); + std::string storageData = SystemTestFormUtil::QueryStorageFormInfos(); + GTEST_LOG_(INFO) << "FMS_acquireForm_1500, storageData:" << storageData; + EXPECT_TRUE(!storageData.empty()); // wait delete form EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999)); @@ -1414,27 +1413,59 @@ void FmsAcquireFormTest::FMS_deleteFormBatch() std::cout << "END FMS_deleteFormBatch, delete form cache" << std::endl; } -bool FmsAcquireFormTest::CompareForm(std::string formInfo) -{ - bool compare = true; - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); - if (pos == std::string::npos) { - compare = false; - } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); - if (pos == std::string::npos) { - compare = false; - } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); - if (pos == std::string::npos) { - compare = false; - } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); - if (pos == std::string::npos) { - compare = false; - } - return compare; +bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) +{ + bool result = false; + do { + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare moduleName error."; + break; + } + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare bundleName error."; + break; + } + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare abilityName error."; + break; + } + pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare formName error."; + break; + } + pos = formInfo.find(" isInited [1]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare isInited error."; + break; + } + pos = formInfo.find(" updateAtHour [10]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare updateAtHour error."; + break; + } + pos = formInfo.find(" updateAtMin [30]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare updateAtMin error."; + break; + } + pos = formInfo.find(" hapSourceDirs [ hapSourceDir [/data/accounts/account_0/applications/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare hapSourceDirs error."; + break; + } + pos = formInfo.find(" formCacheData [{\"city\":\"beijingA\"}]"); + if (pos == std::string::npos) { + GTEST_LOG_(INFO) << "Compare formCacheData error."; + break; + } + result = true; + } while (false); + return result; } } // namespace AppExecFwk } // namespace OHOS diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp index 8b77e75f4f..175e47f450 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp @@ -64,6 +64,8 @@ std::vector tempFormsMaxB; namespace OHOS { namespace AppExecFwk { +const int THREE = 3; +const int SEVEN = 7; class FmsAcquireFormTestBatch : public testing::Test { public: static void SetUpTestCase(); -- Gitee From e76c55079d6c9ed14419c7b79d643bde992b17f8 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 22:02:04 +0800 Subject: [PATCH 13/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .vscode/settings.json | 63 ++++++++++++++++++- .../include/form_ability_releaseform.h | 1 + .../src/form_ability_releaseform.cpp | 36 +++++++---- .../fms/common/include/form_st_common_info.h | 2 + .../fms_acquire_form_test.cpp | 5 +- .../fms_acquire_form_test_batch.cpp | 1 - .../fms_delete_form_test.cpp | 6 +- .../fms_fuzz_test/include/fuzz_test_manager.h | 26 ++++---- .../fms_release_form_test.cpp | 47 +++++++++----- .../fms_self_starting_test.cpp | 12 ++++ 10 files changed, 156 insertions(+), 43 deletions(-) mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_releaseform.h mode change 100644 => 100755 test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp mode change 100644 => 100755 test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp diff --git a/.vscode/settings.json b/.vscode/settings.json index 930ff05066..8fbaa7c426 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,66 @@ { "files.associations": { - "*.tcc": "cpp" + "*.tcc": "cpp", + "array": "cpp", + "atomic": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "condition_variable": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "list": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "map": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "shared_mutex": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "typeinfo": "cpp", + "variant": "cpp" } } \ No newline at end of file diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_releaseform.h b/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_releaseform.h old mode 100644 new mode 100755 index a596482858..a50dfd02f5 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_releaseform.h +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/include/form_ability_releaseform.h @@ -40,6 +40,7 @@ public: void FMS_releaseForm_1300(std::string data); void FMS_releaseForm_1400(std::string data); void FMS_releaseForm_common_del(std::string data); + void FMS_releaseForm_common_del_001(std::string data); void Clear(std::string case_id, int64_t form_id); std::shared_ptr subscriber_; diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp old mode 100644 new mode 100755 index 1e7fe329d5..07a0de9209 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -356,6 +356,18 @@ void FormAbilityReleaseForm::FMS_releaseForm_common_del(std::string data) FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, "false"); } } +void FormAbilityReleaseForm::FMS_releaseForm_common_del_001(std::string data) +{ + APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + bool bResult = DeleteForm(atoll(data.c_str())); + if (bResult) { + APP_LOGI("%{public}s DeleteForm end", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, EVENT_CODE_101, "true"); + } else { + APP_LOGE("%{public}s DeleteForm error", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, EVENT_CODE_101, "false"); + } +} void FormAbilityReleaseForm::ReleaseForm_0300(int64_t form_id) { @@ -487,15 +499,6 @@ void FormAbilityReleaseForm::ReleaseForm_1300(int64_t form_id, std::string lastF FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, std::to_string(form_id)); } else { bool isReleaseCache = true; - bool bResult2 = ReleaseForm(atoll(lastFormId.c_str()), isReleaseCache); - if (bResult2) { - APP_LOGI("%{public}s ReleaseForm end", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, - std::to_string(atoll(lastFormId.c_str()))); - } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); - FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, "false"); - } bool bResult1 = ReleaseForm(form_id, isReleaseCache); if (bResult1) { APP_LOGI("%{public}s ReleaseForm end", __func__); @@ -504,6 +507,14 @@ void FormAbilityReleaseForm::ReleaseForm_1300(int64_t form_id, std::string lastF APP_LOGE("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301, "false"); } + bool bResult2 = ReleaseForm(atoll(lastFormId.c_str()), isReleaseCache); + if (bResult2) { + APP_LOGI("%{public}s ReleaseForm end", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302, "true"); + } else { + APP_LOGE("%{public}s ReleaseForm error", __func__); + FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302, "false"); + } } } void FormAbilityReleaseForm::ReleaseForm_1400(int64_t form_id) @@ -537,7 +548,8 @@ void FormAbilityReleaseForm::OnStart(const Want &want) FORM_EVENT_REQ_RELEASE_FORM_1200, FORM_EVENT_REQ_RELEASE_FORM_1300, FORM_EVENT_REQ_RELEASE_FORM_1400, - FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL + FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, + FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001 }; SubscribeEvent(eventList); } @@ -600,6 +612,7 @@ void FormAbilityReleaseForm::Init(const std::shared_ptr &abilityInf memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_1300] = &FormAbilityReleaseForm::FMS_releaseForm_1300; memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_1400] = &FormAbilityReleaseForm::FMS_releaseForm_1400; memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL] = &FormAbilityReleaseForm::FMS_releaseForm_common_del; + memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001] = &FormAbilityReleaseForm::FMS_releaseForm_common_del_001; } void FormAbilityReleaseForm::handleEvent(std::string action, std::string data) @@ -634,7 +647,8 @@ void FormEventSubscriberForReleaseForm::OnReceiveEvent(const CommonEventData &da eventName == FORM_EVENT_REQ_RELEASE_FORM_0700 || eventName == FORM_EVENT_REQ_RELEASE_FORM_0800 || eventName == FORM_EVENT_REQ_RELEASE_FORM_0900 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1000 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1100 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1200 || - eventName == FORM_EVENT_REQ_RELEASE_FORM_1300 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1400) { + eventName == FORM_EVENT_REQ_RELEASE_FORM_1300 || eventName == FORM_EVENT_REQ_RELEASE_FORM_1400 || + eventName == FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001) { return; } else { CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/systemtest/common/fms/common/include/form_st_common_info.h b/test/systemtest/common/fms/common/include/form_st_common_info.h index cf602448d6..0efb00e945 100755 --- a/test/systemtest/common/fms/common/include/form_st_common_info.h +++ b/test/systemtest/common/fms/common/include/form_st_common_info.h @@ -241,6 +241,8 @@ const std::string FORM_EVENT_REQ_RELEASE_FORM_1400 = "fms_req_releaseForm_1400"; const std::string FORM_EVENT_RECV_RELEASE_FORM_1400 = "fms_recv_releaseForm_1400"; const std::string FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL = "fms_req_releaseForm_common_del"; const std::string FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL = "fms_recv_releaseForm_common_del"; +const std::string FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001 = "fms_req_releaseForm_common_del_001"; +const std::string FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001 = "fms_recv_releaseForm_common_del_001"; // Stress Test const std::string FORM_EVENT_REQ_STRESS_TEST_0100 = "fms_req_stressTest_0100"; diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index babc351df3..b53c7f5f2d 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1453,7 +1453,10 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) GTEST_LOG_(INFO) << "Compare updateAtMin error."; break; } - pos = formInfo.find(" hapSourceDirs [ hapSourceDir [/data/accounts/account_0/applications/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"); + std::string hapDirHeader = " hapSourceDirs [ hapSourceDir ["; + Std::string hapDirPath = "/data/accounts/account_0/applications/" + + "com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"; + pos = formInfo.find(hapDirHeader + hapDirPath); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare hapSourceDirs error."; break; diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp index 175e47f450..3b096aeac8 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp @@ -65,7 +65,6 @@ std::vector tempFormsMaxB; namespace OHOS { namespace AppExecFwk { const int THREE = 3; -const int SEVEN = 7; class FmsAcquireFormTestBatch : public testing::Test { public: static void SetUpTestCase(); diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index 2ddf18f868..58ca64845a 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -655,7 +655,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level EXPECT_FALSE(storageRes); EXPECT_FALSE(timerResA); EXPECT_TRUE(timerResB); - FMS_deleteFormDeleteA(formTwo); + FMS_deleteFormDeleteA(formTwo); } SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_deleteForm_0700_1" << std::endl; @@ -712,7 +712,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level if (!result) { GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, result:" << result; } - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2,EVENT_CODE_700_2)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); std::string onDeleteData = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); EXPECT_TRUE(onDeleteData == formTwo); @@ -794,7 +794,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); - bool cacheResA = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); + bool cacheResA = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool storageResA = FmsGetStorageFormInfos(atoll(formOne.c_str())); bool cacheResB = FmsGetCacheInfoByFormId(atoll(data.c_str())); bool storageResB = FmsGetStorageFormInfos(atoll(data.c_str())); diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index 6cb77dbc08..e772f94961 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -16,24 +16,28 @@ #define FormManagerFuzzTest_H #include +#include #include #include #include "nlohmann/json.hpp" namespace OHOS { namespace AppExecFwk { -class FuzzTestManager { +class FuzzTestManager final : public DelayedRefSingleton { + DECLARE_DELAYED_REF_SINGLETON(FuzzTestManager) public: - typedef std::shared_ptr Ptr; - ~FuzzTestManager() - {} - static Ptr GetInstance() - { - if (fuzzTestInstance == nullptr) { - fuzzTestInstance = std::shared_ptr(new FuzzTestManager); - } - return fuzzTestInstance; - } + // typedef std::shared_ptr Ptr; + // ~FuzzTestManager() + // {} + // static Ptr GetInstance() + // { + // if (fuzzTestInstance == nullptr) { + // fuzzTestInstance = std::make_shared(); + // } + // return fuzzTestInstance; + // } + + DISALLOW_COPY_AND_MOVE(FuzzTestManager); void StartFuzzTest(); diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp old mode 100644 new mode 100755 index 9ecb125eb3..7875ba675b --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -100,6 +100,7 @@ std::vector FmsReleaseFormTest::eventList = { FORM_EVENT_RECV_RELEASE_FORM_1300, FORM_EVENT_RECV_RELEASE_FORM_1400, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, + FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, FORM_EVENT_RECV_ONE_NORMAL_FORM, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL }; @@ -158,6 +159,7 @@ bool FmsReleaseFormTest::SubscribeEvent() FORM_EVENT_RECV_RELEASE_FORM_1300, FORM_EVENT_RECV_RELEASE_FORM_1400, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, + FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, FORM_EVENT_RECV_ONE_NORMAL_FORM, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL }; @@ -419,18 +421,21 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level std::string abilityName = "FormAbilityCommonA"; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = "false"; // normal form - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, eventData); + + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_100, "false"); // normal form EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110)); + std::string data1 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_110); GTEST_LOG_(INFO) << "FMS_releaseForm_0700, acquire data1:" << data1 << std::endl; - bool result1 = data1 == "true"; - EXPECT_TRUE(result1); + EXPECT_EQ("true", data1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); + std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_releaseForm_0700, formOne:[" << formOne << "]" << std::endl; + sleep(3); if (formOne != "") { std::string bundleName2 = "com.ohos.form.manager.normal"; @@ -439,27 +444,26 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(7); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0700, EVENT_CODE_700, eventData2); + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0700, EVENT_CODE_700, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_710)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_710); + GTEST_LOG_(INFO) << "FMS_releaseForm_0700, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); + EXPECT_EQ("true", data2); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700)); + std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700); bool result = formTwo == "true"; EXPECT_TRUE(result); if (!result) { GTEST_LOG_(INFO) << "FMS_releaseForm_0700, result:" << result; } - bool cacheRes = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); - bool hostRes = FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal"); - bool storageRes = FmsGetStorageFormInfos(atoll(formOne.c_str())); - EXPECT_TRUE(cacheRes); - EXPECT_FALSE(hostRes); - EXPECT_TRUE(storageRes); + + EXPECT_TRUE(FmsGetCacheInfoByFormId(atoll(formOne.c_str()));); + EXPECT_FALSE(FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal");); + EXPECT_TRUE(FmsGetStorageFormInfos(atoll(formOne.c_str()))); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formOne); @@ -804,7 +808,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1300, EVENT_CODE_1300, eventData2); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310)); std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310); - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, acquire data2:" << data1 << std::endl; + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, acquire data2:" << data2 << std::endl; bool result2 = data2 == "true"; EXPECT_TRUE(result2); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301)); @@ -815,6 +819,13 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_releaseForm_1300, result3:" << result3; } GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formTwo:[" << formTwo << "]" << std::endl; + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302)); + std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, release data4:" << data4 << std::endl; + bool result4 = data4 == "true"; + EXPECT_TRUE(result4); + bool cacheRes1 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool timerRes1 = FmsGetFormTimerTask(atoll(formOne.c_str())); bool storageRes1 = FmsGetStorageFormInfos(atoll(formOne.c_str())); @@ -827,6 +838,12 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level EXPECT_FALSE(cacheRes2); EXPECT_FALSE(timerRes2); EXPECT_TRUE(storageRes2); + + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001, EVENT_CODE_101, formTwo); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, EVENT_CODE_101)); + + sleep(7); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300 after sleep"; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); } diff --git a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp index b4378ecd1d..29c9e346e3 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp +++ b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp @@ -159,6 +159,9 @@ bool FmsSelfStartingTest::CompareA() return compare; } char *token = strtok(formInfos.data(), LINE_SEPARATOR.data()); + if (token == nullptr) { + return false; + } std::string formInfo; while (token != nullptr) { formInfo = token; @@ -168,6 +171,9 @@ bool FmsSelfStartingTest::CompareA() break; } token = strtok(nullptr, LINE_SEPARATOR.data()); + if (token == nullptr) { + return false; + } } if (compare) { @@ -208,6 +214,9 @@ bool FmsSelfStartingTest::CompareB() return compare; } char *token = strtok(formInfos.data(), LINE_SEPARATOR.data()); + if (token == nullptr) { + return false; + } std::string formInfo; while (token != nullptr) { formInfo = token; @@ -217,6 +226,9 @@ bool FmsSelfStartingTest::CompareB() break; } token = strtok(nullptr, LINE_SEPARATOR.data()); + if (token == nullptr) { + return false; + } } if (compare) { -- Gitee From 435e4207098595d7077e6757a0dfc5f201ba6a1b Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 22:05:04 +0800 Subject: [PATCH 14/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- test/resource/fms/ohos_test.xml | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 test/resource/fms/ohos_test.xml diff --git a/test/resource/fms/ohos_test.xml b/test/resource/fms/ohos_test.xml new file mode 100755 index 0000000000..a05070dfd5 --- /dev/null +++ b/test/resource/fms/ohos_test.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- Gitee From e3e219364f7d7b9f041b874e20e634e5b902e665 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 22:25:29 +0800 Subject: [PATCH 15/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../src/form_ability_releaseform.cpp | 3 ++- .../fms/fms_fuzz_test/include/fuzz_test_manager.h | 10 ---------- .../common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp | 9 +++++++++ .../fms_release_form_test/fms_release_form_test.cpp | 3 ++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index 07a0de9209..bbe1c1ae3d 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -612,7 +612,8 @@ void FormAbilityReleaseForm::Init(const std::shared_ptr &abilityInf memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_1300] = &FormAbilityReleaseForm::FMS_releaseForm_1300; memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_1400] = &FormAbilityReleaseForm::FMS_releaseForm_1400; memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL] = &FormAbilityReleaseForm::FMS_releaseForm_common_del; - memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001] = &FormAbilityReleaseForm::FMS_releaseForm_common_del_001; + memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001] = + &FormAbilityReleaseForm::FMS_releaseForm_common_del_001; } void FormAbilityReleaseForm::handleEvent(std::string action, std::string data) diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index e772f94961..b09e5025d1 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -26,16 +26,6 @@ namespace AppExecFwk { class FuzzTestManager final : public DelayedRefSingleton { DECLARE_DELAYED_REF_SINGLETON(FuzzTestManager) public: - // typedef std::shared_ptr Ptr; - // ~FuzzTestManager() - // {} - // static Ptr GetInstance() - // { - // if (fuzzTestInstance == nullptr) { - // fuzzTestInstance = std::make_shared(); - // } - // return fuzzTestInstance; - // } DISALLOW_COPY_AND_MOVE(FuzzTestManager); diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp index 352cb3dd7c..53b5b2aeea 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp @@ -32,6 +32,15 @@ namespace AppExecFwk { std::shared_ptr FuzzTestManager::fuzzTestInstance = nullptr; const std::string formManagerAbilityKitName = "FormManagerAbility"; +FuzzTestManager::FuzzTestManager() +{ + APP_LOGI("create fuzz test manager instance"); +} +FuzzTestManager::~FuzzTestManager() +{ + APP_LOGI("destroy fuzz test manager instance"); +} + // RegisterFormManagerAbility void FuzzTestManager::RegisterFormManagerAbility() { diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp index 7875ba675b..c5c5d6203e 100755 --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -840,7 +840,8 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level EXPECT_TRUE(storageRes2); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL_001, EVENT_CODE_101, formTwo); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, EVENT_CODE_101)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL_001, + EVENT_CODE_101)); sleep(7); GTEST_LOG_(INFO) << "FMS_releaseForm_1300 after sleep"; -- Gitee From ac6116d4927412cd62419551854c20cc945cfbba Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 22:39:39 +0800 Subject: [PATCH 16/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- services/formmgr/src/form_mgr_service.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) mode change 100644 => 100755 services/formmgr/src/form_mgr_service.cpp diff --git a/services/formmgr/src/form_mgr_service.cpp b/services/formmgr/src/form_mgr_service.cpp old mode 100644 new mode 100755 index e7ead18631..a023cb0da0 --- a/services/formmgr/src/form_mgr_service.cpp +++ b/services/formmgr/src/form_mgr_service.cpp @@ -395,7 +395,26 @@ ErrCode FormMgrService::Init() */ bool FormMgrService::CheckFormPermission() { - return true; + sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); + if (iBundleMgr == nullptr) { + APP_LOGE("%{public}s, failed to get IBundleMgr.", __func__); + return false; + } + + int32_t uid = IPCSkeleton::GetCallingUid(); + if (!iBundleMgr->CheckIsSystemAppByUid(uid)) { + APP_LOGE("%{public}s fail, form is not system app. uid:%{public}d", __func__, uid); + return false; + } + + std::string bundleName; + bool result = iBundleMgr->GetBundleNameForUid(uid, bundleName); + if (!result || bundleName.empty()) { + APP_LOGE("%{public}s failed, cannot get bundle name by uid:%{public}d", __func__, uid); + return false; + } + + return CheckFormPermission(bundleName); } bool FormMgrService::CheckFormPermission(const std::string &bundleName) const -- Gitee From 6bc77346ecd500434883d3689bbdc1e1a9bd4fce Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 23:07:26 +0800 Subject: [PATCH 17/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms_acquire_form_test.cpp | 2 +- .../fms_fuzz_test/include/fuzz_test_manager.h | 16 +++++++++++----- .../fms_release_form_test.cpp | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index b53c7f5f2d..17c960af87 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1454,7 +1454,7 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) break; } std::string hapDirHeader = " hapSourceDirs [ hapSourceDir ["; - Std::string hapDirPath = "/data/accounts/account_0/applications/" + + std::string hapDirPath = "/data/accounts/account_0/applications/" + "com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"; pos = formInfo.find(hapDirHeader + hapDirPath); if (pos == std::string::npos) { diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index b09e5025d1..6cb77dbc08 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -16,18 +16,24 @@ #define FormManagerFuzzTest_H #include -#include #include #include #include "nlohmann/json.hpp" namespace OHOS { namespace AppExecFwk { -class FuzzTestManager final : public DelayedRefSingleton { - DECLARE_DELAYED_REF_SINGLETON(FuzzTestManager) +class FuzzTestManager { public: - - DISALLOW_COPY_AND_MOVE(FuzzTestManager); + typedef std::shared_ptr Ptr; + ~FuzzTestManager() + {} + static Ptr GetInstance() + { + if (fuzzTestInstance == nullptr) { + fuzzTestInstance = std::shared_ptr(new FuzzTestManager); + } + return fuzzTestInstance; + } void StartFuzzTest(); diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp index c5c5d6203e..06ea626c89 100755 --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -461,8 +461,8 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_releaseForm_0700, result:" << result; } - EXPECT_TRUE(FmsGetCacheInfoByFormId(atoll(formOne.c_str()));); - EXPECT_FALSE(FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal");); + EXPECT_TRUE(FmsGetCacheInfoByFormId(atoll(formOne.c_str()))); + EXPECT_FALSE(FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal")); EXPECT_TRUE(FmsGetStorageFormInfos(atoll(formOne.c_str()))); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); -- Gitee From 7e0c1251fe759687428a73ed54e59bb58adda9f0 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 23:30:30 +0800 Subject: [PATCH 18/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../common/fms/fms_fuzz_test/include/fuzz_test_manager.h | 2 +- .../common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index 6cb77dbc08..804ab29a18 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -30,7 +30,7 @@ public: static Ptr GetInstance() { if (fuzzTestInstance == nullptr) { - fuzzTestInstance = std::shared_ptr(new FuzzTestManager); + fuzzTestInstance = std::make_shared(); } return fuzzTestInstance; } diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp index 53b5b2aeea..352cb3dd7c 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp @@ -32,15 +32,6 @@ namespace AppExecFwk { std::shared_ptr FuzzTestManager::fuzzTestInstance = nullptr; const std::string formManagerAbilityKitName = "FormManagerAbility"; -FuzzTestManager::FuzzTestManager() -{ - APP_LOGI("create fuzz test manager instance"); -} -FuzzTestManager::~FuzzTestManager() -{ - APP_LOGI("destroy fuzz test manager instance"); -} - // RegisterFormManagerAbility void FuzzTestManager::RegisterFormManagerAbility() { -- Gitee From 276f11a35938b85d08bd769ce02b65a726d99552 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Wed, 1 Dec 2021 23:47:02 +0800 Subject: [PATCH 19/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms/fms_acquire_form_test/fms_acquire_form_test.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index 17c960af87..babc351df3 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1453,10 +1453,7 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) GTEST_LOG_(INFO) << "Compare updateAtMin error."; break; } - std::string hapDirHeader = " hapSourceDirs [ hapSourceDir ["; - std::string hapDirPath = "/data/accounts/account_0/applications/" + - "com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"; - pos = formInfo.find(hapDirHeader + hapDirPath); + pos = formInfo.find(" hapSourceDirs [ hapSourceDir [/data/accounts/account_0/applications/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare hapSourceDirs error."; break; -- Gitee From 2c927ec6f130ba7c92708fcf6060b2264bd04fa6 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 00:09:44 +0800 Subject: [PATCH 20/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../common/fms/fms_fuzz_test/include/fuzz_test_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index 804ab29a18..6cb77dbc08 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -30,7 +30,7 @@ public: static Ptr GetInstance() { if (fuzzTestInstance == nullptr) { - fuzzTestInstance = std::make_shared(); + fuzzTestInstance = std::shared_ptr(new FuzzTestManager); } return fuzzTestInstance; } -- Gitee From 1737fae3c04f9065127444cafadcb456f25b8485 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 10:52:42 +0800 Subject: [PATCH 21/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../src/form_ability_performance.cpp | 6 +- .../src/form_ability_stress.cpp | 36 ++-- .../src/form_ability_commona.cpp | 18 +- .../src/form_ability_commonb.cpp | 12 +- .../src/form_ability_no_perm.cpp | 6 +- .../src/form_ability_a.cpp | 170 +++++++++--------- .../src/form_ability_deleteform.cpp | 120 ++++++------- .../src/form_ability_releaseform.cpp | 66 +++---- .../src/form_ability_b.cpp | 46 ++--- .../src/form_ability_c.cpp | 24 +-- .../src/form_ability_not_sys.cpp | 6 +- .../src/form_ability_self_starting_a.cpp | 6 +- .../src/form_ability_self_starting_b.cpp | 12 +- .../fms/common/include/form_st_common_info.h | 16 +- .../fms_acquire_form_test.cpp | 8 +- .../fms_self_starting_test.cpp | 28 +-- 16 files changed, 290 insertions(+), 290 deletions(-) diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp index eb7b1e1ab4..37ee34569f 100755 --- a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp +++ b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp @@ -119,10 +119,10 @@ void FormAbilityPerformance::FMS_performanceTest_0100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp index 6d0f6b52ed..6764d53dc1 100755 --- a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp +++ b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp @@ -137,10 +137,10 @@ void FormAbilityStress::FMS_stressTest_0100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -171,10 +171,10 @@ void FormAbilityStress::FMS_stressTest_0200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -208,10 +208,10 @@ void FormAbilityStress::FMS_stressTest_0200_sub02(std::string form_id) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(atoll(form_id.c_str()), want, callback); if (bResult) { @@ -242,10 +242,10 @@ void FormAbilityStress::FMS_stressTest_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -310,10 +310,10 @@ void FormAbilityStress::FMS_stressTest_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -380,10 +380,10 @@ void FormAbilityStress::FMS_stressTest_1300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp index 32cad6992d..7a68e09d2e 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp @@ -57,14 +57,14 @@ void FormAbilityCommonA::FMS_acquireForm(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -96,10 +96,10 @@ void FormAbilityCommonA::FMS_acquireForm_001(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -130,10 +130,10 @@ void FormAbilityCommonA::FMS_acquireForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp index a8add0eef4..de21893601 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp @@ -54,14 +54,14 @@ void FormAbilityCommonB::FMS_acquireForm(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -77,10 +77,10 @@ void FormAbilityCommonB::FMS_acquireForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp index 0adb42efa6..ca4b4e92b7 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp @@ -43,10 +43,10 @@ void FormAbilityNoPerm::FMS_acquireForm_0200() // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp index 4cb3944ad9..de302e947a 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp @@ -102,10 +102,10 @@ void FormAbilityA::FMS_acquireForm_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(-1, want, callback); if (bResult) { @@ -125,10 +125,10 @@ void FormAbilityA::FMS_acquireForm_0300_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end int64_t int64MaxId = 9223372036854775807; @@ -151,10 +151,10 @@ void FormAbilityA::FMS_acquireForm_0400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, "com.form.bundlename99", FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, "com.form.bundlename99", FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -174,10 +174,10 @@ void FormAbilityA::FMS_acquireForm_0500(std::string data) std::string moduleName = "moduleName99"; Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); want.SetParam(Constants::PARAM_MODULE_NAME_KEY, moduleName); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -198,9 +198,9 @@ void FormAbilityA::FMS_acquireForm_0600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, formName); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -219,10 +219,10 @@ void FormAbilityA::FMS_acquireForm_0700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, "abilityName9"); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, "abilityName9"); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -241,10 +241,10 @@ void FormAbilityA::FMS_acquireForm_1000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, 0); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -264,10 +264,10 @@ void FormAbilityA::FMS_acquireForm_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -287,10 +287,10 @@ void FormAbilityA::FMS_acquireForm_1200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -311,10 +311,10 @@ void FormAbilityA::FMS_acquireForm_1500_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -335,10 +335,10 @@ void FormAbilityA::FMS_acquireForm_1600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -358,10 +358,10 @@ void FormAbilityA::FMS_acquireForm_1600_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -381,10 +381,10 @@ void FormAbilityA::FMS_acquireForm_1800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -404,10 +404,10 @@ void FormAbilityA::FMS_acquireForm_1800_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -427,10 +427,10 @@ void FormAbilityA::FMS_acquireForm_1900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -451,10 +451,10 @@ void FormAbilityA::FMS_acquireForm_2100(std::string data) int64_t formId = std::stoll(data); Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(formId, want, callback); if (bResult) { @@ -506,10 +506,10 @@ void FormAbilityA::FMS_acquireForm_2400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -545,10 +545,10 @@ void FormAbilityA::FMS_acquireForm_2600_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -628,10 +628,10 @@ void FormAbilityA::FMS_acquireForm_2900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -652,10 +652,10 @@ void FormAbilityA::FMS_acquireForm_2900_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -673,10 +673,10 @@ void FormAbilityA::FMS_acquireForm_3000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -696,10 +696,10 @@ void FormAbilityA::FMS_acquireForm_3100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -728,10 +728,10 @@ void FormAbilityA::FMS_acquireForm_3700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -752,10 +752,10 @@ void FormAbilityA::FMS_acquireForm_3800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -779,10 +779,10 @@ void FormAbilityA::FMS_acquireForm_3800_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(std::stoll(data), want, callback); if (bResult) { @@ -804,10 +804,10 @@ void FormAbilityA::FMS_acquireForm_tempForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -824,10 +824,10 @@ void FormAbilityA::FMS_acquireFormBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -849,10 +849,10 @@ void FormAbilityA::FMS_acquireFormBatchB(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -873,11 +873,11 @@ void FormAbilityA::FMS_acquireFormTempBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp index f7dedd295f..970402d119 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp @@ -112,10 +112,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -134,10 +134,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -171,10 +171,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -194,10 +194,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -217,10 +217,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -240,10 +240,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700_2(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -262,10 +262,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -284,10 +284,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -307,10 +307,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -330,10 +330,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -353,14 +353,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -393,14 +393,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -432,10 +432,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1500(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -459,10 +459,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -497,10 +497,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -523,10 +523,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -562,10 +562,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -589,10 +589,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -647,10 +647,10 @@ void FormAbilityDeleteForm::FMS_acquire_tempForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -671,10 +671,10 @@ void FormAbilityDeleteForm::FMS_acquireForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index bbe1c1ae3d..e66a452fc7 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -89,10 +89,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -111,10 +111,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -147,10 +147,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -170,10 +170,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -193,10 +193,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -215,10 +215,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -238,10 +238,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -261,10 +261,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -284,10 +284,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -307,10 +307,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -330,10 +330,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp index 1fcfb3c801..b8654f6967 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp @@ -88,9 +88,9 @@ void FormAbilityB::FMS_acquireForm_1400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, formName); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); @@ -111,10 +111,10 @@ void FormAbilityB::FMS_acquireForm_1500(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); @@ -136,10 +136,10 @@ void FormAbilityB::FMS_acquireForm_1800_2(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -159,10 +159,10 @@ void FormAbilityB::FMS_acquireForm_1800_3(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -199,10 +199,10 @@ void FormAbilityB::FMS_acquireForm_3100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -220,10 +220,10 @@ void FormAbilityB::FMS_acquireForm_tempForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -241,10 +241,10 @@ void FormAbilityB::FMS_acquireFormBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -266,11 +266,11 @@ void FormAbilityB::FMS_acquireFormTempBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp index ff2ffae966..ab1c075d5a 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp @@ -74,10 +74,10 @@ void FormAbilityC::FMS_acquireForm_3100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -98,10 +98,10 @@ void FormAbilityC::FMS_acquireForm_3200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -118,10 +118,10 @@ void FormAbilityC::FMS_acquireFormBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -143,11 +143,11 @@ void FormAbilityC::FMS_acquireFormTempBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp index 3a43f0f3d3..eb69b4b5ba 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp @@ -42,10 +42,10 @@ void FormAbilityNotSys::FMS_acquireForm_0100() // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp index 63fab68951..654bbebc1b 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp @@ -54,10 +54,10 @@ void FormAbilitySelfStartingA::FMS_Start_0300_01(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp index 28f419e5df..d88a9ac6fe 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp @@ -53,10 +53,10 @@ void FormAbilitySelfStartingB::FMS_Start_0300_02(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -75,10 +75,10 @@ void FormAbilitySelfStartingB::FMS_Start_0300_03(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/systemtest/common/fms/common/include/form_st_common_info.h b/test/systemtest/common/fms/common/include/form_st_common_info.h index 0efb00e945..7770168875 100755 --- a/test/systemtest/common/fms/common/include/form_st_common_info.h +++ b/test/systemtest/common/fms/common/include/form_st_common_info.h @@ -29,20 +29,20 @@ const bool FORM_TEMP_FORM_FLAG_FALSE = false; const bool FORM_TEMP_FORM_FLAG_TRUE = true; // provider ability -const std::string FORM_PROVIDER_BUNDLE_NAME1 = "com.form.formsystemtestservicea"; -const std::string FORM_PROVIDER_BUNDLE_NAME2 = "com.form.formsystemtestserviceb"; +const std::string FORM_PROVIDER_BUNDLE_NAME_A = "com.form.formsystemtestservicea"; +const std::string FORM_PROVIDER_BUNDLE_NAME_B = "com.form.formsystemtestserviceb"; const std::string FORM_PROVIDER_BUNDLE_NAME3 = "com.form.formsystemtestservicec"; const std::string FORM_PROVIDER_BUNDLE_NAME4 = "com.form.formsystemtestserviced"; const std::string FORM_PROVIDER_BUNDLE_NAME5 = "com.form.formsystemtestservicee"; -const std::string FORM_PROVIDER_ABILITY_NAME1 = "FormStServiceAbilityA"; -const std::string FORM_PROVIDER_ABILITY_NAME2 = "FormStServiceAbilityB"; +const std::string FORM_PROVIDER_ABILITY_NAME_A = "FormStServiceAbilityA"; +const std::string FORM_PROVIDER_ABILITY_NAME_B = "FormStServiceAbilityB"; const std::string FORM_PROVIDER_ABILITY_NAME3 = "FormStServiceAbilityC"; const std::string FORM_PROVIDER_ABILITY_NAME4 = "FormStServiceAbilityD"; const std::string FORM_PROVIDER_ABILITY_NAME5 = "FormStServiceAbilityE"; -const std::string PARAM_PROVIDER_MODULE_NAME1 = "formmodule001"; -const std::string PARAM_PROVIDER_MODULE_NAME2 = "formmodule001"; -const std::string PARAM_FORM_NAME1 = "Form_Js001"; -const std::string PARAM_FORM_NAME2 = "Form_Js002"; +const std::string PARAM_PROVIDER_MODULE_NAME_A = "formmodule001"; +const std::string PARAM_PROVIDER_MODULE_NAME_B = "formmodule001"; +const std::string PARAM_FORM_NAME_A = "Form_Js001"; +const std::string PARAM_FORM_NAME_B = "Form_Js002"; // add Form const std::string FORM_EVENT_REQ_ACQUIRE_FORM_TEMP = "fms_req_acquireForm_temp"; diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index babc351df3..088ca0a54c 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1418,22 +1418,22 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) { bool result = false; do { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME_A + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare moduleName error."; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME_A + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare bundleName error."; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME_A + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare abilityName error."; break; } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); + pos = formInfo.find(" formName [" + PARAM_FORM_NAME_A + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare formName error."; break; diff --git a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp index 29c9e346e3..55cbbe6aa1 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp +++ b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp @@ -110,11 +110,11 @@ void FmsSelfStartingTest::SetUpTestCase() for (int iCount = 0; iCount < ADD_FORM_A_NUMBER; iCount++) { Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end @@ -130,11 +130,11 @@ void FmsSelfStartingTest::SetUpTestCase() for (int iCount = ADD_FORM_A_NUMBER; iCount < ADD_FORM_LENGTH; iCount++) { Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end @@ -177,22 +177,22 @@ bool FmsSelfStartingTest::CompareA() } if (compare) { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME_A + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME_A + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME_A + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); + pos = formInfo.find(" formName [" + PARAM_FORM_NAME_A + "]"); if (pos == std::string::npos) { compare = false; break; @@ -232,22 +232,22 @@ bool FmsSelfStartingTest::CompareB() } if (compare) { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME2 + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME_B + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME2 + "]"); + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME_B + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME2 + "]"); + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME_B + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME2 + "]"); + pos = formInfo.find(" formName [" + PARAM_FORM_NAME_B + "]"); if (pos == std::string::npos) { compare = false; break; -- Gitee From 2c694c34a52cbbf67884ca6a4e9f7f7e7f66f6e4 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 11:46:29 +0800 Subject: [PATCH 22/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../src/form_ability_performance.cpp | 6 +- .../src/form_ability_stress.cpp | 36 ++-- .../src/form_ability_commona.cpp | 18 +- .../src/form_ability_commonb.cpp | 12 +- .../src/form_ability_no_perm.cpp | 6 +- .../src/form_ability_a.cpp | 170 +++++++++--------- .../src/form_ability_deleteform.cpp | 120 ++++++------- .../src/form_ability_releaseform.cpp | 66 +++---- .../src/form_ability_b.cpp | 46 ++--- .../src/form_ability_c.cpp | 24 +-- .../src/form_ability_not_sys.cpp | 6 +- .../src/form_ability_self_starting_a.cpp | 6 +- .../src/form_ability_self_starting_b.cpp | 12 +- .../fms/common/include/form_st_common_info.h | 16 +- .../fms_acquire_form_test.cpp | 8 +- .../fms_self_starting_test.cpp | 28 +-- 16 files changed, 290 insertions(+), 290 deletions(-) diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp index 37ee34569f..eb7b1e1ab4 100755 --- a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp +++ b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp @@ -119,10 +119,10 @@ void FormAbilityPerformance::FMS_performanceTest_0100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp index 6764d53dc1..6d0f6b52ed 100755 --- a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp +++ b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp @@ -137,10 +137,10 @@ void FormAbilityStress::FMS_stressTest_0100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -171,10 +171,10 @@ void FormAbilityStress::FMS_stressTest_0200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -208,10 +208,10 @@ void FormAbilityStress::FMS_stressTest_0200_sub02(std::string form_id) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(form_id.c_str()), want, callback); if (bResult) { @@ -242,10 +242,10 @@ void FormAbilityStress::FMS_stressTest_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -310,10 +310,10 @@ void FormAbilityStress::FMS_stressTest_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -380,10 +380,10 @@ void FormAbilityStress::FMS_stressTest_1300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp index 7a68e09d2e..32cad6992d 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp @@ -57,14 +57,14 @@ void FormAbilityCommonA::FMS_acquireForm(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -96,10 +96,10 @@ void FormAbilityCommonA::FMS_acquireForm_001(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -130,10 +130,10 @@ void FormAbilityCommonA::FMS_acquireForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp index de21893601..a8add0eef4 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp @@ -54,14 +54,14 @@ void FormAbilityCommonB::FMS_acquireForm(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -77,10 +77,10 @@ void FormAbilityCommonB::FMS_acquireForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp index ca4b4e92b7..0adb42efa6 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp @@ -43,10 +43,10 @@ void FormAbilityNoPerm::FMS_acquireForm_0200() // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp index de302e947a..4cb3944ad9 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp @@ -102,10 +102,10 @@ void FormAbilityA::FMS_acquireForm_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(-1, want, callback); if (bResult) { @@ -125,10 +125,10 @@ void FormAbilityA::FMS_acquireForm_0300_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end int64_t int64MaxId = 9223372036854775807; @@ -151,10 +151,10 @@ void FormAbilityA::FMS_acquireForm_0400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, "com.form.bundlename99", FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, "com.form.bundlename99", FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -174,10 +174,10 @@ void FormAbilityA::FMS_acquireForm_0500(std::string data) std::string moduleName = "moduleName99"; Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); want.SetParam(Constants::PARAM_MODULE_NAME_KEY, moduleName); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -198,9 +198,9 @@ void FormAbilityA::FMS_acquireForm_0600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, formName); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -219,10 +219,10 @@ void FormAbilityA::FMS_acquireForm_0700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, "abilityName9"); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, "abilityName9"); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -241,10 +241,10 @@ void FormAbilityA::FMS_acquireForm_1000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, 0); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -264,10 +264,10 @@ void FormAbilityA::FMS_acquireForm_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -287,10 +287,10 @@ void FormAbilityA::FMS_acquireForm_1200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -311,10 +311,10 @@ void FormAbilityA::FMS_acquireForm_1500_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -335,10 +335,10 @@ void FormAbilityA::FMS_acquireForm_1600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -358,10 +358,10 @@ void FormAbilityA::FMS_acquireForm_1600_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -381,10 +381,10 @@ void FormAbilityA::FMS_acquireForm_1800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -404,10 +404,10 @@ void FormAbilityA::FMS_acquireForm_1800_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -427,10 +427,10 @@ void FormAbilityA::FMS_acquireForm_1900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -451,10 +451,10 @@ void FormAbilityA::FMS_acquireForm_2100(std::string data) int64_t formId = std::stoll(data); Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(formId, want, callback); if (bResult) { @@ -506,10 +506,10 @@ void FormAbilityA::FMS_acquireForm_2400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -545,10 +545,10 @@ void FormAbilityA::FMS_acquireForm_2600_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -628,10 +628,10 @@ void FormAbilityA::FMS_acquireForm_2900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -652,10 +652,10 @@ void FormAbilityA::FMS_acquireForm_2900_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -673,10 +673,10 @@ void FormAbilityA::FMS_acquireForm_3000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -696,10 +696,10 @@ void FormAbilityA::FMS_acquireForm_3100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -728,10 +728,10 @@ void FormAbilityA::FMS_acquireForm_3700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -752,10 +752,10 @@ void FormAbilityA::FMS_acquireForm_3800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -779,10 +779,10 @@ void FormAbilityA::FMS_acquireForm_3800_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(std::stoll(data), want, callback); if (bResult) { @@ -804,10 +804,10 @@ void FormAbilityA::FMS_acquireForm_tempForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -824,10 +824,10 @@ void FormAbilityA::FMS_acquireFormBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -849,10 +849,10 @@ void FormAbilityA::FMS_acquireFormBatchB(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -873,11 +873,11 @@ void FormAbilityA::FMS_acquireFormTempBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp index 970402d119..f7dedd295f 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp @@ -112,10 +112,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -134,10 +134,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -171,10 +171,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -194,10 +194,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -217,10 +217,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700_1(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -240,10 +240,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700_2(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -262,10 +262,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -284,10 +284,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_0900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -307,10 +307,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -330,10 +330,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -353,14 +353,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -393,14 +393,14 @@ void FormAbilityDeleteForm::FMS_deleteForm_1400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -432,10 +432,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1500(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -459,10 +459,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -497,10 +497,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -523,10 +523,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -562,10 +562,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -589,10 +589,10 @@ void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -647,10 +647,10 @@ void FormAbilityDeleteForm::FMS_acquire_tempForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -671,10 +671,10 @@ void FormAbilityDeleteForm::FMS_acquireForm_batch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index e66a452fc7..bbe1c1ae3d 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -89,10 +89,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -111,10 +111,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -147,10 +147,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0600(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -170,10 +170,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0700(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -193,10 +193,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0800(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -215,10 +215,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_0900(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -238,10 +238,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1000(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -261,10 +261,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -284,10 +284,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -307,10 +307,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1300(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -330,10 +330,10 @@ void FormAbilityReleaseForm::FMS_releaseForm_1400(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp index b8654f6967..1fcfb3c801 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp @@ -88,9 +88,9 @@ void FormAbilityB::FMS_acquireForm_1400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, formName); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); @@ -111,10 +111,10 @@ void FormAbilityB::FMS_acquireForm_1500(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); @@ -136,10 +136,10 @@ void FormAbilityB::FMS_acquireForm_1800_2(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -159,10 +159,10 @@ void FormAbilityB::FMS_acquireForm_1800_3(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -199,10 +199,10 @@ void FormAbilityB::FMS_acquireForm_3100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -220,10 +220,10 @@ void FormAbilityB::FMS_acquireForm_tempForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -241,10 +241,10 @@ void FormAbilityB::FMS_acquireFormBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -266,11 +266,11 @@ void FormAbilityB::FMS_acquireFormTempBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp index ab1c075d5a..ff2ffae966 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp @@ -74,10 +74,10 @@ void FormAbilityC::FMS_acquireForm_3100(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -98,10 +98,10 @@ void FormAbilityC::FMS_acquireForm_3200(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -118,10 +118,10 @@ void FormAbilityC::FMS_acquireFormBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -143,11 +143,11 @@ void FormAbilityC::FMS_acquireFormTempBatch(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp index eb69b4b5ba..3a43f0f3d3 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp @@ -42,10 +42,10 @@ void FormAbilityNotSys::FMS_acquireForm_0100() // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp index 654bbebc1b..63fab68951 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp @@ -54,10 +54,10 @@ void FormAbilitySelfStartingA::FMS_Start_0300_01(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp index d88a9ac6fe..28f419e5df 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp @@ -53,10 +53,10 @@ void FormAbilitySelfStartingB::FMS_Start_0300_02(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -75,10 +75,10 @@ void FormAbilitySelfStartingB::FMS_Start_0300_03(std::string data) // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/systemtest/common/fms/common/include/form_st_common_info.h b/test/systemtest/common/fms/common/include/form_st_common_info.h index 7770168875..0efb00e945 100755 --- a/test/systemtest/common/fms/common/include/form_st_common_info.h +++ b/test/systemtest/common/fms/common/include/form_st_common_info.h @@ -29,20 +29,20 @@ const bool FORM_TEMP_FORM_FLAG_FALSE = false; const bool FORM_TEMP_FORM_FLAG_TRUE = true; // provider ability -const std::string FORM_PROVIDER_BUNDLE_NAME_A = "com.form.formsystemtestservicea"; -const std::string FORM_PROVIDER_BUNDLE_NAME_B = "com.form.formsystemtestserviceb"; +const std::string FORM_PROVIDER_BUNDLE_NAME1 = "com.form.formsystemtestservicea"; +const std::string FORM_PROVIDER_BUNDLE_NAME2 = "com.form.formsystemtestserviceb"; const std::string FORM_PROVIDER_BUNDLE_NAME3 = "com.form.formsystemtestservicec"; const std::string FORM_PROVIDER_BUNDLE_NAME4 = "com.form.formsystemtestserviced"; const std::string FORM_PROVIDER_BUNDLE_NAME5 = "com.form.formsystemtestservicee"; -const std::string FORM_PROVIDER_ABILITY_NAME_A = "FormStServiceAbilityA"; -const std::string FORM_PROVIDER_ABILITY_NAME_B = "FormStServiceAbilityB"; +const std::string FORM_PROVIDER_ABILITY_NAME1 = "FormStServiceAbilityA"; +const std::string FORM_PROVIDER_ABILITY_NAME2 = "FormStServiceAbilityB"; const std::string FORM_PROVIDER_ABILITY_NAME3 = "FormStServiceAbilityC"; const std::string FORM_PROVIDER_ABILITY_NAME4 = "FormStServiceAbilityD"; const std::string FORM_PROVIDER_ABILITY_NAME5 = "FormStServiceAbilityE"; -const std::string PARAM_PROVIDER_MODULE_NAME_A = "formmodule001"; -const std::string PARAM_PROVIDER_MODULE_NAME_B = "formmodule001"; -const std::string PARAM_FORM_NAME_A = "Form_Js001"; -const std::string PARAM_FORM_NAME_B = "Form_Js002"; +const std::string PARAM_PROVIDER_MODULE_NAME1 = "formmodule001"; +const std::string PARAM_PROVIDER_MODULE_NAME2 = "formmodule001"; +const std::string PARAM_FORM_NAME1 = "Form_Js001"; +const std::string PARAM_FORM_NAME2 = "Form_Js002"; // add Form const std::string FORM_EVENT_REQ_ACQUIRE_FORM_TEMP = "fms_req_acquireForm_temp"; diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index 088ca0a54c..babc351df3 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1418,22 +1418,22 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) { bool result = false; do { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME_A + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare moduleName error."; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME_A + "]"); + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare bundleName error."; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME_A + "]"); + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare abilityName error."; break; } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME_A + "]"); + pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare formName error."; break; diff --git a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp index 55cbbe6aa1..29c9e346e3 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp +++ b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp @@ -110,11 +110,11 @@ void FmsSelfStartingTest::SetUpTestCase() for (int iCount = 0; iCount < ADD_FORM_A_NUMBER; iCount++) { Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_A); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_A); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_A, FORM_PROVIDER_ABILITY_NAME_A); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end @@ -130,11 +130,11 @@ void FmsSelfStartingTest::SetUpTestCase() for (int iCount = ADD_FORM_A_NUMBER; iCount < ADD_FORM_LENGTH; iCount++) { Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); - want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME_B); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME_B); + want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME_B, FORM_PROVIDER_ABILITY_NAME_B); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end @@ -177,22 +177,22 @@ bool FmsSelfStartingTest::CompareA() } if (compare) { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME_A + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME_A + "]"); + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME_A + "]"); + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME_A + "]"); + pos = formInfo.find(" formName [" + PARAM_FORM_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; @@ -232,22 +232,22 @@ bool FmsSelfStartingTest::CompareB() } if (compare) { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME_B + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME_B + "]"); + pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME_B + "]"); + pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" formName [" + PARAM_FORM_NAME_B + "]"); + pos = formInfo.find(" formName [" + PARAM_FORM_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; -- Gitee From abb37307f0e02af8d434c033aa3af40b6c6bc5ef Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 14:18:45 +0800 Subject: [PATCH 23/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms/fms_acquire_form_test/fms_acquire_form_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index babc351df3..36ea97c3cf 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1453,7 +1453,10 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) GTEST_LOG_(INFO) << "Compare updateAtMin error."; break; } - pos = formInfo.find(" hapSourceDirs [ hapSourceDir [/data/accounts/account_0/applications/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"); + std::string hapSourceDirsPre = " hapSourceDirs [ hapSourceDir "; + std::string hapSourceDirs = "[/data/accounts/account_0/applications"; + std::string hapSourceDirsSuf = "/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"; + pos = formInfo.find(hapSourceDirsPre + hapSourceDirs + hapSourceDirsSuf); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare hapSourceDirs error."; break; -- Gitee From a28bbc9ec59dfdc678a811fe702e69a35161e30a Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 15:16:59 +0800 Subject: [PATCH 24/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms/common/include/form_st_common_info.h | 12 +++++------ .../fms_acquire_form_test.cpp | 19 +++++++++++------- .../fms_self_starting_test.cpp | 20 +++++++++---------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/test/systemtest/common/fms/common/include/form_st_common_info.h b/test/systemtest/common/fms/common/include/form_st_common_info.h index 0efb00e945..7b0c311f5c 100755 --- a/test/systemtest/common/fms/common/include/form_st_common_info.h +++ b/test/systemtest/common/fms/common/include/form_st_common_info.h @@ -29,18 +29,18 @@ const bool FORM_TEMP_FORM_FLAG_FALSE = false; const bool FORM_TEMP_FORM_FLAG_TRUE = true; // provider ability -const std::string FORM_PROVIDER_BUNDLE_NAME1 = "com.form.formsystemtestservicea"; -const std::string FORM_PROVIDER_BUNDLE_NAME2 = "com.form.formsystemtestserviceb"; +const std::string FORM_PV_BUNDLE_NAME1 = "com.form.formsystemtestservicea"; +const std::string FORM_PV_BUNDLE_NAME2 = "com.form.formsystemtestserviceb"; const std::string FORM_PROVIDER_BUNDLE_NAME3 = "com.form.formsystemtestservicec"; const std::string FORM_PROVIDER_BUNDLE_NAME4 = "com.form.formsystemtestserviced"; const std::string FORM_PROVIDER_BUNDLE_NAME5 = "com.form.formsystemtestservicee"; -const std::string FORM_PROVIDER_ABILITY_NAME1 = "FormStServiceAbilityA"; -const std::string FORM_PROVIDER_ABILITY_NAME2 = "FormStServiceAbilityB"; +const std::string FORM_PV_ABILITY_NAME1 = "FormStServiceAbilityA"; +const std::string FORM_PV_ABILITY_NAME2 = "FormStServiceAbilityB"; const std::string FORM_PROVIDER_ABILITY_NAME3 = "FormStServiceAbilityC"; const std::string FORM_PROVIDER_ABILITY_NAME4 = "FormStServiceAbilityD"; const std::string FORM_PROVIDER_ABILITY_NAME5 = "FormStServiceAbilityE"; -const std::string PARAM_PROVIDER_MODULE_NAME1 = "formmodule001"; -const std::string PARAM_PROVIDER_MODULE_NAME2 = "formmodule001"; +const std::string PARAM_PV_MODULE_NAME1 = "formmodule001"; +const std::string PARAM_PV_MODULE_NAME2 = "formmodule001"; const std::string PARAM_FORM_NAME1 = "Form_Js001"; const std::string PARAM_FORM_NAME2 = "Form_Js002"; diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index 36ea97c3cf..aaacade769 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -96,6 +96,7 @@ public: void FmsAcquireFormDeleteA(std::string strFormId); void FMS_deleteFormBatch(); bool CompareCacheFormData(std::string formInfo); + std::string getHapSourceDirs(); }; std::vector FmsAcquireFormTest::eventList = { @@ -1418,17 +1419,17 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) { bool result = false; do { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PV_MODULE_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare moduleName error."; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + pos = formInfo.find(" bundleName [" + FORM_PV_BUNDLE_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare bundleName error."; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + pos = formInfo.find(" abilityName [" + FORM_PV_ABILITY_NAME1 + "]"); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare abilityName error."; break; @@ -1453,10 +1454,7 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) GTEST_LOG_(INFO) << "Compare updateAtMin error."; break; } - std::string hapSourceDirsPre = " hapSourceDirs [ hapSourceDir "; - std::string hapSourceDirs = "[/data/accounts/account_0/applications"; - std::string hapSourceDirsSuf = "/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"; - pos = formInfo.find(hapSourceDirsPre + hapSourceDirs + hapSourceDirsSuf); + pos = formInfo.find(getHapSourceDirs()); if (pos == std::string::npos) { GTEST_LOG_(INFO) << "Compare hapSourceDirs error."; break; @@ -1470,5 +1468,12 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) } while (false); return result; } +std::string getHapSourceDirs() +{ + std::string hapSourceDirsPre = " hapSourceDirs [ hapSourceDir "; + std::string hapSourceDirs = "[/data/accounts/account_0/applications"; + std::string hapSourceDirsSuf = "/com.form.formsystemtestservicea/com.form.formsystemtestservicea]]"; + return hapSourceDirsPre + hapSourceDirs + hapSourceDirsSuf; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp index 29c9e346e3..515138c0e4 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp +++ b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp @@ -111,10 +111,10 @@ void FmsSelfStartingTest::SetUpTestCase() Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end @@ -131,10 +131,10 @@ void FmsSelfStartingTest::SetUpTestCase() Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME2, FORM_PV_ABILITY_NAME2); APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end @@ -177,17 +177,17 @@ bool FmsSelfStartingTest::CompareA() } if (compare) { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME1 + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PV_MODULE_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME1 + "]"); + pos = formInfo.find(" bundleName [" + FORM_PV_BUNDLE_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME1 + "]"); + pos = formInfo.find(" abilityName [" + FORM_PV_ABILITY_NAME1 + "]"); if (pos == std::string::npos) { compare = false; break; @@ -232,17 +232,17 @@ bool FmsSelfStartingTest::CompareB() } if (compare) { - size_t pos = formInfo.find(" moduleName [" + PARAM_PROVIDER_MODULE_NAME2 + "]"); + size_t pos = formInfo.find(" moduleName [" + PARAM_PV_MODULE_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" bundleName [" + FORM_PROVIDER_BUNDLE_NAME2 + "]"); + pos = formInfo.find(" bundleName [" + FORM_PV_BUNDLE_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; } - pos = formInfo.find(" abilityName [" + FORM_PROVIDER_ABILITY_NAME2 + "]"); + pos = formInfo.find(" abilityName [" + FORM_PV_ABILITY_NAME2 + "]"); if (pos == std::string::npos) { compare = false; break; -- Gitee From 00c2814bc401c42c43c6d727af58d97ffacdc1cc Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 15:46:37 +0800 Subject: [PATCH 25/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../src/form_ability_performance.cpp | 4 +- .../src/form_ability_stress.cpp | 24 ++-- .../src/form_ability_commona.cpp | 12 +- .../src/form_ability_commonb.cpp | 8 +- .../src/form_ability_no_perm.cpp | 4 +- .../src/form_ability_a.cpp | 114 +++++++++--------- .../src/form_ability_deleteform.cpp | 80 ++++++------ .../src/form_ability_releaseform.cpp | 44 +++---- .../src/form_ability_b.cpp | 32 ++--- .../src/form_ability_c.cpp | 16 +-- .../src/form_ability_not_sys.cpp | 4 +- .../src/form_ability_self_starting_a.cpp | 4 +- .../src/form_ability_self_starting_b.cpp | 8 +- 13 files changed, 177 insertions(+), 177 deletions(-) diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp index eb7b1e1ab4..d87bd6c745 100755 --- a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp +++ b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp @@ -120,9 +120,9 @@ void FormAbilityPerformance::FMS_performanceTest_0100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp index 6d0f6b52ed..8c5bdc0225 100755 --- a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp +++ b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp @@ -138,9 +138,9 @@ void FormAbilityStress::FMS_stressTest_0100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -172,9 +172,9 @@ void FormAbilityStress::FMS_stressTest_0200(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -209,9 +209,9 @@ void FormAbilityStress::FMS_stressTest_0200_sub02(std::string form_id) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(form_id.c_str()), want, callback); if (bResult) { @@ -243,9 +243,9 @@ void FormAbilityStress::FMS_stressTest_0300(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -311,9 +311,9 @@ void FormAbilityStress::FMS_stressTest_1100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -381,9 +381,9 @@ void FormAbilityStress::FMS_stressTest_1300(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp index 32cad6992d..ecfc7b655a 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp @@ -58,13 +58,13 @@ void FormAbilityCommonA::FMS_acquireForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -97,9 +97,9 @@ void FormAbilityCommonA::FMS_acquireForm_001(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -131,9 +131,9 @@ void FormAbilityCommonA::FMS_acquireForm_batch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp index a8add0eef4..f9430eba81 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp @@ -55,13 +55,13 @@ void FormAbilityCommonB::FMS_acquireForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -78,9 +78,9 @@ void FormAbilityCommonB::FMS_acquireForm_batch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp index 0adb42efa6..0df13c4425 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp @@ -44,9 +44,9 @@ void FormAbilityNoPerm::FMS_acquireForm_0200() Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp index 4cb3944ad9..5b2c6c528d 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp @@ -103,9 +103,9 @@ void FormAbilityA::FMS_acquireForm_0300(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(-1, want, callback); if (bResult) { @@ -126,9 +126,9 @@ void FormAbilityA::FMS_acquireForm_0300_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end int64_t int64MaxId = 9223372036854775807; @@ -152,9 +152,9 @@ void FormAbilityA::FMS_acquireForm_0400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, "com.form.bundlename99", FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, "com.form.bundlename99", FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -177,7 +177,7 @@ void FormAbilityA::FMS_acquireForm_0500(std::string data) want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); want.SetParam(Constants::PARAM_MODULE_NAME_KEY, moduleName); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -198,9 +198,9 @@ void FormAbilityA::FMS_acquireForm_0600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, formName); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -220,9 +220,9 @@ void FormAbilityA::FMS_acquireForm_0700(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, "abilityName9"); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, "abilityName9"); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -242,9 +242,9 @@ void FormAbilityA::FMS_acquireForm_1000(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, 0); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -265,9 +265,9 @@ void FormAbilityA::FMS_acquireForm_1100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -288,9 +288,9 @@ void FormAbilityA::FMS_acquireForm_1200(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME2, FORM_PV_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -312,9 +312,9 @@ void FormAbilityA::FMS_acquireForm_1500_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -336,9 +336,9 @@ void FormAbilityA::FMS_acquireForm_1600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -359,9 +359,9 @@ void FormAbilityA::FMS_acquireForm_1600_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -382,9 +382,9 @@ void FormAbilityA::FMS_acquireForm_1800(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -405,9 +405,9 @@ void FormAbilityA::FMS_acquireForm_1800_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -428,9 +428,9 @@ void FormAbilityA::FMS_acquireForm_1900(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -452,9 +452,9 @@ void FormAbilityA::FMS_acquireForm_2100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(formId, want, callback); if (bResult) { @@ -507,9 +507,9 @@ void FormAbilityA::FMS_acquireForm_2400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -546,9 +546,9 @@ void FormAbilityA::FMS_acquireForm_2600_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -629,9 +629,9 @@ void FormAbilityA::FMS_acquireForm_2900(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -653,9 +653,9 @@ void FormAbilityA::FMS_acquireForm_2900_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME2, FORM_PV_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -674,9 +674,9 @@ void FormAbilityA::FMS_acquireForm_3000(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -697,9 +697,9 @@ void FormAbilityA::FMS_acquireForm_3100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -729,9 +729,9 @@ void FormAbilityA::FMS_acquireForm_3700(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -753,9 +753,9 @@ void FormAbilityA::FMS_acquireForm_3800(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -780,9 +780,9 @@ void FormAbilityA::FMS_acquireForm_3800_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(std::stoll(data), want, callback); if (bResult) { @@ -805,9 +805,9 @@ void FormAbilityA::FMS_acquireForm_tempForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -825,9 +825,9 @@ void FormAbilityA::FMS_acquireFormBatch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -850,9 +850,9 @@ void FormAbilityA::FMS_acquireFormBatchB(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME2); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME2); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME2); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME2, FORM_PV_ABILITY_NAME2); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -874,10 +874,10 @@ void FormAbilityA::FMS_acquireFormTempBatch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp index f7dedd295f..ad0251858d 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp @@ -113,9 +113,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0300(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -135,9 +135,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -172,9 +172,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -195,9 +195,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -218,9 +218,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700_1(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME2, FORM_PV_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -241,9 +241,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700_2(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME2, FORM_PV_ABILITY_NAME2); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -263,9 +263,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0800(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -285,9 +285,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0900(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -308,9 +308,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1000(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -331,9 +331,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -354,13 +354,13 @@ void FormAbilityDeleteForm::FMS_deleteForm_1200(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -394,13 +394,13 @@ void FormAbilityDeleteForm::FMS_deleteForm_1400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); if (data == "true") { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); } else { want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); } - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -433,9 +433,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1500(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -460,9 +460,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -498,9 +498,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -524,9 +524,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -563,9 +563,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1700(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -590,9 +590,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -648,9 +648,9 @@ void FormAbilityDeleteForm::FMS_acquire_tempForm_batch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -672,9 +672,9 @@ void FormAbilityDeleteForm::FMS_acquireForm_batch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index bbe1c1ae3d..a804930ca8 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -90,9 +90,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0300(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -112,9 +112,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -148,9 +148,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0600(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -171,9 +171,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0700(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -194,9 +194,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0800(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -216,9 +216,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0900(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -239,9 +239,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1000(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { @@ -262,9 +262,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -285,9 +285,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1200(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -308,9 +308,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1300(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -331,9 +331,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp index 1fcfb3c801..7fd6cbd04b 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp @@ -88,9 +88,9 @@ void FormAbilityB::FMS_acquireForm_1400(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, formName); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); @@ -112,9 +112,9 @@ void FormAbilityB::FMS_acquireForm_1500(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); @@ -137,9 +137,9 @@ void FormAbilityB::FMS_acquireForm_1800_2(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -160,9 +160,9 @@ void FormAbilityB::FMS_acquireForm_1800_3(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -200,9 +200,9 @@ void FormAbilityB::FMS_acquireForm_3100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -221,9 +221,9 @@ void FormAbilityB::FMS_acquireForm_tempForm(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); @@ -242,9 +242,9 @@ void FormAbilityB::FMS_acquireFormBatch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -267,10 +267,10 @@ void FormAbilityB::FMS_acquireFormTempBatch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp index ff2ffae966..89010cc0cc 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp @@ -75,9 +75,9 @@ void FormAbilityC::FMS_acquireForm_3100(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -99,9 +99,9 @@ void FormAbilityC::FMS_acquireForm_3200(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -119,9 +119,9 @@ void FormAbilityC::FMS_acquireFormBatch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); @@ -144,10 +144,10 @@ void FormAbilityC::FMS_acquireFormTempBatch(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); int formCount = std::stoi(data); APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp index 3a43f0f3d3..cbd3c75021 100755 --- a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp @@ -43,9 +43,9 @@ void FormAbilityNotSys::FMS_acquireForm_0100() Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp index 63fab68951..e5101e3184 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp @@ -55,9 +55,9 @@ void FormAbilitySelfStartingA::FMS_Start_0300_01(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp index 28f419e5df..a0e275dd6b 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp @@ -54,9 +54,9 @@ void FormAbilitySelfStartingB::FMS_Start_0300_02(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { @@ -76,9 +76,9 @@ void FormAbilitySelfStartingB::FMS_Start_0300_03(std::string data) Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); want.SetParam(Constants::PARAM_FORM_NAME_KEY, PARAM_FORM_NAME1); - want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PROVIDER_MODULE_NAME1); + want.SetParam(Constants::PARAM_MODULE_NAME_KEY, PARAM_PV_MODULE_NAME1); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); - want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); + want.SetElementName(FORM_TEST_DEVICEID, FORM_PV_BUNDLE_NAME1, FORM_PV_ABILITY_NAME1); // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { -- Gitee From ce5c4c8423981ff66c35697684d5ab15e27505f9 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 15:57:06 +0800 Subject: [PATCH 26/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms_delete_form_test.cpp | 321 ++++++++++-------- .../fms_release_form_test.cpp | 210 +++++++----- 2 files changed, 299 insertions(+), 232 deletions(-) mode change 100644 => 100755 test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp old mode 100644 new mode 100755 index 58ca64845a..1e429172c7 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -83,6 +83,12 @@ public: bool FmsGetHostInfoByFormId(std::int64_t formId, std::string hostBundleName); bool FmsGetStorageFormInfos(std::int64_t formId); bool FmsGetFormTimerTask(std::int64_t formId); + void FMS_deleteForm_0600_Create_Delete(std::string formOne); + void FMS_deleteForm_0700_Create(std::string formOne, std::string &formTwo); + void FMS_deleteForm__0700_1_Create(std::string formOne, std::string &formTwo); + void FMS_deleteForm__0700_2_Create(std::string formOne, std::string &formTwo); + void FMS_deleteForm_0800_Create(std::string formOne, std::string &formTwo); + void FMS_deleteForm_1100_Create(std::string formOne, std::string &formTwo); void FMS_deleteForm_1400_A(); void FMS_deleteForm_1400_B(); void FMS_deleteForm_1500_acquireForm(const std::string &bundleName, const std::string &abilityName, @@ -473,26 +479,9 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0600, Function | MediumTest | Level1) std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); GTEST_LOG_(INFO) << "FMS_deleteForm_0600, formOne:[" << formOne << "]" << std::endl; if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityDeleteForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0600, EVENT_CODE_600, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610); - GTEST_LOG_(INFO) << "FMS_deleteForm_0600, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600); - bool result = formTwo == "true"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0600, result:" << result; - } + + FMS_deleteForm_0600_Create_Delete(formOne); + // can't receive onDelete EXPECT_EQ(-1, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); @@ -540,28 +529,10 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formOne:[" << formOne << "]" << std::endl; EXPECT_TRUE(formOne != ""); if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityDeleteForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(SEVEN); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700, EVENT_CODE_700, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formTwo:[" << formTwo << "]" << std::endl; - bool result = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0700, result:" << result; - } + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_deleteForm_0700_Create(formOne, formTwo_A); + // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, @@ -573,7 +544,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700, Function | MediumTest | Level1) EXPECT_FALSE(cacheRes); EXPECT_FALSE(storageRes); EXPECT_FALSE(timerRes); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formOne:" << std::endl; bool cacheRes2 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool storageRes2 = FmsGetStorageFormInfos(atoll(formOne.c_str())); bool timerRes2 = FmsGetFormTimerTask(atoll(formOne.c_str())); @@ -618,28 +588,10 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_1, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formOne:[" << formOne << "]" << std::endl; EXPECT_TRUE(formOne != ""); if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityDeleteForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(THREE); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_1, EVENT_CODE_700_1, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formTwo:[" << formTwo << "]" << std::endl; - bool result = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, result:" << result; - } + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_deleteForm__0700_1_Create(formOne, formTwo_A); + want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); @@ -690,29 +642,12 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, formOne:[" << formOne << "]" << std::endl; EXPECT_TRUE(formOne != ""); if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityDeleteForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(THREE); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_2, EVENT_CODE_700_2, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); - GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, acquire formTwo:[" << formTwo << "]" << std::endl; - bool result = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, result:" << result; - } - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_deleteForm__0700_2_Create(formOne, formTwo_A); + + // can receive onDelete + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2,EVENT_CODE_700_2)); std::string onDeleteData = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); EXPECT_TRUE(onDeleteData == formTwo); @@ -765,41 +700,24 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0800, Function | MediumTest | Level1) sleep(SEVEN); EXPECT_TRUE(formOne != ""); if (formOne != "") { - std::string bundleName = "com.ohos.form.manager.normal"; - std::string abilityName = "FormAbilityDeleteForm"; - MAP_STR_STR params; - Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0800; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0800, EVENT_CODE_800, eventData); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810); - GTEST_LOG_(INFO) << "FMS_deleteForm_0800, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800)); - std::string data = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800); - bool result = (data != "false" && data != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_0800, result:" << result; - } + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_deleteForm_0800_Create(formOne, formTwo_A); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK); - EXPECT_TRUE(onDeleteData == data); + EXPECT_TRUE(onDeleteData == formTwo); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101)); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); bool cacheResA = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool storageResA = FmsGetStorageFormInfos(atoll(formOne.c_str())); - bool cacheResB = FmsGetCacheInfoByFormId(atoll(data.c_str())); - bool storageResB = FmsGetStorageFormInfos(atoll(data.c_str())); + bool cacheResB = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); + bool storageResB = FmsGetStorageFormInfos(atoll(formTwo.c_str())); bool timerResA = FmsGetFormTimerTask(atoll(formOne.c_str())); - bool timerResB = FmsGetFormTimerTask(atoll(data.c_str())); + bool timerResB = FmsGetFormTimerTask(atoll(formTwo.c_str())); EXPECT_FALSE(cacheResA); EXPECT_FALSE(storageResA); EXPECT_FALSE(cacheResB); @@ -904,7 +822,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1000, Function | MediumTest | Level1) */ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) { - sleep(THREE); std::cout << "============START FMS_deleteForm_1100" << std::endl; std::string bundleName = "com.ohos.form.manager.commona"; std::string abilityName = "FormAbilityCommonA"; @@ -921,30 +838,13 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1100, Function | MediumTest | Level1) EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); - sleep(THREE); GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formOne:[" << formOne << "]" << std::endl; if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityDeleteForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1100, EVENT_CODE_1100, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110); - GTEST_LOG_(INFO) << "FMS_deleteForm_1100, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100); - GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formTwo:[" << formTwo << "]" << std::endl; - bool result = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1100, result:" << result; - } + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_deleteForm_1100_Create(formOne, formTwo_A); + + // can receive onDelete EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK)); std::string onDeleteData = SystemTestFormUtil::GetData(event, COMMON_EVENT_ON_DELETE, @@ -997,9 +897,6 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) GTEST_LOG_(INFO) << "========FMS_deleteForm_1200 [#Create#]formId:[" << formIds[i] << "]======>>index:" << i; bool result = (formIds[i] != "false" && formIds[i] != ""); EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1200, result:" << result; - } } for (int i=0; i>index:" << i; bool result2 = (data2 != "false" && data2 != ""); EXPECT_TRUE(result2); - if (!result2) { - GTEST_LOG_(INFO) << "FMS_deleteForm_1201, result2:" << result2; - } - bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); bool storageRes = FmsGetStorageFormInfos(atoll(data2.c_str())); EXPECT_FALSE(cacheRes); EXPECT_FALSE(storageRes); @@ -1176,6 +1070,149 @@ bool FmsDeleteFormTest::FmsGetFormTimerTask(std::int64_t formId) return false; } } +void FmsDeleteFormTest::FMS_deleteForm_0600_Create_Delete(std::string formOne) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0600, EVENT_CODE_600, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_610); + GTEST_LOG_(INFO) << "FMS_deleteForm_0600, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600)); + std::string data3 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600); + GTEST_LOG_(INFO) << "FMS_deleteForm_0600, delete data3:" << data3 << std::endl; + bool result3 = data3 == "true"; + EXPECT_TRUE(result3); +} +void FmsDeleteFormTest::FMS_deleteForm_0700_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + sleep(7); + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700, EVENT_CODE_700, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_710); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} +void FmsDeleteFormTest::FMS_deleteForm__0700_1_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(3); + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_1, EVENT_CODE_700_1, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_710_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_1, EVENT_CODE_700_1); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_1, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} +void FmsDeleteFormTest::FMS_deleteForm__0700_2_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + sleep(3); + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_2, EVENT_CODE_700_2, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_710_2); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); + GTEST_LOG_(INFO) << "FMS_deleteForm_0700_2, acquire formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} +void FmsDeleteFormTest::FMS_deleteForm_0800_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName = "com.ohos.form.manager.normal"; + std::string abilityName = "FormAbilityDeleteForm"; + MAP_STR_STR params; + Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); + SystemTestFormUtil::StartAbility(want, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + std::string eventData = FORM_EVENT_REQ_DELETE_FORM_0800; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0800, EVENT_CODE_800, eventData); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_810); + GTEST_LOG_(INFO) << "FMS_deleteForm_0800, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800); + GTEST_LOG_(INFO) << "FMS_deleteForm_0800, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} +void FmsDeleteFormTest::FMS_deleteForm_1100_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityDeleteForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1100, EVENT_CODE_1100, eventData2); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1110); + GTEST_LOG_(INFO) << "FMS_deleteForm_1100, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100); + GTEST_LOG_(INFO) << "FMS_deleteForm_1100, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} void FmsDeleteFormTest::FMS_deleteForm_1400_A() { int createFormCount = 10; diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp index 06ea626c89..2601892d22 100755 --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -81,6 +81,10 @@ public: bool FmsGetHostInfoByFormId(std::int64_t formId, std::string hostBundleName); bool FmsGetStorageFormInfos(std::int64_t formId); bool FmsGetFormTimerTask(std::int64_t formId); + void FMS_releaseForm_0800_Create(std::string formOne, std::string &formTwo); + void FMS_releaseForm_1000_Create(std::string formOne); + void FMS_releaseForm_1100_Create(std::string formOne, std::string &formTwo); + void FMS_releaseForm_1300_Create_release(std::string formOne, std::string &formTwo); }; std::vector FmsReleaseFormTest::eventList = { @@ -421,7 +425,6 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0700, Function | MediumTest | Level std::string abilityName = "FormAbilityCommonA"; MAP_STR_STR params; Want want = SystemTestFormUtil::MakeWant("device", abilityName, bundleName, params); - SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); @@ -502,27 +505,11 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_0800, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_releaseForm_0800, formOne:[" << formOne << "]" << std::endl; sleep(7); if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityReleaseForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0800, EVENT_CODE_800, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810); - GTEST_LOG_(INFO) << "FMS_releaseForm_0800, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800); - GTEST_LOG_(INFO) << "FMS_releaseForm_0800, formTwo:[" << formTwo << "]" << std::endl; - bool result = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_0800, result:" << result; - } + + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_releaseForm_0800_Create(formOne, formTwo_A); + sleep(7); bool cacheRes = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); bool storageRes = FmsGetStorageFormInfos(atoll(formTwo.c_str())); @@ -618,29 +605,9 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1000, Function | MediumTest | Level sleep(3); GTEST_LOG_(INFO) << "FMS_releaseForm_1000, formOne:[" << formOne << "]" << std::endl; if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityReleaseForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1000, EVENT_CODE_1000, eventData2); - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010); - GTEST_LOG_(INFO) << "FMS_releaseForm_1000, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); + + FMS_releaseForm_1000_Create(formOne); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000); - bool result = formTwo == "true"; - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1000, result:" << result; - } bool cacheRes = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool hostRes = FmsGetHostInfoByFormId(atoll(formOne.c_str()), "com.ohos.form.manager.normal"); bool storageRes = FmsGetStorageFormInfos(atoll(formOne.c_str())); @@ -686,27 +653,11 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1100, Function | MediumTest | Level GTEST_LOG_(INFO) << "FMS_releaseForm_1100, formOne:[" << formOne << "]" << std::endl; sleep(7); if (formOne != "") { - std::string bundleName2 = "com.ohos.form.manager.normal"; - std::string abilityName2 = "FormAbilityReleaseForm"; - MAP_STR_STR params2; - Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); - SystemTestFormUtil::StartAbility(want2, abilityManager); - EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1100, EVENT_CODE_1100, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110); - GTEST_LOG_(INFO) << "FMS_releaseForm_1100, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100); - GTEST_LOG_(INFO) << "FMS_releaseForm_1100, formTwo:[" << formTwo << "]" << std::endl; - bool result = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1100, result:" << result; - } + + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_releaseForm_1100_Create(formOne, formTwo_A); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(formTwo.c_str())); bool storageRes = FmsGetStorageFormInfos(atoll(formTwo.c_str())); bool timerRes = FmsGetFormTimerTask(atoll(formTwo.c_str())); @@ -796,36 +747,17 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level EXPECT_TRUE(result1); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300)); std::string formOne = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formOne:[" << formOne << "]" << std::endl; bool result = formOne != ""; EXPECT_TRUE(result); - if (!result) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, result:" << result; - } - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formOne:[" << formOne << "]" << std::endl; + sleep(3); if (formOne != "") { - std::string eventData2 = formOne; - SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1300, EVENT_CODE_1300, eventData2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310)); - std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310); - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, acquire data2:" << data2 << std::endl; - bool result2 = data2 == "true"; - EXPECT_TRUE(result2); - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301)); - std::string formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301); - bool result3 = (formTwo != "false" && formTwo != ""); - EXPECT_TRUE(result3); - if (!result3) { - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, result3:" << result3; - } - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formTwo:[" << formTwo << "]" << std::endl; - - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302)); - std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302); - GTEST_LOG_(INFO) << "FMS_releaseForm_1300, release data4:" << data4 << std::endl; - bool result4 = data4 == "true"; - EXPECT_TRUE(result4); + std::string formTwo = ""; + std::string &formTwo_A = formTwo; + FMS_releaseForm_1300_Create_release(formOne, formTwo_A); + bool cacheRes1 = FmsGetCacheInfoByFormId(atoll(formOne.c_str())); bool timerRes1 = FmsGetFormTimerTask(atoll(formOne.c_str())); bool storageRes1 = FmsGetStorageFormInfos(atoll(formOne.c_str())); @@ -848,6 +780,7 @@ HWTEST_F(FmsReleaseFormTest, FMS_releaseForm_1300, Function | MediumTest | Level SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, formOne); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101)); } + SystemTestFormUtil::CleanMsg(event); std::cout << "============END FMS_releaseForm_1300" << std::endl; } @@ -953,5 +886,102 @@ bool FmsReleaseFormTest::FmsGetFormTimerTask(std::int64_t formId) return false; } } +void FmsReleaseFormTest::FMS_releaseForm_0800_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityReleaseForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_0800, EVENT_CODE_800, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_810); + GTEST_LOG_(INFO) << "FMS_releaseForm_0800, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800); + GTEST_LOG_(INFO) << "FMS_releaseForm_0800, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} + +void FmsReleaseFormTest::FMS_releaseForm_1000_Create(std::string formOne) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityReleaseForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1000, EVENT_CODE_1000, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1010); + GTEST_LOG_(INFO) << "FMS_releaseForm_1000, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000)); + std::string data3 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000); + bool result3 = data3 == "true"; + EXPECT_TRUE(result3); +} + +void FmsReleaseFormTest::FMS_releaseForm_1100_Create(std::string formOne, std::string &formTwo) +{ + std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string abilityName2 = "FormAbilityReleaseForm"; + MAP_STR_STR params2; + Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); + SystemTestFormUtil::StartAbility(want2, abilityManager); + EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); + + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1100, EVENT_CODE_1100, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1110); + GTEST_LOG_(INFO) << "FMS_releaseForm_1100, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100); + GTEST_LOG_(INFO) << "FMS_releaseForm_1100, formTwo:[" << formTwo << "]" << std::endl; + bool result = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result); +} + +void FmsReleaseFormTest::FMS_releaseForm_1300_Create_release(std::string formOne, std::string &formTwo) +{ + std::string eventData2 = formOne; + SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_RELEASE_FORM_1300, EVENT_CODE_1300, eventData2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310)); + std::string data2 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1310); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, acquire data2:" << data2 << std::endl; + bool result2 = data2 == "true"; + EXPECT_TRUE(result2); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301)); + formTwo = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1301); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, formTwo:[" << formTwo << "]" << std::endl; + bool result3 = (formTwo != "false" && formTwo != ""); + EXPECT_TRUE(result3); + + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302)); + std::string data4 = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1302); + GTEST_LOG_(INFO) << "FMS_releaseForm_1300, release data4:" << data4 << std::endl; + bool result4 = data4 == "true"; + EXPECT_TRUE(result4); +} } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file -- Gitee From f22cc4e4d576b65b64bedf88eee1a86e428f9a7a Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 16:27:34 +0800 Subject: [PATCH 27/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms_acquire_form_test/fms_acquire_form_test.cpp | 2 +- .../fms_acquire_form_test_batch.cpp | 2 +- .../fms/fms_delete_form_test/fms_delete_form_test.cpp | 10 +++++----- .../fms_release_form_test/fms_release_form_test.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index aaacade769..d9915ac8da 100755 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -1468,7 +1468,7 @@ bool FmsAcquireFormTest::CompareCacheFormData(std::string formInfo) } while (false); return result; } -std::string getHapSourceDirs() +std::string FmsAcquireFormTest::getHapSourceDirs() { std::string hapSourceDirsPre = " hapSourceDirs [ hapSourceDir "; std::string hapSourceDirs = "[/data/accounts/account_0/applications"; diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp index 3b096aeac8..74ac8d83d9 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp @@ -167,7 +167,7 @@ bool FmsAcquireFormTestBatch::SubscribeEvent() /** * @tc.number: FMS_acquireForm_2900 - * @tc.name: A single host creates 256 different provider forms. + * @tc.name: A single host creates 256 different pv forms. * @tc.desc: The single host can successfully create 256 different provider forms. */ HWTEST_F(FmsAcquireFormTestBatch, FMS_acquireForm_2900, Function | MediumTest | Level1) diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index 1e429172c7..32c36772e3 100755 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -647,7 +647,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_0700_2, Function | MediumTest | Level FMS_deleteForm__0700_2_Create(formOne, formTwo_A); // can receive onDelete - EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2,EVENT_CODE_700_2)); + EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2)); std::string onDeleteData = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_0700_2, EVENT_CODE_700_2); EXPECT_TRUE(onDeleteData == formTwo); @@ -910,7 +910,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) GTEST_LOG_(INFO) << "========FMS_deleteForm_1200 [#Delete#]formId:[" << formIds[i] << "]======>>index:" << i; bool result2 = (data2 != "false" && data2 != ""); EXPECT_TRUE(result2); - bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); + bool cacheRes = FmsGetCacheInfoByFormId(atoll(data2.c_str())); bool storageRes = FmsGetStorageFormInfos(atoll(data2.c_str())); EXPECT_FALSE(cacheRes); EXPECT_FALSE(storageRes); @@ -1103,7 +1103,7 @@ void FmsDeleteFormTest::FMS_deleteForm_0700_Create(std::string formOne, std::str SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(7); + sleep(SEVEN); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700, EVENT_CODE_700, eventData2); @@ -1127,7 +1127,7 @@ void FmsDeleteFormTest::FMS_deleteForm__0700_1_Create(std::string formOne, std:: Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(3); + sleep(THREE); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_1, EVENT_CODE_700_1, eventData2); @@ -1151,7 +1151,7 @@ void FmsDeleteFormTest::FMS_deleteForm__0700_2_Create(std::string formOne, std:: Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); SystemTestFormUtil::StartAbility(want2, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); - sleep(3); + sleep(THREE); std::string eventData2 = formOne; SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_0700_2, EVENT_CODE_700_2, eventData2); diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp index 2601892d22..74ffdbca26 100755 --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -913,7 +913,7 @@ void FmsReleaseFormTest::FMS_releaseForm_0800_Create(std::string formOne, std::s void FmsReleaseFormTest::FMS_releaseForm_1000_Create(std::string formOne) { - std::string bundleName2 = "com.ohos.form.manager.normal"; + std::string bundleName2 = "com.ohos.form.manager.normal"; std::string abilityName2 = "FormAbilityReleaseForm"; MAP_STR_STR params2; Want want2 = SystemTestFormUtil::MakeWant("device", abilityName2, bundleName2, params2); -- Gitee From 36541fb73a1b5a15cef4d59bc58ae4dfa2c6ec6b Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 17:44:32 +0800 Subject: [PATCH 28/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../include/fuzz_test_config_parser.h | 35 +++++++++++-------- .../fms_fuzz_test/include/fuzz_test_manager.h | 23 ++++-------- .../fms/fms_fuzz_test/src/fms_fuzz_test.cpp | 2 +- .../fms_fuzz_test/src/fuzz_test_manager.cpp | 15 ++++---- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h index e4ec9f973d..1024881869 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h @@ -40,7 +40,6 @@ public: std::cout << __FUNCTION__ << " invalid file path, check!" << std::endl; return; } - nlohmann::json jsonObj; std::ifstream(path) >> jsonObj; std::cout << path; @@ -49,23 +48,29 @@ public: ftd.mainLoopFlag = it.value(); continue; } + CreateFuzzTestData(path, it.key(), ftd); + } + } - auto className = it.key(); - if (it->is_structured()) { - for (auto itm = it->begin(); itm != it->end(); ++itm) { - auto methodName = itm.key(); - if (!(it->is_structured() && (it->size() != 0))) { - ftd.methodVec.push_back(className + methodName); - continue; - } +private: + void CreateFuzzTestData(const std::string &path, const std::string className, FuzzTestData &ftd) { + nlohmann::json jsonObj; + std::ifstream(path) >> jsonObj; + auto it = jsonObj.find(className); - std::string param {}; - for (auto itp = itm->begin(); itp != itm->end(); ++itp) { - auto tp = itp.value(); - param += tp; - } - ftd.methodVec.push_back(className + methodName + param); + if (it->is_structured()) { + for (auto itm = it->begin(); itm != it->end(); ++itm) { + auto methodName = itm.key(); + if (!(it->is_structured() && (it->size() != 0))) { + ftd.methodVec.push_back(className + methodName); + continue; + } + std::string param {}; + for (auto itp = itm->begin(); itp != itm->end(); ++itp) { + auto tp = itp.value(); + param += tp; } + ftd.methodVec.push_back(className + methodName + param); } } } diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h index 6cb77dbc08..8c758fc3eb 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h @@ -16,24 +16,17 @@ #define FormManagerFuzzTest_H #include +#include #include #include #include "nlohmann/json.hpp" namespace OHOS { namespace AppExecFwk { -class FuzzTestManager { +class FuzzTestManager final : public DelayedRefSingleton { + DECLARE_DELAYED_REF_SINGLETON(FuzzTestManager) public: - typedef std::shared_ptr Ptr; - ~FuzzTestManager() - {} - static Ptr GetInstance() - { - if (fuzzTestInstance == nullptr) { - fuzzTestInstance = std::shared_ptr(new FuzzTestManager); - } - return fuzzTestInstance; - } + DISALLOW_COPY_AND_MOVE(FuzzTestManager); void StartFuzzTest(); @@ -43,15 +36,11 @@ private: void RegisterFormManagerAbilityC(); void SetJsonFunction(std::string); void SetExecutionTimes(uint16_t executionTimes); - FuzzTestManager(); - FuzzTestManager(FuzzTestManager &) = delete; - FuzzTestManager &operator=(const FuzzTestManager &) = delete; - static Ptr fuzzTestInstance; + void RegisterFormManagerAbility(); + uint16_t m_executionTimes {}; std::unordered_map remainderMap_ {}; std::unordered_map> callFunctionMap_ {}; - - void RegisterFormManagerAbility(); }; } // namespace AppExecFwk } // namespace OHOS diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp index ca972a6468..f7cba6dc41 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp @@ -65,7 +65,7 @@ HWTEST_F(FmsFuzzTest, FMS_fuzztest_0100, Function | MediumTest | Level1) { std::cout << "Begin FMS_fuzztest_0100" << std::endl; - FuzzTestManager::GetInstance()->StartFuzzTest(); + FuzzTestManager::GetInstance().StartFuzzTest(); std::cout << "End FMS_fuzztest_0100" << std::endl; } diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp index 352cb3dd7c..9ae78618c7 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp @@ -29,9 +29,17 @@ using namespace OHOS::AppExecFwk; namespace OHOS { namespace AppExecFwk { -std::shared_ptr FuzzTestManager::fuzzTestInstance = nullptr; const std::string formManagerAbilityKitName = "FormManagerAbility"; +FuzzTestManager::FuzzTestManager() +{ + RegisterFormManagerAbility(); +} + +FuzzTestManager::~FuzzTestManager() +{ +} + // RegisterFormManagerAbility void FuzzTestManager::RegisterFormManagerAbility() { @@ -154,11 +162,6 @@ void FuzzTestManager::RegisterFormManagerAbilityC() }; } -FuzzTestManager::FuzzTestManager() -{ - RegisterFormManagerAbility(); -} - void FuzzTestManager::SetJsonFunction(std::string functionName) { remainderMap_.emplace(functionName, m_executionTimes); -- Gitee From e37ec2a5d2230de547d0371aac13248f103031f9 Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Thu, 2 Dec 2021 18:29:01 +0800 Subject: [PATCH 29/29] fms_st Signed-off-by: zhaoyuan17@huawei.com --- .../fms/fms_fuzz_test/include/fuzz_test_config_parser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h index 1024881869..4fc7901d00 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h +++ b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h @@ -53,11 +53,11 @@ public: } private: - void CreateFuzzTestData(const std::string &path, const std::string className, FuzzTestData &ftd) { + void CreateFuzzTestData(const std::string &path, const std::string className, FuzzTestData &ftd) + { nlohmann::json jsonObj; std::ifstream(path) >> jsonObj; auto it = jsonObj.find(className); - if (it->is_structured()) { for (auto itm = it->begin(); itm != it->end(); ++itm) { auto methodName = itm.key(); -- Gitee