diff --git a/bundle.json b/bundle.json index 83769e4673..36eeda5029 100644 --- a/bundle.json +++ b/bundle.json @@ -270,6 +270,14 @@ }, "name": "//foundation/ability/ability_runtime/frameworks/native/ability/native:extensionkit_native" }, + { + "header": { + "header_base": "//foundation/ability/ability_runtime/interfaces/kits/native/ability/native/", + "header_files": [ + ] + }, + "name": "//foundation/ability/ability_runtime/frameworks/native/ability/native:abilitykit_utils" + }, { "header": { "header_base": "//foundation/ability/ability_runtime/interfaces/kits/native/ability/native/", diff --git a/frameworks/native/ability/native/BUILD.gn b/frameworks/native/ability/native/BUILD.gn index 8d4c4ea535..e6e0d96820 100644 --- a/frameworks/native/ability/native/BUILD.gn +++ b/frameworks/native/ability/native/BUILD.gn @@ -137,12 +137,10 @@ ohos_shared_library("abilitykit_utils") { sources = [ "${ability_runtime_native_path}/ability/native/ability_handler.cpp", "${ability_runtime_native_path}/ability/native/ability_local_record.cpp", - "${ability_runtime_native_path}/ability/native/application_configuration_manager.cpp", "${ability_runtime_native_path}/ability/native/configuration_utils.cpp", - "${ability_runtime_native_path}/ability/native/resource_config_helper.cpp", ] - deps = [] + deps = [ ":configuration_helper" ] configs = [ ":abilitykit_utils_exceptions" ] @@ -190,6 +188,68 @@ ohos_shared_library("abilitykit_utils") { part_name = "ability_runtime" } +ohos_shared_library("configuration_helper") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + + branch_protector_ret = "pac_ret" + + include_dirs = [ + "${ability_runtime_path}/interfaces/kits/native/ability/native", + "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app", + "${ability_runtime_innerkits_path}/ability_manager/include", + "${ability_runtime_innerkits_path}/wantagent/include", + "${ability_runtime_services_path}/abilitymgr/include", + "${ability_runtime_services_path}/common/include", + ] + + sources = [ + "${ability_runtime_native_path}/ability/native/application_configuration_manager.cpp", + "${ability_runtime_native_path}/ability/native/resource_config_helper.cpp", + ] + + deps = [] + + external_deps = [ + "ability_base:configuration", + "ability_base:want", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "c_utils:utils", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "json:nlohmann_json_static", + "jsoncpp:jsoncpp", + "napi:ace_napi", + "resource_management:global_resmgr", + ] + + if (ability_runtime_graphics) { + external_deps += [ + "ability_base:session_info", + "graphic_2d:color_manager", + "icu:shared_icuuc", + "image_framework:image_native", + "window_manager:libdm", + "window_manager:libwm", + "window_manager:libwmutil", + ] + } + + subsystem_name = "ability" + part_name = "ability_runtime" +} + ohos_shared_library("abilitykit_native") { branch_protector_ret = "pac_ret" @@ -241,6 +301,7 @@ ohos_shared_library("abilitykit_native") { ] deps = [ + ":configuration_helper", ":continuation_ipc", ":extension_blocklist_config", ":ui_service_extension_connection", @@ -377,6 +438,7 @@ config("extensionkit_public_config") { "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", "${ability_runtime_path}/interfaces/kits/native/appkit/app", "${ability_runtime_innerkits_path}/app_manager/include/appmgr", + "${ability_runtime_services_path}/common/include", ] if (ability_runtime_graphics) { @@ -412,6 +474,7 @@ ohos_shared_library("extensionkit_native") { public_configs = [ ":extensionkit_public_config" ] deps = [ + ":configuration_helper", "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/runtime:runtime", @@ -546,6 +609,7 @@ ohos_shared_library("uiabilitykit_native") { deps = [ ":abilitykit_native", + ":configuration_helper", ":continuation_ipc", ":ui_extension", "${ability_runtime_innerkits_path}/ability_manager:ability_manager", diff --git a/frameworks/native/ability/native/ability_local_record.cpp b/frameworks/native/ability/native/ability_local_record.cpp index d6a715ad5e..4787d099be 100644 --- a/frameworks/native/ability/native/ability_local_record.cpp +++ b/frameworks/native/ability/native/ability_local_record.cpp @@ -19,8 +19,9 @@ namespace OHOS { namespace AppExecFwk { -AbilityLocalRecord::AbilityLocalRecord(const std::shared_ptr &info, const sptr &token) - : abilityInfo_(info), token_(token) {} +AbilityLocalRecord::AbilityLocalRecord(const std::shared_ptr &info, const sptr &token, + const std::shared_ptr &want, int32_t abilityRecordId) + : abilityInfo_(info), token_(token), want_(want), abilityRecordId_(abilityRecordId) {} AbilityLocalRecord::~AbilityLocalRecord() {} @@ -29,31 +30,16 @@ const std::shared_ptr &AbilityLocalRecord::GetAbilityInfo() return abilityInfo_; } -const std::shared_ptr &AbilityLocalRecord::GetEventHandler() -{ - return handler_; -} - -void AbilityLocalRecord::SetEventHandler(const std::shared_ptr &handler) -{ - handler_ = handler; -} - -const std::shared_ptr &AbilityLocalRecord::GetEventRunner() -{ - return runner_; -} - -void AbilityLocalRecord::SetEventRunner(const std::shared_ptr &runner) -{ - runner_ = runner; -} - const sptr &AbilityLocalRecord::GetToken() { return token_; } +int32_t AbilityLocalRecord::GetAbilityRecordId() const +{ + return abilityRecordId_; +} + const sptr &AbilityLocalRecord::GetAbilityThread() { return abilityThread_; @@ -64,11 +50,6 @@ void AbilityLocalRecord::SetAbilityThread(const sptr &abilityThre abilityThread_ = abilityThread; } -void AbilityLocalRecord::SetWant(const std::shared_ptr &want) -{ - want_ = want; -} - const std::shared_ptr &AbilityLocalRecord::GetWant() { return want_; diff --git a/frameworks/native/ability/native/extension_ability_thread.cpp b/frameworks/native/ability/native/extension_ability_thread.cpp index 50ff5cdbfd..532b34c9e5 100644 --- a/frameworks/native/ability/native/extension_ability_thread.cpp +++ b/frameworks/native/ability/native/extension_ability_thread.cpp @@ -239,8 +239,6 @@ void ExtensionAbilityThread::HandleAttach(const std::shared_ptrGetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - mainRunner == nullptr ? abilityRecord->SetEventRunner(runner_) : abilityRecord->SetEventRunner(mainRunner); abilityRecord->SetAbilityThread(this); HandleAttachInner(application, abilityRecord); } diff --git a/frameworks/native/ability/native/fa_ability_thread.cpp b/frameworks/native/ability/native/fa_ability_thread.cpp index 05f025e026..75166a0c06 100644 --- a/frameworks/native/ability/native/fa_ability_thread.cpp +++ b/frameworks/native/ability/native/fa_ability_thread.cpp @@ -285,8 +285,6 @@ void FAAbilityThread::Attach(const std::shared_ptr } currentAbility_.reset(ability); token_ = abilityRecord->GetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - abilityRecord->SetEventRunner(mainRunner); abilityRecord->SetAbilityThread(this); std::shared_ptr abilityObject = currentAbility_; std::shared_ptr contextDeal = @@ -356,8 +354,6 @@ void FAAbilityThread::AttachExtension(const std::shared_ptrGetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - abilityRecord->SetEventRunner(mainRunner); abilityRecord->SetAbilityThread(this); extensionImpl_ = std::make_shared(); if (extensionImpl_ == nullptr) { @@ -405,8 +401,6 @@ void FAAbilityThread::AttachExtension(const std::shared_ptrGetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - abilityRecord->SetEventRunner(runner_); abilityRecord->SetAbilityThread(this); extensionImpl_ = std::make_shared(); if (extensionImpl_ == nullptr) { @@ -460,8 +454,6 @@ void FAAbilityThread::Attach(const std::shared_ptr } currentAbility_.reset(ability); token_ = abilityRecord->GetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - abilityRecord->SetEventRunner(runner_); abilityRecord->SetAbilityThread(this); std::shared_ptr abilityObject = currentAbility_; std::shared_ptr contextDeal = diff --git a/frameworks/native/ability/native/ui_ability_thread.cpp b/frameworks/native/ability/native/ui_ability_thread.cpp index d2c23c1327..23a64db970 100644 --- a/frameworks/native/ability/native/ui_ability_thread.cpp +++ b/frameworks/native/ability/native/ui_ability_thread.cpp @@ -140,8 +140,6 @@ void UIAbilityThread::Attach(const std::shared_ptr ability->SetAbilityRecordId(abilityRecord->GetAbilityRecordId()); currentAbility_.reset(ability); token_ = abilityRecord->GetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - abilityRecord->SetEventRunner(mainRunner); abilityRecord->SetAbilityThread(this); std::shared_ptr abilityObject = currentAbility_; std::shared_ptr contextDeal = @@ -212,8 +210,6 @@ void UIAbilityThread::Attach(const std::shared_ptr ability->SetAbilityRecordId(abilityRecord->GetAbilityRecordId()); currentAbility_.reset(ability); token_ = abilityRecord->GetToken(); - abilityRecord->SetEventHandler(abilityHandler_); - abilityRecord->SetEventRunner(runner_); abilityRecord->SetAbilityThread(this); std::shared_ptr abilityObject = currentAbility_; std::shared_ptr contextDeal = diff --git a/frameworks/native/appkit/BUILD.gn b/frameworks/native/appkit/BUILD.gn index fe9d6575e7..f27a4a7939 100644 --- a/frameworks/native/appkit/BUILD.gn +++ b/frameworks/native/appkit/BUILD.gn @@ -159,6 +159,7 @@ ohos_shared_library("appkit_native") { "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:app_context_utils", diff --git a/frameworks/native/appkit/app/ability_record_mgr.cpp b/frameworks/native/appkit/app/ability_record_mgr.cpp index 24ed12757c..fd4d7867a5 100644 --- a/frameworks/native/appkit/app/ability_record_mgr.cpp +++ b/frameworks/native/appkit/app/ability_record_mgr.cpp @@ -41,32 +41,6 @@ void AbilityRecordMgr::SetToken(const sptr &token) tokens_ = token; } -/** - * @brief Set the eventRunner of abilitythread to the AbilityRecordMgr. - * - * @param eventRunner The runner of the abilitythread. - * - */ -void AbilityRecordMgr::SetEventRunner(const std::shared_ptr &eventRunner) -{ - if (eventRunner == nullptr) { - TAG_LOGE(AAFwkTag::APPKIT, "eventRunner is nullptr"); - return; - } - sptr token = GetToken(); - if (token == nullptr) { - TAG_LOGE(AAFwkTag::APPKIT, "token is nullptr"); - return; - } - - std::shared_ptr abilityInstance = GetAbilityItem(token); - if (abilityInstance != nullptr) { - abilityInstance->SetEventRunner(eventRunner); - } else { - TAG_LOGW(AAFwkTag::APPKIT, "ability record not exist"); - } -} - /** * @brief Save the token and abilityRecord to the AbilityRecordMgr. * diff --git a/frameworks/native/appkit/app/main_thread.cpp b/frameworks/native/appkit/app/main_thread.cpp index ba4bf0b863..9683f3e173 100644 --- a/frameworks/native/appkit/app/main_thread.cpp +++ b/frameworks/native/appkit/app/main_thread.cpp @@ -706,9 +706,7 @@ void MainThread::ScheduleLaunchAbility(const AbilityInfo &info, const sptr abilityInfo = std::make_shared(info); - auto abilityRecord = std::make_shared(abilityInfo, token); - abilityRecord->SetWant(want); - abilityRecord->SetAbilityRecordId(abilityRecordId); + auto abilityRecord = std::make_shared(abilityInfo, token, want, abilityRecordId); auto tmpWatchdog = watchdog_; if (tmpWatchdog != nullptr) { tmpWatchdog->SetBgWorkingThreadStatus(IsBgWorkingThread(info)); diff --git a/interfaces/kits/native/ability/native/ability_local_record.h b/interfaces/kits/native/ability/native/ability_local_record.h index 0689b7c430..e9af2de92a 100644 --- a/interfaces/kits/native/ability/native/ability_local_record.h +++ b/interfaces/kits/native/ability/native/ability_local_record.h @@ -19,16 +19,13 @@ #include #include "iremote_object.h" -#include "event_runner.h" #include "ability_info.h" -#include "application_info.h" #include "refbase.h" #include "want.h" namespace OHOS { namespace AppExecFwk { class AbilityThread; -class AbilityImpl; class AbilityLocalRecord { public: /** @@ -36,7 +33,8 @@ public: * default constructor * */ - AbilityLocalRecord(const std::shared_ptr &info, const sptr &token); + AbilityLocalRecord(const std::shared_ptr &info, const sptr &token, + const std::shared_ptr &want, int32_t abilityRecordId); /** * @@ -52,48 +50,13 @@ public: */ const std::shared_ptr &GetAbilityInfo(); - /** - * @description: Get an EventHandler in an ability. - * - * @return Returns a pointer to EventHandler - */ - const std::shared_ptr &GetEventHandler(); - - /** - * @description: Set an EventHandler in an ability. - * @param handler EventHandler object - * @return None. - */ - void SetEventHandler(const std::shared_ptr &handler); - - /** - * @description: Get an EventRunner in an ability. - * - * @return Returns a pointer to EventRunner - */ - const std::shared_ptr &GetEventRunner(); - - /** - * @description: Set an EventRunner in an ability. - * @param runner EventHandler object - * @return None. - */ - void SetEventRunner(const std::shared_ptr &runner); - /** * @description: Gets the identity of the ability * @return return the identity of the ability. */ const sptr &GetToken(); - int32_t GetAbilityRecordId() const - { - return abilityRecordId_; - } - void SetAbilityRecordId(int32_t abilityRecordId) - { - abilityRecordId_ = abilityRecordId; - } + int32_t GetAbilityRecordId() const; /** * @description: Obtains the information based on ability thread. @@ -113,14 +76,11 @@ public: const std::shared_ptr &GetWant(); private: std::shared_ptr abilityInfo_ = nullptr; - sptr token_; - int32_t abilityRecordId_ = 0; - std::shared_ptr runner_ = nullptr; - std::shared_ptr handler_ = nullptr; - std::shared_ptr abilityImpl_ = nullptr; // store abilityImpl - sptr abilityThread_; + sptr token_ = nullptr; std::shared_ptr want_ = nullptr; + int32_t abilityRecordId_ = 0; + sptr abilityThread_; }; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_LOCAL_RECORD_H +} // namespace AppExecFwk +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_ABILITY_LOCAL_RECORD_H diff --git a/interfaces/kits/native/ability/native/ability_thread.h b/interfaces/kits/native/ability/native/ability_thread.h index b1c5f293be..3ad1873200 100644 --- a/interfaces/kits/native/ability/native/ability_thread.h +++ b/interfaces/kits/native/ability/native/ability_thread.h @@ -18,6 +18,7 @@ #include "ability_scheduler_stub.h" #include "context.h" +#include "event_runner.h" #include "ohos_application.h" namespace OHOS { diff --git a/interfaces/kits/native/appkit/app/ability_record_mgr.h b/interfaces/kits/native/appkit/app/ability_record_mgr.h index 14e9f575e2..99fc3d1cc2 100644 --- a/interfaces/kits/native/appkit/app/ability_record_mgr.h +++ b/interfaces/kits/native/appkit/app/ability_record_mgr.h @@ -28,14 +28,6 @@ public: AbilityRecordMgr() = default; ~AbilityRecordMgr() = default; - /** - * @brief Set the eventRunner of abilitythread to the AbilityRecordMgr. - * - * @param eventRunner The runner of the abilitythread. - * - */ - void SetEventRunner(const std::shared_ptr &eventRunner); - /** * @brief Get the token witch is set to the AbilityRecordMgr. * diff --git a/test/mock/frameworks_kits_test/DemoObServer/mock_ability_thread_for_data_observer.h b/test/mock/frameworks_kits_test/DemoObServer/mock_ability_thread_for_data_observer.h index 73c54cbabf..2ee30e7515 100644 --- a/test/mock/frameworks_kits_test/DemoObServer/mock_ability_thread_for_data_observer.h +++ b/test/mock/frameworks_kits_test/DemoObServer/mock_ability_thread_for_data_observer.h @@ -55,7 +55,7 @@ sptr MockCreateAbilityThread() sptr token = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(info->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); diff --git a/test/moduletest/ability_test/ability_context_test.cpp b/test/moduletest/ability_test/ability_context_test.cpp index a195cedd4c..f687eed373 100644 --- a/test/moduletest/ability_test/ability_context_test.cpp +++ b/test/moduletest/ability_test/ability_context_test.cpp @@ -89,7 +89,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_ConnectAbility_0100, Function std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -115,7 +115,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_DisconnectAbility_0100, Funct std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -142,7 +142,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_StartAbility_0100, Function | std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); Want want; @@ -163,7 +163,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_TerminateAbility_0100, Functi std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); Want want; @@ -190,7 +190,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_TerminateAbility_0200, Functi std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -214,7 +214,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_StopService_0100, Function | std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -243,7 +243,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_StopService_0200, Function | std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); @@ -331,7 +331,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_ConnectAbility_0300, Function std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); deal->SetAbilityInfo(abilityInfo); @@ -353,7 +353,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_StopService_0300, Function | std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); @@ -555,7 +555,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_GetAbilityInfoType_0200, Func std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); @@ -602,7 +602,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_GetResourceManager_0200, Func std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); deal->SetAbilityInfo(abilityInfo); @@ -651,7 +651,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_VerifyPermission_0300, Functi std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::SERVICE; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); deal->SetAbilityInfo(abilityInfo); @@ -896,7 +896,7 @@ HWTEST_F(AbilityContextTest, AaFwk_Ability_Context_SetColorMode_0100, Function | std::shared_ptr application = std::make_shared(); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); std::shared_ptr deal = std::make_shared(); deal->SetAbilityInfo(abilityInfo); diff --git a/test/moduletest/ability_test/ability_test.cpp b/test/moduletest/ability_test/ability_test.cpp index 5ff98d231e..621773963e 100644 --- a/test/moduletest/ability_test/ability_test.cpp +++ b/test/moduletest/ability_test/ability_test.cpp @@ -93,8 +93,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Start_Test_0100, Function | M abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); usleep(AbilityBaseTest::TEST_WAIT_TIME); @@ -117,8 +116,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Start_Test_0200, Function | M abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); usleep(AbilityBaseTest::TEST_WAIT_TIME); @@ -154,8 +152,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Start_Test_0400, Function | M if (abilityToken != nullptr) { std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::PAGE; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); usleep(AbilityBaseTest::TEST_WAIT_TIME); @@ -177,8 +174,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Start_Test_0500, Function | M std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); usleep(AbilityBaseTest::TEST_WAIT_TIME); @@ -218,8 +214,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Start_Test_0600, Function | M abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -252,8 +247,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_Lifecycle_Test_0100, Function | MediumTe abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -283,8 +277,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Lifecycle_Test_0200, Function abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -315,8 +308,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Lifecycle_Test_0300, Function abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -350,8 +342,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Lifecycle_Test_0400, Function abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -384,8 +375,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Lifecycle_Test_0500, Function abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -420,8 +410,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_AbilityFwk_Lifecycle_Test_0600, Function abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -457,8 +446,7 @@ HWTEST_F(AbilityBaseTest, AaFwk_Ability_TerminateAbility_ForResult_Test_0100, Fu abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -527,8 +515,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0100, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_001 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -564,8 +551,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0200, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_002 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -601,8 +587,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0300, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_0300 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -638,8 +623,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0400, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_0400 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -675,8 +659,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0500, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_005 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -707,8 +690,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0600, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_006 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -739,8 +721,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0700, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_007 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -771,8 +752,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_Ability_Terminate_test_0800, Function | Med abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_Ability_Terminate_test_008 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -803,8 +783,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_WMS_window_test_0100, Function | MediumTest abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_WMS_window_test_001 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -836,8 +815,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_WMS_window_test_0200, Function | MediumTest abilityInfo->type = AppExecFwk::AbilityType::PAGE; abilityInfo->name = ABILITY_NAME; abilityInfo->isNativeAbility = true; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); GTEST_LOG_(INFO) << "AaFwk_WMS_window_test_002 AbilityThreadMain"; AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -873,8 +851,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_DataAbility_Launch_0100, Function | MediumT std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -906,8 +883,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_DataAbility_Start_0100, Function | MediumTe std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -939,8 +915,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_DataAbility_Start_0200, Function | MediumTe std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -972,8 +947,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_DataAbility_Start_0300, Function | MediumTe std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); @@ -1005,8 +979,7 @@ HWTEST_F(AbilityTerminateTest, AaFwk_DataAbility_Start_0400, Function | MediumTe std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->type = AppExecFwk::AbilityType::DATA; abilityInfo->name = "DemoAbility"; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); AbilityThread::AbilityThreadMain(application, abilityRecord, nullptr); diff --git a/test/unittest/ability_extension_base_test/ability_extension_base_test.cpp b/test/unittest/ability_extension_base_test/ability_extension_base_test.cpp index db15e3be09..d2a7d45dfb 100644 --- a/test/unittest/ability_extension_base_test/ability_extension_base_test.cpp +++ b/test/unittest/ability_extension_base_test/ability_extension_base_test.cpp @@ -96,8 +96,7 @@ HWTEST_F(AbilityExtensionBaseTest, CreateAndInitContext_0100, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "ExtensionBaseTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -127,8 +126,7 @@ HWTEST_F(AbilityExtensionBaseTest, GetContext_0100, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "ExtensionBaseTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -157,8 +155,7 @@ HWTEST_F(AbilityExtensionBaseTest, OnConfigurationUpdated_0100, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "OnConfigurationUpdated start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -190,8 +187,7 @@ HWTEST_F(AbilityExtensionBaseTest, OnMemoryLevel_0100, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "OnMemoryLevel start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -222,8 +218,7 @@ HWTEST_F(AbilityExtensionBaseTest, SetExtensionCommon_0100, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "SetExtensionCommon start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); diff --git a/test/unittest/ability_extension_context_test/ability_extension_context_test.cpp b/test/unittest/ability_extension_context_test/ability_extension_context_test.cpp index 610ef4f108..8e9acd67dc 100644 --- a/test/unittest/ability_extension_context_test/ability_extension_context_test.cpp +++ b/test/unittest/ability_extension_context_test/ability_extension_context_test.cpp @@ -65,8 +65,7 @@ HWTEST_F(AbilityExtensionContextTest, GetAbilityInfo_0100, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "ExtensionContextTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -98,8 +97,7 @@ HWTEST_F(AbilityExtensionContextTest, SetAbilityInfo_0100, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "ExtensionContextTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -137,8 +135,7 @@ HWTEST_F(AbilityExtensionContextTest, SetAbilityInfo_0200, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "ExtensionContextTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); diff --git a/test/unittest/ability_extension_test/ability_extension_test.cpp b/test/unittest/ability_extension_test/ability_extension_test.cpp index 7da1035311..b4495d4f01 100644 --- a/test/unittest/ability_extension_test/ability_extension_test.cpp +++ b/test/unittest/ability_extension_test/ability_extension_test.cpp @@ -182,8 +182,7 @@ HWTEST_F(AbilityExtensionTest, Init_0200, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "Init start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = nullptr; std::shared_ptr handler = std::make_shared(nullptr); sptr token = nullptr; @@ -206,8 +205,7 @@ HWTEST_F(AbilityExtensionTest, Init_0300, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "Init start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = nullptr; sptr token = nullptr; @@ -230,8 +228,7 @@ HWTEST_F(AbilityExtensionTest, Init_0400, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "Init start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = nullptr; @@ -254,8 +251,7 @@ HWTEST_F(AbilityExtensionTest, Init_0500, TestSize.Level1) TAG_LOGI(AAFwkTag::TEST, "Init start"); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -280,8 +276,7 @@ HWTEST_F(AbilityExtensionTest, OnStart_0100, TestSize.Level1) Extension extension; // Init extension std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -319,8 +314,7 @@ HWTEST_F(AbilityExtensionTest, OnStop_0100, TestSize.Level1) Extension extension; // Init extension std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -346,8 +340,7 @@ HWTEST_F(AbilityExtensionTest, OnConnect_0100, TestSize.Level1) Extension extension; // Init extension std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -385,8 +378,7 @@ HWTEST_F(AbilityExtensionTest, OnDisconnect_0100, TestSize.Level1) Extension extension; // Init extension std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -424,8 +416,7 @@ HWTEST_F(AbilityExtensionTest, OnDisconnect_0200, TestSize.Level1) Extension extension; // Init extension std::shared_ptr info = std::make_shared(); - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); diff --git a/test/unittest/ability_record_mgr_test/ability_record_mgr_test.cpp b/test/unittest/ability_record_mgr_test/ability_record_mgr_test.cpp index a6730d6206..dff5fb363a 100644 --- a/test/unittest/ability_record_mgr_test/ability_record_mgr_test.cpp +++ b/test/unittest/ability_record_mgr_test/ability_record_mgr_test.cpp @@ -97,29 +97,6 @@ HWTEST_F(AbilityRecordMgrTest, SetToken_0100, TestSize.Level0) GTEST_LOG_(INFO) << "AbilityRecordMgrTest SetToken_0100 end"; } -/** - * @tc.number: SetEventRunner_0100 - * @tc.name: SetEventRunner - * @tc.desc: SetEventRunner Test, return is not nullptr. - */ -HWTEST_F(AbilityRecordMgrTest, SetEventRunner_0100, TestSize.Level0) -{ - GTEST_LOG_(INFO) << "AbilityRecordMgrTest SetEventRunner_0100 start"; - auto recordMgr = std::make_shared(); - EXPECT_NE(recordMgr, nullptr); - recordMgr->SetEventRunner(nullptr); - - std::shared_ptr runner = EventRunner::GetMainEventRunner(); - EXPECT_NE(runner, nullptr); - recordMgr->tokens_ = nullptr; - recordMgr->SetEventRunner(runner); - - sptr token = new (std::nothrow) AbilityMgrToken(); - recordMgr->SetToken(token); - recordMgr->SetEventRunner(runner); - GTEST_LOG_(INFO) << "AbilityRecordMgrTest SetEventRunner_0100 end"; -} - /** * @tc.number: AddAbilityRecord_0100 * @tc.name: AddAbilityRecord @@ -136,7 +113,7 @@ HWTEST_F(AbilityRecordMgrTest, AddAbilityRecord_0100, TestSize.Level0) token = new (std::nothrow) AbilityMgrToken(); recordMgr->AddAbilityRecord(token, nullptr); - auto abilityRecord = std::make_shared(nullptr, nullptr); + auto abilityRecord = std::make_shared(nullptr, nullptr, nullptr, 0); EXPECT_NE(abilityRecord, nullptr); recordMgr->AddAbilityRecord(token, abilityRecord); @@ -158,7 +135,7 @@ HWTEST_F(AbilityRecordMgrTest, RemoveAbilityRecord_0100, TestSize.Level0) recordMgr->RemoveAbilityRecord(token); token = new (std::nothrow) AbilityMgrToken(); - auto abilityRecord = std::make_shared(nullptr, nullptr); + auto abilityRecord = std::make_shared(nullptr, nullptr, nullptr, 0); recordMgr->AddAbilityRecord(token, abilityRecord); EXPECT_EQ(recordMgr->abilityRecords_.size(), 1); @@ -179,7 +156,7 @@ HWTEST_F(AbilityRecordMgrTest, GetRecordCount_0100, TestSize.Level0) EXPECT_EQ(recordMgr->GetRecordCount(), 0); sptr token = new (std::nothrow) AbilityMgrToken(); - auto abilityRecord = std::make_shared(nullptr, nullptr); + auto abilityRecord = std::make_shared(nullptr, nullptr, nullptr, 0); recordMgr->AddAbilityRecord(token, abilityRecord); EXPECT_EQ(recordMgr->GetRecordCount(), 1); GTEST_LOG_(INFO) << "AbilityRecordMgrTest GetRecordCount_0100 end"; @@ -198,7 +175,7 @@ HWTEST_F(AbilityRecordMgrTest, GetAbilityItem_0100, TestSize.Level0) EXPECT_EQ(recordMgr->GetAbilityItem(token), nullptr); token = new (std::nothrow) AbilityMgrToken(); - auto abilityRecord = std::make_shared(nullptr, nullptr); + auto abilityRecord = std::make_shared(nullptr, nullptr, nullptr, 0); recordMgr->AddAbilityRecord(token, abilityRecord); EXPECT_NE(recordMgr->GetAbilityItem(token), nullptr); @@ -219,7 +196,7 @@ HWTEST_F(AbilityRecordMgrTest, GetAllTokens_0100, TestSize.Level0) auto recordMgr = std::make_shared(); sptr token = new (std::nothrow) AbilityMgrToken(); - auto abilityRecord = std::make_shared(nullptr, nullptr); + auto abilityRecord = std::make_shared(nullptr, nullptr, nullptr, 0); recordMgr->AddAbilityRecord(token, abilityRecord); EXPECT_EQ(recordMgr->GetAllTokens().size(), 1); diff --git a/test/unittest/ability_service_extension_test/BUILD.gn b/test/unittest/ability_service_extension_test/BUILD.gn index a554bbe461..6e1093bfbd 100644 --- a/test/unittest/ability_service_extension_test/BUILD.gn +++ b/test/unittest/ability_service_extension_test/BUILD.gn @@ -45,6 +45,7 @@ ohos_unittest("ability_service_extension_test") { deps = [ "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:service_extension", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", diff --git a/test/unittest/ability_service_extension_test/ability_service_extension_test.cpp b/test/unittest/ability_service_extension_test/ability_service_extension_test.cpp index c91cf9661b..976756c164 100644 --- a/test/unittest/ability_service_extension_test/ability_service_extension_test.cpp +++ b/test/unittest/ability_service_extension_test/ability_service_extension_test.cpp @@ -82,7 +82,7 @@ HWTEST_F(AbilityServiceExtensionTest, CreateAndInitContext_0100, TestSize.Level1 applicationContext->AttachContextImpl(contextImpl); application->SetApplicationContext(applicationContext); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr handler = std::make_shared(nullptr); ServiceExtension* serviceExtension = ServiceExtension::Create(nullptr); @@ -115,7 +115,7 @@ HWTEST_F(AbilityServiceExtensionTest, Init_0100, TestSize.Level1) applicationContext->AttachContextImpl(contextImpl); application->SetApplicationContext(applicationContext); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr handler = std::make_shared(nullptr); ServiceExtension* serviceExtension = ServiceExtension::Create(nullptr); diff --git a/test/unittest/appkit/main_thread_test/main_thread_test.cpp b/test/unittest/appkit/main_thread_test/main_thread_test.cpp index 95ff2e2d9f..0d1cd5b548 100644 --- a/test/unittest/appkit/main_thread_test/main_thread_test.cpp +++ b/test/unittest/appkit/main_thread_test/main_thread_test.cpp @@ -666,7 +666,7 @@ HWTEST_F(MainThreadTest, CheckAbilityItem_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "%{public}s start.", __func__); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); EXPECT_FALSE(mainThread_->CheckAbilityItem(record)); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); } @@ -680,7 +680,7 @@ HWTEST_F(MainThreadTest, CheckAbilityItem_0100, TestSize.Level1) HWTEST_F(MainThreadTest, CheckAbilityItem_0200, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "%{public}s start.", __func__); - std::shared_ptr record = std::make_shared(nullptr, nullptr); + auto record = std::make_shared(nullptr, nullptr, nullptr, 0); EXPECT_FALSE(mainThread_->CheckAbilityItem(record)); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); } @@ -991,7 +991,7 @@ HWTEST_F(MainThreadTest, PrepareAbilityDelegator_0400, TestSize.Level1) HWTEST_F(MainThreadTest, HandleLaunchAbility_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "%{public}s start.", __func__); - std::shared_ptr abilityRecord = std::make_shared(nullptr, nullptr); + auto abilityRecord = std::make_shared(nullptr, nullptr, nullptr, 0); ASSERT_NE(abilityRecord, nullptr); mainThread_->HandleLaunchAbility(abilityRecord); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); @@ -1903,11 +1903,11 @@ HWTEST_F(MainThreadTest, HandleLaunchAbility_0200, TestSize.Level1) const std::shared_ptr info1 = nullptr; const sptr token = nullptr; - const std::shared_ptr abilityRecord2 = std::make_shared(info1, token); + const auto abilityRecord2 = std::make_shared(info1, token, nullptr, 0); mainThread_->HandleLaunchAbility(abilityRecord2); const std::shared_ptr info2 = std::make_shared(); - const std::shared_ptr abilityRecord3 = std::make_shared(info2, token); + const auto abilityRecord3 = std::make_shared(info2, token, nullptr, 0); mainThread_->application_ = std::make_shared(); mainThread_->HandleLaunchAbility(abilityRecord3); @@ -1954,7 +1954,7 @@ HWTEST_F(MainThreadTest, HandleCleanAbility_0100, TestSize.Level1) mainThread_->HandleCleanAbility(token); std::shared_ptr info = nullptr; - abilityRecord = std::make_shared(info, token); + abilityRecord = std::make_shared(info, token, nullptr, 0); mainThread_->abilityRecordMgr_->AddAbilityRecord(token, abilityRecord); mainThread_->HandleCleanAbility(token); diff --git a/test/unittest/appkit/ohos_application_test/ohos_application_test.cpp b/test/unittest/appkit/ohos_application_test/ohos_application_test.cpp index 4d1fb6bca2..57f07e54d8 100644 --- a/test/unittest/appkit/ohos_application_test/ohos_application_test.cpp +++ b/test/unittest/appkit/ohos_application_test/ohos_application_test.cpp @@ -129,7 +129,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_DumpApplication_010 ohosApplication_->abilityRecordMgr_ = std::make_shared(); sptr token = new (std::nothrow) Notification::MockIRemoteObject(); std::shared_ptr info = nullptr; - std::shared_ptr record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); ohosApplication_->abilityRecordMgr_->abilityRecords_.emplace(token, record); ohosApplication_->DumpApplication(); EXPECT_TRUE(record != nullptr); @@ -147,7 +147,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_DumpApplication_020 ohosApplication_->abilityRecordMgr_ = std::make_shared(); sptr token = new (std::nothrow) Notification::MockIRemoteObject(); std::shared_ptr info = std::make_shared(); - std::shared_ptr record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); info->permissions.push_back(std::string("abc")); ohosApplication_->abilityRecordMgr_->abilityRecords_.emplace(token, record); ohosApplication_->DumpApplication(); @@ -291,7 +291,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_OnConfigurationUpda ohosApplication_->configuration_ = std::make_shared(); sptr token = new (std::nothrow) Notification::MockIRemoteObject(); std::shared_ptr info = nullptr; - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); ohosApplication_->abilityRecordMgr_->abilityRecords_.emplace(token, abilityRecord); sptr abilityThread = new (std::nothrow) AbilityRuntime::FAAbilityThread(); abilityRecord->SetAbilityThread(abilityThread); @@ -371,7 +371,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_OnMemoryLevel_0100, ohosApplication_->abilityRecordMgr_ = std::make_shared(); std::shared_ptr info = nullptr; sptr token = new (std::nothrow) Notification::MockIRemoteObject(); - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); EXPECT_TRUE(abilityRecord != nullptr); ohosApplication_->abilityRecordMgr_->abilityRecords_.emplace(token, abilityRecord); sptr abilityThread = new (std::nothrow) AbilityRuntime::FAAbilityThread(); @@ -450,7 +450,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_AddAbilityStage_030 GTEST_LOG_(INFO) << "AppExecFwk_OHOSApplicationTest_AddAbilityStage_0300 start."; sptr token = new (std::nothrow) Notification::MockIRemoteObject(); std::shared_ptr info = nullptr; - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); EXPECT_TRUE(ohosApplication_->abilityStages_.empty()); auto callback = [](const std::shared_ptr &) {}; bool isAsyncCallback = false; @@ -469,7 +469,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_AddAbilityStage_040 std::shared_ptr info = std::make_shared(); info->applicationInfo.multiProjects = true; sptr token = new (std::nothrow) Notification::MockIRemoteObject(); - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); auto want = std::make_shared(); abilityRecord->SetWant(want); auto callback = [](const std::shared_ptr &) {}; @@ -490,7 +490,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_AddAbilityStage_050 sptr token = new (std::nothrow) Notification::MockIRemoteObject(); std::shared_ptr info = nullptr; std::string moduleName = "entry"; - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); EXPECT_TRUE(ohosApplication_->abilityStages_.empty()); std::shared_ptr abilityStages = std::make_shared(); ohosApplication_->abilityStages_.emplace(moduleName, abilityStages); @@ -513,7 +513,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_AddAbilityStage_060 sptr token; std::shared_ptr info = std::make_shared(); info->moduleName = "entry"; - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); auto callback = [](const std::shared_ptr &) {}; bool isAsyncCallback = false; ohosApplication_->AddAbilityStage(abilityRecord, callback, isAsyncCallback); @@ -532,7 +532,7 @@ HWTEST_F(OHOSApplicationTest, AppExecFwk_OHOSApplicationTest_AddAbilityStage_070 GTEST_LOG_(INFO) << "AppExecFwk_OHOSApplicationTest_AddAbilityStage_0700 start."; sptr token = new (std::nothrow) Notification::MockIRemoteObject(); std::shared_ptr info = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(info, token); + auto abilityRecord = std::make_shared(info, token, nullptr, 0); abilityRecord->token_ = new (std::nothrow) Notification::MockIRemoteObject(); auto callback = [](const std::shared_ptr &) {}; bool isAsyncCallback = false; diff --git a/test/unittest/cj_ability_stage_object_test/BUILD.gn b/test/unittest/cj_ability_stage_object_test/BUILD.gn index d2b3754015..3bb281c9bf 100644 --- a/test/unittest/cj_ability_stage_object_test/BUILD.gn +++ b/test/unittest/cj_ability_stage_object_test/BUILD.gn @@ -52,6 +52,7 @@ ohos_unittest("cj_ability_stage_object_test") { "${ability_runtime_innerkits_path}/runtime:runtime", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", diff --git a/test/unittest/cj_ability_stage_test/BUILD.gn b/test/unittest/cj_ability_stage_test/BUILD.gn index b659e389ba..314575185e 100644 --- a/test/unittest/cj_ability_stage_test/BUILD.gn +++ b/test/unittest/cj_ability_stage_test/BUILD.gn @@ -55,6 +55,7 @@ ohos_unittest("cj_ability_stage_test") { "${ability_runtime_innerkits_path}/runtime:runtime", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", diff --git a/test/unittest/cj_ui_ability_test/BUILD.gn b/test/unittest/cj_ui_ability_test/BUILD.gn index 2d57d7621a..3707769671 100644 --- a/test/unittest/cj_ui_ability_test/BUILD.gn +++ b/test/unittest/cj_ui_ability_test/BUILD.gn @@ -57,6 +57,7 @@ ohos_unittest("cj_ui_ability_test") { "${ability_runtime_native_path}/ability:ability_context_native", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:insight_intent_executor", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", diff --git a/test/unittest/cj_ui_ability_test/cj_ui_ability_test.cpp b/test/unittest/cj_ui_ability_test/cj_ui_ability_test.cpp index 8b74d21752..7d6f13be39 100644 --- a/test/unittest/cj_ui_ability_test/cj_ui_ability_test.cpp +++ b/test/unittest/cj_ui_ability_test/cj_ui_ability_test.cpp @@ -139,11 +139,11 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_Init_0100, Function | MediumTest | Level1) sptr token = nullptr; cjAbility_->Init(nullptr, application, handler, token); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); abilityInfo->isModuleJson = true; - abilityLocalRecord = std::make_shared(abilityInfo, token); + abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); @@ -186,7 +186,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnNewWant_0100, Function | MediumTest | Leve std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); Want want; @@ -205,7 +205,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnStart_0100, Function | MediumTest | Level1 std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); Want want; @@ -246,7 +246,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnStop_0100, Function | MediumTest | Level1) std::shared_ptr handler = nullptr; std::shared_ptr application = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); cjAbility_->OnStop(); AbilityLifecycleExecutor::LifecycleState state = cjAbility_->GetState(); @@ -273,7 +273,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnBackground_0300, Function | MediumTest | L std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); cjAbility_->OnBackground(); AbilityLifecycleExecutor::LifecycleState state = cjAbility_->GetState(); @@ -342,7 +342,7 @@ HWTEST_F(CjUIAbilityTest, CJUIAbility_OnStop_AsyncCallback_0100, TestSize.Level1 std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); bool isAsyncCallback = false; cjAbility_->OnStop(nullptr, isAsyncCallback); @@ -407,7 +407,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnForeground_0100, Function | MediumTest | L std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); Want want; cjAbility_->OnForeground(want); @@ -452,7 +452,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnForeground_0300, Function | MediumTest | L std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); Want want; cjAbility_->OnForeground(want); @@ -479,8 +479,7 @@ HWTEST_F(CjUIAbilityTest, CJUIAbilityVirtualFunc_0100, TestSize.Level1) pageAbilityInfo->isStageBasedModel = true; auto eventRunner = EventRunner::Create(pageAbilityInfo->name); auto handler = std::make_shared(eventRunner); - std::shared_ptr abilityLocalRecord = - std::make_shared(pageAbilityInfo, nullptr); + auto abilityLocalRecord = std::make_shared(pageAbilityInfo, nullptr, nullptr, 0); cjAbility_->Init(abilityLocalRecord, nullptr, handler, nullptr); cjAbility_->UpdateContextConfiguration(); EXPECT_NE(abilityLocalRecord, nullptr); @@ -531,8 +530,7 @@ HWTEST_F(CjUIAbilityTest, CJUIAbilityRequestFocus_0100, TestSize.Level1) pageAbilityInfo->isStageBasedModel = true; auto eventRunner = EventRunner::Create(pageAbilityInfo->name); auto handler = std::make_shared(eventRunner); - std::shared_ptr abilityLocalRecord = - std::make_shared(pageAbilityInfo, nullptr); + auto abilityLocalRecord = std::make_shared(pageAbilityInfo, nullptr, nullptr, 0); cjAbility_->Init(abilityLocalRecord, nullptr, handler, nullptr); EXPECT_NE(abilityLocalRecord, nullptr); @@ -559,7 +557,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnBackground_0100, Function | MediumTest | L std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); cjAbility_->OnBackground(); AbilityLifecycleExecutor::LifecycleState state = cjAbility_->GetState(); @@ -583,7 +581,7 @@ HWTEST_F(CjUIAbilityTest, CJRuntime_OnBackground_0200, Function | MediumTest | L std::shared_ptr application = nullptr; std::shared_ptr handler = nullptr; sptr token = nullptr; - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); cjAbility_->Init(abilityLocalRecord, application, handler, token); cjAbility_->OnBackground(); AbilityLifecycleExecutor::LifecycleState state = cjAbility_->GetState(); @@ -627,7 +625,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0100, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); @@ -650,7 +648,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0200, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); Want want; @@ -679,7 +677,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0300, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); @@ -706,7 +704,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0400, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); @@ -744,7 +742,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0500, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); @@ -784,7 +782,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0600, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); EXPECT_NE(abilityLocalRecord, nullptr); @@ -819,7 +817,7 @@ HWTEST_F(CjUIAbilityTest, InitedCJUIAbilityTest_0700, TestSize.Level1) sptr token = nullptr; abilityInfo->isModuleJson = false; PreSetCJAbilityStageFuncs(); - std::shared_ptr abilityLocalRecord = std::make_shared(abilityInfo, token); + auto abilityLocalRecord = std::make_shared(abilityInfo, token, nullptr, 0); initedCJUIAbility_->Init(abilityLocalRecord, application, handler, token); Want want; diff --git a/test/unittest/frameworks_kits_ability_native_test/BUILD.gn b/test/unittest/frameworks_kits_ability_native_test/BUILD.gn index af64435466..b3f499df50 100644 --- a/test/unittest/frameworks_kits_ability_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_ability_native_test/BUILD.gn @@ -99,6 +99,7 @@ ohos_unittest("ability_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -618,6 +619,7 @@ ohos_unittest("ability_impl_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -675,6 +677,7 @@ ohos_unittest("ui_ability_impl_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -748,6 +751,7 @@ ohos_unittest("ability_thread_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -826,6 +830,7 @@ ohos_unittest("fa_ability_thread_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -936,6 +941,7 @@ ohos_unittest("ui_ability_thread_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -1319,6 +1325,7 @@ ohos_unittest("data_ability_impl_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -1390,6 +1397,7 @@ ohos_unittest("data_ability_impl_file_secondpart_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -1450,6 +1458,7 @@ ohos_unittest("data_ability_impl_file_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -1512,6 +1521,7 @@ ohos_unittest("ability_thread_dataability_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -1746,6 +1756,7 @@ ohos_unittest("ui_ability_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -1860,6 +1871,7 @@ ohos_unittest("form_host_client_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -1911,6 +1923,7 @@ ohos_unittest("continuation_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -2136,6 +2149,7 @@ ohos_unittest("ability_window_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -2199,6 +2213,7 @@ ohos_unittest("ability_handler_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:app_context_utils", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -2251,6 +2266,7 @@ ohos_unittest("ability_impl_factory_test") { "${ability_runtime_native_path}/ability/native:ability_business_error", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:continuation_ipc", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:app_context_utils", diff --git a/test/unittest/frameworks_kits_ability_native_test/ability_impl_active_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ability_impl_active_test.cpp index c6e3c79e0f..1d6d7193a5 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ability_impl_active_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ability_impl_active_test.cpp @@ -125,7 +125,7 @@ HWTEST_F(AbilityImplActiveTest, AaFwk_AbilityImpl_Active_001, TestSize.Level1) std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mockAbility = std::make_shared(); std::shared_ptr ability = std::static_pointer_cast(mockAbility); std::shared_ptr handler = std::make_shared(nullptr); @@ -165,7 +165,7 @@ HWTEST_F(AbilityImplActiveTest, AaFwk_AbilityImpl_Active_002, TestSize.Level1) std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mockAbility = std::make_shared(); std::shared_ptr ability = std::static_pointer_cast(mockAbility); std::shared_ptr handler = std::make_shared(nullptr); @@ -205,7 +205,7 @@ HWTEST_F(AbilityImplActiveTest, AaFwk_AbilityImpl_Active_003, TestSize.Level1) std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mockAbility = std::make_shared(); std::shared_ptr ability = std::static_pointer_cast(mockAbility); std::shared_ptr handler = std::make_shared(nullptr); @@ -244,7 +244,7 @@ HWTEST_F(AbilityImplActiveTest, AaFwk_AbilityImpl_InActive_001, TestSize.Level1) std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mockAbility = std::make_shared(); std::shared_ptr ability = std::static_pointer_cast(mockAbility); std::shared_ptr handler = std::make_shared(nullptr); @@ -284,7 +284,7 @@ HWTEST_F(AbilityImplActiveTest, AaFwk_AbilityImpl_InActive_002, TestSize.Level1) std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mockAbility = std::make_shared(); std::shared_ptr ability = std::static_pointer_cast(mockAbility); std::shared_ptr handler = std::make_shared(nullptr); @@ -324,7 +324,7 @@ HWTEST_F(AbilityImplActiveTest, AaFwk_AbilityImpl_InActive_003, TestSize.Level1) std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mockAbility = std::make_shared(); std::shared_ptr ability = std::static_pointer_cast(mockAbility); std::shared_ptr handler = std::make_shared(nullptr); diff --git a/test/unittest/frameworks_kits_ability_native_test/ability_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ability_impl_test.cpp index 477c0032f3..2e532dd6c6 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ability_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ability_impl_test.cpp @@ -87,7 +87,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_ScheduleUpdateConfiguration_001, Tes sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr pMocKPageAbility = std::make_shared(); @@ -135,7 +135,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_ScheduleUpdateConfiguration_002, Tes sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr pMocKPageAbility = std::make_shared(); @@ -192,7 +192,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_ScheduleUpdateConfiguration_003, Tes sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr pMocKPageAbility = std::make_shared(); @@ -254,7 +254,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Init_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -285,7 +285,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Start_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -324,7 +324,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Stop_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -362,7 +362,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Active_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -403,7 +403,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Inactive_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -444,7 +444,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Foreground_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -480,7 +480,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Background_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -523,7 +523,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Foreground_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -567,7 +567,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Foreground_002, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -611,7 +611,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Background_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -654,7 +654,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Background_002, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -699,7 +699,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Foreground_Background_001, TestS sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -744,7 +744,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Foreground_Background_002, TestS sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -790,7 +790,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Foreground_Background_003, TestS sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -835,7 +835,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_New_Foreground_Background_004, TestS sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -879,7 +879,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_DispatchSaveAbilityState_001, TestSi sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -907,7 +907,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_DispatchSaveAbilityState_002, TestSi sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -935,7 +935,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_DispatchRestoreAbilityState_001, Tes sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -966,7 +966,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_DispatchRestoreAbilityState_002, Tes sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -996,7 +996,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_ConnectAbility_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1034,7 +1034,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_CommandAbility_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1142,7 +1142,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_SendResult_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1182,7 +1182,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_NewWant_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1220,7 +1220,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_GetFileTypes_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1260,7 +1260,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_OpenFile_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1298,7 +1298,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Insert_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1337,7 +1337,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Update_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1377,7 +1377,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Delete_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1416,7 +1416,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Query_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1457,7 +1457,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_CheckAndSave_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1493,7 +1493,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_CheckAndRestore_001, TestSize.Level1 sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1522,7 +1522,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Init_0200, TestSize.Level1) std::shared_ptr application; std::shared_ptr abilityInfo = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKPageAbility = std::make_shared(); std::shared_ptr ability = pMocKPageAbility; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); @@ -1563,7 +1563,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Init_0400, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr ability; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -1583,7 +1583,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Init_0500, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKPageAbility = std::make_shared(); std::shared_ptr ability = pMocKPageAbility; std::shared_ptr handler; @@ -1603,7 +1603,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Init_0600, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = nullptr; std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKPageAbility = std::make_shared(); std::shared_ptr ability = pMocKPageAbility; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); @@ -1624,7 +1624,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Init_0700, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKPageAbility = std::make_shared(); std::shared_ptr ability = pMocKPageAbility; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); @@ -1651,7 +1651,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Start_0200, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1689,7 +1689,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Start_0300, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; @@ -1888,7 +1888,7 @@ HWTEST_F(AbilityImplTest, AaFwk_AbilityImpl_Stop_0800, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability; diff --git a/test/unittest/frameworks_kits_ability_native_test/ability_local_record_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ability_local_record_test.cpp index f084059a0a..507b8dde0a 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ability_local_record_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ability_local_record_test.cpp @@ -51,36 +51,6 @@ void AbilityLocalRecordTest::SetUp() void AbilityLocalRecordTest::TearDown() {} -/** - * @tc.number: GetEventHandler_0100 - * @tc.name: GetEventHandler - * @tc.desc: GetEventHandler Test, return is not nullptr. - */ -HWTEST_F(AbilityLocalRecordTest, GetEventHandler_0100, TestSize.Level0) -{ - GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetEventHandler_0100 start"; - auto record = std::make_shared(nullptr, nullptr); - auto handler = std::make_shared(EventRunner::Create()); - record->SetEventHandler(handler); - EXPECT_TRUE(record->GetEventHandler() != nullptr); - GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetEventHandler_0100 end"; -} - -/** - * @tc.number: GetEventRunner_0100 - * @tc.name: GetEventRunner - * @tc.desc: GetEventRunner Test, return is not nullptr. - */ -HWTEST_F(AbilityLocalRecordTest, GetEventRunner_0100, TestSize.Level0) -{ - GTEST_LOG_(INFO) << "AbilityLocalRecordTest SetEventHandler_0100 start"; - auto record = std::make_shared(nullptr, nullptr); - std::shared_ptr runner = EventRunner::GetMainEventRunner(); - record->SetEventRunner(runner); - EXPECT_TRUE(record->GetEventRunner() != nullptr); - GTEST_LOG_(INFO) << "AbilityLocalRecordTest SetEventHandler_0100 end"; -} - /** * @tc.number: GetAbilityThread_0100 * @tc.name: GetAbilityThread @@ -89,7 +59,7 @@ HWTEST_F(AbilityLocalRecordTest, GetEventRunner_0100, TestSize.Level0) HWTEST_F(AbilityLocalRecordTest, GetAbilityThread_0100, TestSize.Level0) { GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetAbilityThread_0100 start"; - auto record = std::make_shared(nullptr, nullptr); + auto record = std::make_shared(nullptr, nullptr, nullptr, 0); auto abilityThread = sptr(nullptr); record->SetAbilityThread(abilityThread); EXPECT_TRUE(record->GetAbilityThread() == nullptr); @@ -104,9 +74,8 @@ HWTEST_F(AbilityLocalRecordTest, GetAbilityThread_0100, TestSize.Level0) HWTEST_F(AbilityLocalRecordTest, GetWant_0100, TestSize.Level0) { GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetWant_0100 start"; - auto record = std::make_shared(nullptr, nullptr); std::shared_ptr want; - record->SetWant(want); + auto record = std::make_shared(nullptr, nullptr, want, 0); EXPECT_TRUE(record->GetWant() == nullptr); GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetWant_0100 end"; } @@ -121,7 +90,7 @@ HWTEST_F(AbilityLocalRecordTest, GetAbilityInfo_0100, TestSize.Level0) GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetAbilityInfo_0100 start"; auto info = std::make_shared(); sptr token = new (std::nothrow) MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); EXPECT_TRUE(record->GetAbilityInfo() != nullptr); GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetAbilityInfo_0100 end"; } @@ -136,7 +105,7 @@ HWTEST_F(AbilityLocalRecordTest, GetToken_0100, TestSize.Level0) GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetToken_0100 start"; auto info = std::make_shared(); sptr token = new (std::nothrow) MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); EXPECT_TRUE(record->GetToken() != nullptr); GTEST_LOG_(INFO) << "AbilityLocalRecordTest GetToken_0100 end"; } \ No newline at end of file diff --git a/test/unittest/frameworks_kits_ability_native_test/ability_thread_dataability_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ability_thread_dataability_test.cpp index 5693796af4..c6dd3d939b 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ability_thread_dataability_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ability_thread_dataability_test.cpp @@ -94,8 +94,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Query_0100, Function | MediumTes EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); std::shared_ptr mockdataability = std::make_shared(); @@ -159,8 +158,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_GetFileTypes_0100, Function | Me EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); std::shared_ptr mockdataability = std::make_shared(); @@ -223,8 +221,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_OpenFile_0100, Function | Medium EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); std::shared_ptr mockdataability = std::make_shared(); @@ -283,8 +280,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Insert_0100, Function | MediumTe EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); std::shared_ptr mockdataability = std::make_shared(); @@ -339,8 +335,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Update_0100, Function | MediumTe EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); std::shared_ptr mockdataability = std::make_shared(); diff --git a/test/unittest/frameworks_kits_ability_native_test/ability_thread_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ability_thread_test.cpp index f798388c79..8217ba8a76 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ability_thread_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ability_thread_test.cpp @@ -88,7 +88,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_DumpAbilityInfo_0100, Function | abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -127,8 +127,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleSaveAbilityState_0100, F EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -176,8 +175,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleRestoreAbilityState_0100 EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); PacMap state; @@ -225,8 +223,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Attach_3_Param_0100, Function | EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); sleep(1); @@ -253,8 +250,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Attach_3_Param_0200, Function | EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -282,8 +278,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Attach_2_Param_0100, Function | EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); abilitythread->Attach(application, abilityRecord, nullptr); sleep(1); @@ -310,8 +305,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_Attach_2_Param_0200, Function | EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, nullptr); @@ -341,8 +335,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleAbilityTransaction_0100, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -374,8 +367,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleAbilityTransaction_0200, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); abilitythread->Attach(application, abilityRecord, nullptr); Want want; @@ -405,8 +397,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleConnectAbility_0100, Fun EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -436,8 +427,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleConnectAbility_0200, Fun abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -466,8 +456,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleDisconnectAbility_0100, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -497,8 +486,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleDisconnectAbility_0200, abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -528,8 +516,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleCommandAbility_0100, Fun EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -562,8 +549,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleCommandAbility_0200, Fun abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -594,8 +580,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_ScheduleCommandAbilityWindow_010 EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -628,8 +613,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_SendResult_0100, Function | Medi EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr abilityimpl = std::make_shared(); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -662,8 +646,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_SendResult_0200, Function | Medi abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -693,8 +676,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AbilityThreadMain_0100, Function EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->AbilityThreadMain(application, abilityRecord, mainRunner, nullptr); @@ -721,8 +703,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AbilityThreadMain_0200, Function EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->AbilityThreadMain(application, abilityRecord, mainRunner, nullptr); @@ -749,8 +730,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AbilityThreadMain_0300, Function EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->AbilityThreadMain(application, abilityRecord, nullptr); @@ -777,8 +757,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AbilityThreadMain_0400, Function EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->AbilityThreadMain(application, abilityRecord, nullptr); @@ -804,7 +783,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AttachExtension_0100, Function | abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); @@ -833,7 +812,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AttachExtension_0200, Function | abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, application); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); @@ -858,7 +837,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_AttachExtension_0201, Function | abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, nullptr); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); @@ -1287,7 +1266,7 @@ HWTEST_F(AbilityThreadTest, AaFwk_AbilityThread_SendResult_0300, Function | Medi abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); auto application = std::make_shared(); - auto abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); diff --git a/test/unittest/frameworks_kits_ability_native_test/action_extension_test.cpp b/test/unittest/frameworks_kits_ability_native_test/action_extension_test.cpp index 9367b3f31c..772994e0c2 100644 --- a/test/unittest/frameworks_kits_ability_native_test/action_extension_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/action_extension_test.cpp @@ -84,7 +84,7 @@ HWTEST_F(ActionExtensionTest, Action_Extension_0300, Function | MediumTest | Lev GTEST_LOG_(INFO) << "Action_Extension_0300 start"; auto abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto application = std::make_shared(); auto contextImpl = std::make_shared(); auto applicationContext = ApplicationContext::GetInstance(); diff --git a/test/unittest/frameworks_kits_ability_native_test/auto_fill_extension_test.cpp b/test/unittest/frameworks_kits_ability_native_test/auto_fill_extension_test.cpp index c0ea4c7bfe..3130dfc9f8 100644 --- a/test/unittest/frameworks_kits_ability_native_test/auto_fill_extension_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/auto_fill_extension_test.cpp @@ -98,7 +98,7 @@ HWTEST_F(AutoFillExtensionTest, Init_0100, Function | MediumTest | Level1) auto abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); EXPECT_NE(token, nullptr); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); EXPECT_NE(record, nullptr); auto application = std::make_shared(); EXPECT_NE(application, nullptr); @@ -108,7 +108,7 @@ HWTEST_F(AutoFillExtensionTest, Init_0100, Function | MediumTest | Level1) application->SetApplicationContext(applicationContext); auto handler = std::make_shared(nullptr); EXPECT_NE(handler, nullptr); - + autoFillExtension->Init(record, application, handler, token); EXPECT_TRUE(autoFillExtension->context_ != nullptr); GTEST_LOG_(INFO) << "Init_0100 end"; @@ -135,7 +135,7 @@ HWTEST_F(AutoFillExtensionTest, CreateAndInitContext_0100, Function | MediumTest abilityInfo->bundleName = BUNDLE_NAME; sptr token = new AppExecFwk::MockAbilityToken(); EXPECT_NE(token, nullptr); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); EXPECT_NE(record, nullptr); auto application = std::make_shared(); EXPECT_NE(application, nullptr); @@ -145,7 +145,7 @@ HWTEST_F(AutoFillExtensionTest, CreateAndInitContext_0100, Function | MediumTest application->SetApplicationContext(applicationContext); auto handler = std::make_shared(nullptr); EXPECT_NE(handler, nullptr); - + auto context = autoFillExtension->CreateAndInitContext(record, application, handler, token); EXPECT_NE(context, nullptr); @@ -157,7 +157,7 @@ HWTEST_F(AutoFillExtensionTest, CreateAndInitContext_0100, Function | MediumTest auto resourceManager = appContext->GetResourceManager(); EXPECT_EQ(context->GetResourceManager(), resourceManager); EXPECT_EQ(context->parentContext_, appContext); - + EXPECT_EQ(context->GetAbilityInfo(), abilityInfo); EXPECT_EQ(context->GetConfiguration(), appContext->GetConfiguration()); @@ -193,7 +193,7 @@ HWTEST_F(AutoFillExtensionTest, CreateAndInitContext_0200, Function | MediumTest auto handler = std::make_shared(nullptr); EXPECT_NE(handler, nullptr); std::shared_ptr record = nullptr; - + auto context = autoFillExtension->CreateAndInitContext(record, application, handler, token); EXPECT_NE(context, nullptr); @@ -205,7 +205,7 @@ HWTEST_F(AutoFillExtensionTest, CreateAndInitContext_0200, Function | MediumTest auto resourceManager = appContext->GetResourceManager(); EXPECT_EQ(context->GetResourceManager(), resourceManager); EXPECT_EQ(context->parentContext_, appContext); - + EXPECT_EQ(context->GetAbilityInfo(), nullptr); EXPECT_EQ(context->GetConfiguration(), nullptr); diff --git a/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_secondpart_test.cpp b/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_secondpart_test.cpp index d2973c6ccf..06cd67ccfa 100644 --- a/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_secondpart_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_secondpart_test.cpp @@ -69,7 +69,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_BatchInsert_001, Functio abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr handler = std::make_shared(nullptr); std::shared_ptr ability = std::make_shared(); dataabilityimpl->Init(application, record, ability, handler, token); @@ -117,7 +117,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_HandleAbilityTransaction abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr handler = std::make_shared(nullptr); std::shared_ptr ability = std::make_shared(); dataabilityimpl->Init(application, record, ability, handler, token); @@ -144,7 +144,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_HandleAbilityTransaction abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr handler = std::make_shared(nullptr); std::shared_ptr ability = std::make_shared(); dataabilityimpl->Init(application, record, ability, handler, token); diff --git a/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_test.cpp b/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_test.cpp index 33fa440111..e29bf550c4 100644 --- a/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_file_test.cpp @@ -69,7 +69,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetType_001, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -97,7 +97,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetType_002, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = nullptr; @@ -123,7 +123,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetFileTypes_001, Functi abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -178,7 +178,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_OpenFile_001, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -229,7 +229,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_OpenRawFile_001, Functio abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -280,7 +280,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Reload_001, Function | M abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); diff --git a/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_test.cpp index f1e1d4bebf..4a87cc7f2c 100644 --- a/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/data_ability_impl_test.cpp @@ -77,7 +77,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Insert_0100, Function | abilityInfo->type = AbilityType::DATA; abilityInfo->isNativeAbility = true; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -129,7 +129,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Insert_0300, Function | abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -163,7 +163,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Update_0100, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -214,7 +214,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Update_0300, Function | abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -247,7 +247,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Delete_0100, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -297,7 +297,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Delete_0300, Function | abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -330,7 +330,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Query_0100, Function | M abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -383,7 +383,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Query_0300, Function | M abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -418,7 +418,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_OpenFile_0100, Function abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -466,7 +466,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_OpenFile_0300, Function abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -497,7 +497,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_OpenRawFile_0100, Functi abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -545,7 +545,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_OpenRawFile_0300, Functi abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -576,7 +576,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Call_0100, Function | Me abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -627,7 +627,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetFileTypes_0100, Funct abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -677,7 +677,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetType_0100, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -722,7 +722,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_Reload_0100, Function | abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -767,7 +767,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_BatchInsert_0100, Functi abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -816,7 +816,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_BatchInsert_0300, Functi abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -848,7 +848,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_NormalizeUri_0100, Funct abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -895,7 +895,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_NormalizeUri_0300, Funct abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -926,7 +926,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_DenormalizeUri_0100, Fun abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -973,7 +973,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_DenormalizeUri_0300, Fun abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1006,7 +1006,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetPermissionInfo_0100, abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1039,7 +1039,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetPermissionInfo_0200, abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1072,7 +1072,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetPermissionInfo_0300, abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1105,7 +1105,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetPermissionInfo_0400, abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1135,7 +1135,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_GetPermissionInfo_0500, abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1166,7 +1166,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1202,7 +1202,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1235,7 +1235,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1268,7 +1268,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1304,7 +1304,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1339,7 +1339,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_CheckOpenFilePermission_ abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1374,7 +1374,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_CheckOpenFilePermission_ abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1409,7 +1409,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_CheckOpenFilePermission_ abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1444,7 +1444,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_CheckOpenFilePermission_ abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1479,7 +1479,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_CheckOpenFilePermission_ abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1512,7 +1512,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_ExecuteBatch_0100, Funct abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1559,7 +1559,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_ExecuteBatch_0300, Funct abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1594,7 +1594,7 @@ HWTEST_F(DataAbilityImplTest, AaFwk_DataAbilityImplTest_ExecuteBatch_0400, Funct abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1625,7 +1625,7 @@ HWTEST_F( abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1653,7 +1653,7 @@ HWTEST_F( abilityInfo->name = "MockDataAbility"; abilityInfo->type = AbilityType::DATA; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1685,7 +1685,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1721,7 +1721,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1757,7 +1757,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1793,7 +1793,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); @@ -1829,7 +1829,7 @@ HWTEST_F( abilityInfo->readPermission = "r"; abilityInfo->writePermission = "w"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr ability = std::make_shared(); diff --git a/test/unittest/frameworks_kits_ability_native_test/embedded_ui_extension_test.cpp b/test/unittest/frameworks_kits_ability_native_test/embedded_ui_extension_test.cpp index bdaf6854e8..23c1e5763d 100644 --- a/test/unittest/frameworks_kits_ability_native_test/embedded_ui_extension_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/embedded_ui_extension_test.cpp @@ -84,7 +84,7 @@ HWTEST_F(EmbeddedUIExtensionTest, EmbeddedUI_Extension_0300, Function | MediumTe GTEST_LOG_(INFO) << "EmbeddedUI_Extension_0300 start"; auto abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto application = std::make_shared(); auto contextImpl = std::make_shared(); auto applicationContext = ApplicationContext::GetInstance(); diff --git a/test/unittest/frameworks_kits_ability_native_test/extension_ability_thread_test.cpp b/test/unittest/frameworks_kits_ability_native_test/extension_ability_thread_test.cpp index 414f6ce837..b7fd594f31 100644 --- a/test/unittest/frameworks_kits_ability_native_test/extension_ability_thread_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/extension_ability_thread_test.cpp @@ -68,7 +68,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_DumpAbilityInfo_0100 abilityInfo->type = AbilityType::EXTENSION; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); std::vector params; @@ -144,8 +144,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_Attach_3_Param_0100, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); sleep(1); @@ -173,8 +172,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_Attach_3_Param_0200, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); sleep(1); @@ -202,8 +200,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_Attach_2_Param_0100, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); extensionabilitythread->Attach(application, abilityRecord, nullptr); sleep(1); } @@ -230,8 +227,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_Attach_2_Param_0200, EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, nullptr); sleep(1); @@ -260,8 +256,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleAbilityTrans EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -293,8 +288,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleAbilityTrans EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); extensionabilitythread->Attach(application, abilityRecord, nullptr); Want want; LifeCycleStateInfo lifeCycleStateInfo; @@ -367,8 +361,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleConnectAbili EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -397,7 +390,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleConnectAbili abilityInfo->type = AbilityType::EXTENSION; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -426,8 +419,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleDisconnectAb EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -456,7 +448,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleDisconnectAb abilityInfo->type = AbilityType::EXTENSION; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -486,8 +478,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleCommandAbili EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -518,7 +509,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleCommandAbili abilityInfo->type = AbilityType::EXTENSION; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -549,8 +540,7 @@ HWTEST_F(ExtensionAbilityThreadTest, ExtensionAbilityThread_ScheduleCommandAbili EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); extensionabilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -1007,7 +997,7 @@ HWTEST_F( abilityInfo->name = "ExtensionAbility"; abilityInfo->type = AbilityType::EXTENSION; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); std::string abilityName = extensionabilitythread->CreateAbilityName(abilityRecord, application); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); diff --git a/test/unittest/frameworks_kits_ability_native_test/extension_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/extension_impl_test.cpp index 7ed127f350..0b57816a31 100644 --- a/test/unittest/frameworks_kits_ability_native_test/extension_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/extension_impl_test.cpp @@ -111,7 +111,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_0300, Function | MediumTest | Le std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); std::shared_ptr extension; std::shared_ptr handler; @@ -199,7 +199,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_0700, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -222,7 +222,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_0800, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -279,7 +279,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_1100, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -304,7 +304,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_1200, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -360,7 +360,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_1500, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -386,7 +386,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_1600, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -439,7 +439,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_1900, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -496,7 +496,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_2200, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -523,7 +523,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_2300, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -560,7 +560,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_2600, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -591,7 +591,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_2700, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -618,7 +618,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_2800, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -645,7 +645,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_2900, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -670,7 +670,7 @@ HWTEST_F(ExtensionImplTest, AaFwk_ExtensionImpl_3000, Function | MediumTest | Le auto application = std::make_shared(); std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto extension = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); diff --git a/test/unittest/frameworks_kits_ability_native_test/extension_second_test.cpp b/test/unittest/frameworks_kits_ability_native_test/extension_second_test.cpp index 24db446fab..8620d25a21 100644 --- a/test/unittest/frameworks_kits_ability_native_test/extension_second_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/extension_second_test.cpp @@ -54,7 +54,7 @@ void ExtensionTest::SetUp(void) { std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto application = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); diff --git a/test/unittest/frameworks_kits_ability_native_test/extension_test.cpp b/test/unittest/frameworks_kits_ability_native_test/extension_test.cpp index ef0d14c801..70b33d0229 100644 --- a/test/unittest/frameworks_kits_ability_native_test/extension_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/extension_test.cpp @@ -54,7 +54,7 @@ void ExtensionTest::SetUp(void) { std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto application = std::make_shared(); std::shared_ptr runner; auto handler = std::make_shared(runner); @@ -97,7 +97,7 @@ HWTEST_F(ExtensionTest, AaFwk_Extension_0200, Function | MediumTest | Level1) OHOS::AppExecFwk::AbilityInfo abilityInfo; std::shared_ptr info = std::make_shared(); sptr token = nullptr; - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); std::shared_ptr application; std::shared_ptr handler; @@ -162,7 +162,7 @@ HWTEST_F(ExtensionTest, AaFwk_Extension_0500, Function | MediumTest | Level1) GTEST_LOG_(INFO) << "AaFwk_Extension_0500 start"; std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); auto application = std::make_shared(); diff --git a/test/unittest/frameworks_kits_ability_native_test/fa_ability_thread_test.cpp b/test/unittest/frameworks_kits_ability_native_test/fa_ability_thread_test.cpp index 7a75a8b023..6199eaf37b 100644 --- a/test/unittest/frameworks_kits_ability_native_test/fa_ability_thread_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/fa_ability_thread_test.cpp @@ -231,7 +231,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_CreateAbilityName_0100, Functi abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, nullptr); EXPECT_EQ(abilityName, ""); @@ -271,7 +271,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_CreateExtensionAbilityName_010 std::string abilityName = "MockPageAbility"; abilitythread->CreateExtensionAbilityName(application, abilityInfo, abilityName); sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string ret = abilitythread->CreateAbilityName(abilityRecord, application); EXPECT_EQ(abilityName, "MockPageAbility"); GTEST_LOG_(INFO) << "AaFwk_AbilityThread_CreateExtensionAbilityName_0101 end"; @@ -295,7 +295,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_CreateExtensionAbilityName_020 std::string abilityName = ""; abilitythread->CreateExtensionAbilityName(application, abilityInfo, abilityName); sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string ret = abilitythread->CreateAbilityName(abilityRecord, application); EXPECT_EQ(abilityName, "ServiceExtension"); GTEST_LOG_(INFO) << "AaFwk_AbilityThread_CreateExtensionAbilityName_0200 end"; @@ -316,7 +316,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_AttachExtension_0300, Function abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); @@ -370,7 +370,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_AttachExtension_0500, Function abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, application); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); @@ -398,7 +398,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_CreateAndInitContextDeal_0500, abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, application); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); @@ -424,7 +424,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_CreateAndInitContextDeal_0600, abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr abilityObject = std::make_shared(); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, nullptr); @@ -453,7 +453,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_InitExtensionFlag_0200, Functi abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, application); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); @@ -485,7 +485,7 @@ HWTEST_F(FaAbilityThreadTest, AaFwk_AbilityThread_InitExtensionFlag_0300, Functi abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::string abilityName = abilitythread->CreateAbilityName(abilityRecord, application); auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); diff --git a/test/unittest/frameworks_kits_ability_native_test/form_extension_test.cpp b/test/unittest/frameworks_kits_ability_native_test/form_extension_test.cpp index 31c4b67e9c..660022660d 100644 --- a/test/unittest/frameworks_kits_ability_native_test/form_extension_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/form_extension_test.cpp @@ -94,7 +94,7 @@ HWTEST_F(FormExtensionTest, AaFwk_Form_Extension_0300, Function | MediumTest | L GTEST_LOG_(INFO) << "AaFwk_Form_Extension_0300 start"; std::shared_ptr abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr contextImpl = std::make_shared(); @@ -141,7 +141,7 @@ HWTEST_F(FormExtensionTest, AaFwk_Form_Extension_0500, Function | MediumTest | L GTEST_LOG_(INFO) << "AaFwk_Form_Extension_0500 start"; std::shared_ptr info = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(info, token); + auto record = std::make_shared(info, token, nullptr, 0); std::shared_ptr application; std::shared_ptr handler; AbilityRuntime::Runtime::Options options; diff --git a/test/unittest/frameworks_kits_ability_native_test/new_ability_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/new_ability_impl_test.cpp index 4ba8752d79..97e5ac539e 100644 --- a/test/unittest/frameworks_kits_ability_native_test/new_ability_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/new_ability_impl_test.cpp @@ -79,7 +79,7 @@ HWTEST_F(NewAbilityImplTest, AaFwk_NewAbilityImpl_HandleAbilityTransaction_0100, std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "newAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -136,7 +136,7 @@ HWTEST_F(NewAbilityImplTest, AaFwk_NewAbilityImpl_HandleAbilityTransaction_0300, std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "newAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); diff --git a/test/unittest/frameworks_kits_ability_native_test/page_ability_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/page_ability_impl_test.cpp index d9b15a7c79..ca42188510 100644 --- a/test/unittest/frameworks_kits_ability_native_test/page_ability_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/page_ability_impl_test.cpp @@ -73,7 +73,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DoKeyDown_0100, Function | M std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -106,7 +106,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DoKeyDown_0200, Function | M std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -138,7 +138,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DoKeyUp_0100, Function | Med std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -171,7 +171,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DoKeyUp_0200, Function | Med std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -204,7 +204,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DoTouchEvent_0100, Function std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -237,7 +237,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DoTouchEvent_0200, Function std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -269,7 +269,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_010 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -303,7 +303,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_020 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -333,7 +333,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_030 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -363,7 +363,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_040 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -393,7 +393,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_050 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -425,7 +425,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_060 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -458,7 +458,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_070 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -493,7 +493,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_080 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -527,7 +527,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_090 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -563,7 +563,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DispatchSaveAbilityState_010 std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -590,7 +590,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_DispatchRestoreAbilityState_ std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -618,7 +618,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_SendResult_0100, Function | std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -648,7 +648,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_NewWant_0100, Function | Med std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -674,7 +674,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_100 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); @@ -705,7 +705,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_110 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); @@ -736,7 +736,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_120 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); @@ -767,7 +767,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_130 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); @@ -798,7 +798,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_140 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); @@ -829,7 +829,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_150 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); @@ -861,7 +861,7 @@ HWTEST_F(PageAbilityImplTest, AaFwk_PageAbilityImpl_HandleAbilityTransaction_160 auto abilityInfo = std::make_shared(); abilityInfo->name = "pageAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto eventRunner = EventRunner::Create(abilityInfo->name); auto handler = std::make_shared(eventRunner); diff --git a/test/unittest/frameworks_kits_ability_native_test/service_ability_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/service_ability_impl_test.cpp index e2d3be03be..754ce81650 100644 --- a/test/unittest/frameworks_kits_ability_native_test/service_ability_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/service_ability_impl_test.cpp @@ -72,7 +72,7 @@ HWTEST_F(ServiceAbilityImplTest, AaFwk_ServiceAbilityImpl_HandleAbilityTransacti std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "MockServiceAbility"; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); sptr abilityThread = @@ -113,7 +113,7 @@ HWTEST_F(ServiceAbilityImplTest, AaFwk_ServiceAbilityImpl_HandleAbilityTransacti abilityInfo->name = "MockServiceAbility"; abilityInfo->type = AppExecFwk::AbilityType::SERVICE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); sptr abilityThread = @@ -150,7 +150,7 @@ HWTEST_F(ServiceAbilityImplTest, AaFwk_ServiceAbilityImpl_HandleAbilityTransacti std::shared_ptr abilityInfo = std::make_shared(); abilityInfo->name = "MockServiceAbility"; sptr token = nullptr; - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -186,7 +186,7 @@ HWTEST_F(ServiceAbilityImplTest, AaFwk_ServiceAbilityImpl_HandleAbilityTransacti abilityInfo->name = "MockServiceAbility"; abilityInfo->type = AppExecFwk::AbilityType::SERVICE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); diff --git a/test/unittest/frameworks_kits_ability_native_test/share_extension_module_loader_test.cpp b/test/unittest/frameworks_kits_ability_native_test/share_extension_module_loader_test.cpp index 5347bf1668..b899969a58 100644 --- a/test/unittest/frameworks_kits_ability_native_test/share_extension_module_loader_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/share_extension_module_loader_test.cpp @@ -84,7 +84,7 @@ HWTEST_F(ShareExtensionTest, Share_Extension_0300, Function | MediumTest | Level GTEST_LOG_(INFO) << "Share_Extension_0300 start"; auto abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto application = std::make_shared(); auto contextImpl = std::make_shared(); auto applicationContext = ApplicationContext::GetInstance(); diff --git a/test/unittest/frameworks_kits_ability_native_test/share_extension_test.cpp b/test/unittest/frameworks_kits_ability_native_test/share_extension_test.cpp index 24d65287b1..b681e822fd 100644 --- a/test/unittest/frameworks_kits_ability_native_test/share_extension_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/share_extension_test.cpp @@ -84,7 +84,7 @@ HWTEST_F(ShareExtensionTest, Share_Extension_0300, Function | MediumTest | Level GTEST_LOG_(INFO) << "Share_Extension_0300 start"; auto abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto application = std::make_shared(); auto contextImpl = std::make_shared(); auto applicationContext = ApplicationContext::GetInstance(); diff --git a/test/unittest/frameworks_kits_ability_native_test/ui_ability_impl_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ui_ability_impl_test.cpp index 2e6267800e..f7cea9c254 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ui_ability_impl_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ui_ability_impl_test.cpp @@ -80,7 +80,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_ScheduleUpdateConfiguration_001, Test sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr pMocKUIAbility = std::make_shared(); @@ -128,7 +128,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_ScheduleUpdateConfiguration_002, Test sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr pMocKUIAbility = std::make_shared(); @@ -184,7 +184,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_ScheduleUpdateConfiguration_003, Test sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr pMocKUIAbility = std::make_shared(); @@ -244,7 +244,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Init_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = std::make_shared(); @@ -274,7 +274,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Start_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; @@ -313,7 +313,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Stop_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; @@ -353,7 +353,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Foreground_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -397,7 +397,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Foreground_002, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -439,7 +439,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Background_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -482,7 +482,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Background_002, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -527,7 +527,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Foreground_Background_001, TestSi sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -572,7 +572,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Foreground_Background_002, TestSi sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -618,7 +618,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Foreground_Background_003, TestSi sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -663,7 +663,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_New_Foreground_Background_004, TestSi sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -707,7 +707,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_DispatchRestoreAbilityState_001, Test sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = std::make_shared(); @@ -737,7 +737,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_DispatchRestoreAbilityState_002, Test sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability = nullptr; @@ -767,7 +767,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_SendResult_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; @@ -806,7 +806,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_NewWant_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; @@ -843,7 +843,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_CheckAndRestore_001, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; @@ -872,7 +872,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Init_0200, TestSize.Level1) std::shared_ptr application; std::shared_ptr abilityInfo = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKUIAbility = std::make_shared(); std::shared_ptr uiability = pMocKUIAbility; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); @@ -913,7 +913,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Init_0400, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr uiability; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); @@ -933,7 +933,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Init_0500, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKUIAbility = std::make_shared(); std::shared_ptr uiability = pMocKUIAbility; std::shared_ptr handler; @@ -953,7 +953,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Init_0600, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = nullptr; std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKUIAbility = std::make_shared(); std::shared_ptr uiability = pMocKUIAbility; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); @@ -974,7 +974,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Init_0700, TestSize.Level1) std::shared_ptr application = std::make_shared(); sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr pMocKUIAbility = std::make_shared(); std::shared_ptr uiability = pMocKUIAbility; std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); @@ -1002,7 +1002,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Start_0300, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; @@ -1201,7 +1201,7 @@ HWTEST_F(UIAbilityImplTest, AbilityRuntime_Stop_0800, TestSize.Level1) sptr token = sptr(new (std::nothrow) MockAbilityToken()); EXPECT_NE(token, nullptr); if (token != nullptr) { - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr eventRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); std::shared_ptr uiability; diff --git a/test/unittest/frameworks_kits_ability_native_test/ui_ability_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ui_ability_test.cpp index 0ab938e2fd..e7af954413 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ui_ability_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ui_ability_test.cpp @@ -72,11 +72,11 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_Name_0100, Function | MediumTest | Le std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); EXPECT_STREQ(abilityInfo->name.c_str(), ability_->GetAbilityName().c_str()); - std::shared_ptr abilityRecord2 = std::make_shared(nullptr, abilityToken); + auto abilityRecord2 = std::make_shared(nullptr, abilityToken, nullptr, 0); ability_->Init(abilityRecord2, application, handler, token); EXPECT_EQ("", ability_->GetAbilityName()); @@ -106,7 +106,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_GetAbilityName_0100, Function | Mediu std::string name = "LOL"; abilityInfo->name = name; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); EXPECT_STREQ(ability_->GetAbilityName().c_str(), name.c_str()); GTEST_LOG_(INFO) << "AbilityRuntime_GetAbilityName_0100 end"; @@ -127,12 +127,11 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_GetModuleName_0100, Function | Medium std::string name = "LOL"; abilityInfo->moduleName = name; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(nullptr, abilityToken); + auto abilityRecord = std::make_shared(nullptr, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); EXPECT_EQ(ability_->GetModuleName(), ""); - std::shared_ptr abilityRecord2 = std::make_shared(abilityInfo, - abilityToken); + auto abilityRecord2 = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord2, application, handler, token); EXPECT_STREQ(ability_->GetModuleName().c_str(), name.c_str()); } @@ -151,7 +150,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_GetLifecycle_0100, Function | MediumT std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); std::shared_ptr lifeCycle = ability_->GetLifecycle(); EXPECT_NE(lifeCycle, nullptr); @@ -201,7 +200,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnNewWant_0100, Function | MediumTest std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); Want want; ability_->OnNewWant(want); @@ -222,7 +221,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnRestoreAbilityState_0100, Function std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); PacMap inState; ability_->OnRestoreAbilityState(inState); @@ -243,7 +242,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_GetWindow_001, Function | MediumTest std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); EXPECT_EQ(ability_->GetWindow(), nullptr); GTEST_LOG_(INFO) << "AbilityRuntime_GetWindow_0100 end"; @@ -265,7 +264,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnStart_0100, Function | MediumTest | std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); Want want; ability_->OnStart(want); @@ -318,7 +317,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnStart_0300, TestSize.Level1) auto handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, application, handler, token); Want want; ability->OnStart(want); @@ -364,7 +363,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnStop_0100, Function | MediumTest | std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); ability_->OnStop(); AbilityLifecycleExecutor::LifecycleState state = ability_->GetState(); @@ -442,7 +441,7 @@ HWTEST_F(UIAbilityBaseTest, DestroyInstance_0100, TestSize.Level1) auto handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, application, handler, token); ability->DestroyInstance(); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); @@ -463,7 +462,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnForeground_0100, Function | MediumT std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); Want want; bool prevSilentForground = ability_->CheckIsSilentForeground(); @@ -513,7 +512,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnForeground_0300, Function | MediumT std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); Want want; ability_->OnForeground(want); @@ -540,7 +539,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnBackground_0100, Function | MediumT std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); ability_->OnBackground(); AbilityLifecycleExecutor::LifecycleState state = ability_->GetState(); @@ -564,7 +563,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnBackground_0200, Function | MediumT std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); ability_->OnBackground(); AbilityLifecycleExecutor::LifecycleState state = ability_->GetState(); @@ -590,7 +589,7 @@ HWTEST_F(UIAbilityBaseTest, AaFwk_Ability_OnBackground_0300, Function | MediumTe std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); ability_->OnBackground(); AbilityLifecycleExecutor::LifecycleState state = ability_->GetState(); @@ -627,7 +626,7 @@ HWTEST_F(UIAbilityBaseTest, AbilityRuntime_OnBackground_0400, TestSize.Level1) auto handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, application, handler, token); int32_t displayId = 0; sptr option = new Rosen::WindowOption(); @@ -771,8 +770,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbilityContinuation_0300, TestSize.Level1) auto eventRunner = EventRunner::Create(pageAbilityInfo->name); auto handler = std::make_shared(eventRunner); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = - std::make_shared(pageAbilityInfo, abilityToken); + auto abilityRecord = std::make_shared(pageAbilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, nullptr, handler, nullptr); Want want; bool success = false; @@ -1090,8 +1088,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbilitySetMissionLabel_0100, TestSize.Level1) std::shared_ptr eventRunner = EventRunner::Create(pageAbilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = - std::make_shared(pageAbilityInfo, abilityToken); + auto abilityRecord = std::make_shared(pageAbilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, nullptr, handler, nullptr); ret = ability->SetMissionLabel(label); EXPECT_EQ(ret, -1); @@ -1124,8 +1121,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbilitySetMissionIcon_0100, TestSize.Level1) std::shared_ptr eventRunner = EventRunner::Create(pageAbilityInfo->name); std::shared_ptr handler = std::make_shared(eventRunner); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = - std::make_shared(pageAbilityInfo, abilityToken); + auto abilityRecord = std::make_shared(pageAbilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, nullptr, handler, nullptr); ret = ability->SetMissionIcon(icon); EXPECT_EQ(ret, -1); @@ -1153,8 +1149,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbilityOnChange_0100, TestSize.Level1) auto eventRunner = EventRunner::Create(pageAbilityInfo->name); auto handler = std::make_shared(eventRunner); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = - std::make_shared(pageAbilityInfo, abilityToken); + auto abilityRecord = std::make_shared(pageAbilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, nullptr, handler, nullptr); // application is nullptr @@ -1188,8 +1183,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbilityOnDisplayMove_0100, TestSize.Level1) auto eventRunner = EventRunner::Create(pageAbilityInfo->name); auto handler = std::make_shared(eventRunner); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = - std::make_shared(pageAbilityInfo, abilityToken); + auto abilityRecord = std::make_shared(pageAbilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, nullptr, handler, nullptr); // application is nullptr @@ -1228,8 +1222,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbilityRequestFocus_0100, TestSize.Level1) auto eventRunner = EventRunner::Create(pageAbilityInfo->name); auto handler = std::make_shared(eventRunner); sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = - std::make_shared(pageAbilityInfo, abilityToken); + auto abilityRecord = std::make_shared(pageAbilityInfo, abilityToken, nullptr, 0); ability->Init(abilityRecord, nullptr, handler, nullptr); // window is nullptr @@ -1269,7 +1262,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_OnStop_AsyncCallback_0100, TestSize.Level1 std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); bool isAsyncCallback = false; ability_->OnStop(nullptr, isAsyncCallback); @@ -1298,7 +1291,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_OnConfigurationUpdatedNotify_0100, TestSiz std::shared_ptr handler = nullptr; sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); auto abilityContext = std::make_shared(); ability_->AttachAbilityContext(abilityContext); @@ -1325,7 +1318,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_InitWindow_0100, TestSize.Level1) std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); int32_t displayId = 0; sptr option = new Rosen::WindowOption(); @@ -1366,7 +1359,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_GetWindowOption_0100, TestSize.Level1) std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); CustomizeData custData = CustomizeData("ShowOnLockScreen", "0", ""); std::vector vecCustData; @@ -1396,7 +1389,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_DoOnForeground_0100, TestSize.Level1) std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); Want want; ability_->DoOnForeground(want); @@ -1422,7 +1415,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_DoOnForeground_0200, TestSize.Level1) std::shared_ptr handler = std::make_shared(eventRunner); sptr token = nullptr; sptr abilityToken = sptr(new AbilityRuntime::FAAbilityThread()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, abilityToken); + auto abilityRecord = std::make_shared(abilityInfo, abilityToken, nullptr, 0); ability_->Init(abilityRecord, application, handler, token); Want want; ability_->DoOnForeground(want); @@ -1455,7 +1448,7 @@ HWTEST_F(UIAbilityBaseTest, UIAbility_RegisterAbilityLifecycleObserver_0100, Fun // init UIAbility to make sure lifecycle is created. std::shared_ptr abilityInfo = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, nullptr); + auto abilityRecord = std::make_shared(abilityInfo, nullptr, nullptr, 0); std::shared_ptr handler = std::make_shared(nullptr); ability->Init(abilityRecord, nullptr, handler, nullptr); std::shared_ptr lifeCycle = ability->GetLifecycle(); diff --git a/test/unittest/frameworks_kits_ability_native_test/ui_ability_thread_test.cpp b/test/unittest/frameworks_kits_ability_native_test/ui_ability_thread_test.cpp index d4373d913f..7e11ad8836 100644 --- a/test/unittest/frameworks_kits_ability_native_test/ui_ability_thread_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/ui_ability_thread_test.cpp @@ -74,8 +74,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_DumpAbilityInfo_0100, Function | Me EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); @@ -169,8 +168,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_ScheduleSaveAbilityState_0100, Func EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); abilitythread->ScheduleSaveAbilityState(); @@ -214,8 +212,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_ScheduleRestoreAbilityState_0100, F EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); PacMap state; @@ -260,8 +257,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_Attach_3_Param_0100, Function | Med EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); sleep(1); @@ -288,8 +284,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_Attach_3_Param_0200, Function | Med EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); sleep(1); @@ -316,8 +311,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_Attach_2_Param_0100, Function | Med EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); abilitythread->Attach(application, abilityRecord, nullptr); sleep(1); } @@ -343,8 +337,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_Attach_2_Param_0200, Function | Med EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = nullptr; - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, nullptr); sleep(1); @@ -371,8 +364,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_ScheduleAbilityTransaction_0100, Fu EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); Want want; @@ -402,8 +394,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_ScheduleAbilityTransaction_0200, Fu EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); abilitythread->Attach(application, abilityRecord, nullptr); Want want; LifeCycleStateInfo lifeCycleStateInfo; @@ -491,8 +482,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_SendResult_0100, Function | MediumT EXPECT_NE(token, nullptr); if (token != nullptr) { std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = - std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); std::shared_ptr abilityimpl = std::make_shared(); @@ -523,7 +513,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_SendResult_0200, Function | MediumT abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); std::shared_ptr application = std::make_shared(); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); int requestCode = 0; @@ -549,7 +539,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_SendResult_0300, Function | MediumT abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); auto application = std::make_shared(); - auto abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); abilitythread->abilityImpl_ = std::make_shared(); @@ -937,7 +927,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_CreateAndInitContextDeal_0100, Func abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); auto ret = abilitythread->CreateAndInitContextDeal(application, abilityRecord, nullptr); EXPECT_EQ(ret, nullptr); GTEST_LOG_(INFO) << "AbilityRuntime_CreateAndInitContextDeal_0100 end"; @@ -959,7 +949,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_CreateAndInitContextDeal_0200, Func abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr abilityObject = std::make_shared(); auto ret = abilitythread->CreateAndInitContextDeal(application, abilityRecord, abilityObject); EXPECT_NE(ret, nullptr); @@ -982,7 +972,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_CreateAndInitContextDeal_0300, Func abilityInfo->name = "MockPageAbility"; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr abilityObject = std::make_shared(); auto ret = abilitythread->CreateAndInitContextDeal(nullptr, abilityRecord, abilityObject); EXPECT_EQ(ret, nullptr); @@ -1026,7 +1016,7 @@ HWTEST_F(UIAbilityThreadTest, AbilityRuntime_Attach_0100, Function | MediumTest abilityInfo->name = ""; abilityInfo->type = AbilityType::PAGE; sptr token = sptr(new (std::nothrow) MockAbilityToken()); - std::shared_ptr abilityRecord = std::make_shared(abilityInfo, token); + auto abilityRecord = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr mainRunner = EventRunner::Create(abilityInfo->name); abilitythread->Attach(application, abilityRecord, mainRunner, nullptr); auto ret = abilitythread->CreateAbilityName(abilityRecord); diff --git a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn index dc59a98949..5cfe2335e5 100644 --- a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn @@ -115,6 +115,7 @@ ohos_unittest("application_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -174,6 +175,7 @@ ohos_unittest("context_impl_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:uiabilitykit_native", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", @@ -226,6 +228,7 @@ ohos_unittest("context_container_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -415,6 +418,7 @@ ohos_unittest("context_deal_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -473,6 +477,7 @@ ohos_unittest("application_impl_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_native_path}/appkit:appkit_native", @@ -609,6 +614,7 @@ ohos_unittest("form_extension_context_test") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:configuration_helper", "${ability_runtime_native_path}/ability/native:form_extension", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_manager_helper", diff --git a/test/unittest/frameworks_kits_appkit_native_test/ability_stage_test.cpp b/test/unittest/frameworks_kits_appkit_native_test/ability_stage_test.cpp index 9d2d792083..72e5cc57d4 100644 --- a/test/unittest/frameworks_kits_appkit_native_test/ability_stage_test.cpp +++ b/test/unittest/frameworks_kits_appkit_native_test/ability_stage_test.cpp @@ -143,7 +143,7 @@ HWTEST_F(AbilityStageTest, AppExecFwk_AbilityStage_AddAbility_002, Function | Me GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_AddAbility_002 start"; sptr token = new (std::nothrow) MockToken(); GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_AddAbility_002 111"; - abilityStage_->AddAbility(token, std::make_shared(nullptr, nullptr)); + abilityStage_->AddAbility(token, std::make_shared(nullptr, nullptr, nullptr, 0)); GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_AddAbility_002 222"; EXPECT_TRUE(abilityStage_->ContainsAbility()); GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_AddAbility_002 end"; @@ -160,7 +160,7 @@ HWTEST_F(AbilityStageTest, AppExecFwk_AbilityStage_AddAbility_003, Function | Me { GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_AddAbility_003 start"; EXPECT_FALSE(abilityStage_->ContainsAbility()); - abilityStage_->AddAbility(nullptr, std::make_shared(nullptr, nullptr)); + abilityStage_->AddAbility(nullptr, std::make_shared(nullptr, nullptr, nullptr, 0)); EXPECT_FALSE(abilityStage_->ContainsAbility()); GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_AddAbility_003 end"; } @@ -209,7 +209,7 @@ HWTEST_F(AbilityStageTest, AppExecFwk_AbilityStage_RemoveAbility_002, Function | { GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_RemoveAbility_002 start"; sptr token = new MockToken(); - abilityStage_->AddAbility(token, std::make_shared(nullptr, nullptr)); + abilityStage_->AddAbility(token, std::make_shared(nullptr, nullptr, nullptr, 0)); EXPECT_TRUE(abilityStage_->ContainsAbility()); abilityStage_->RemoveAbility(token); EXPECT_FALSE(abilityStage_->ContainsAbility()); @@ -241,7 +241,7 @@ HWTEST_F(AbilityStageTest, AppExecFwk_AbilityStage_ContainsAbility_002, Function { GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_ContainsAbility_002 start"; sptr token = new MockToken(); - abilityStage_->AddAbility(token, std::make_shared(nullptr, nullptr)); + abilityStage_->AddAbility(token, std::make_shared(nullptr, nullptr, nullptr, 0)); EXPECT_TRUE(abilityStage_->ContainsAbility()); GTEST_LOG_(INFO) << "AppExecFwk_AbilityStage_ContainsAbility_002 end"; } diff --git a/test/unittest/js_auto_fill_extension_test/js_auto_fill_extension_test.cpp b/test/unittest/js_auto_fill_extension_test/js_auto_fill_extension_test.cpp index bdcd82d9da..f9ce763e4f 100644 --- a/test/unittest/js_auto_fill_extension_test/js_auto_fill_extension_test.cpp +++ b/test/unittest/js_auto_fill_extension_test/js_auto_fill_extension_test.cpp @@ -89,7 +89,7 @@ void JsAutoFillExtensionTest::CreateJsAutoFillExtension() { std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr contextImpl = std::make_shared(); diff --git a/test/unittest/js_service_extension_test/js_service_extension_test.cpp b/test/unittest/js_service_extension_test/js_service_extension_test.cpp index 943437a609..b9f02ea8cc 100644 --- a/test/unittest/js_service_extension_test/js_service_extension_test.cpp +++ b/test/unittest/js_service_extension_test/js_service_extension_test.cpp @@ -91,7 +91,7 @@ void JsServiceExtensionTest::CreateJsServiceExtension() { std::shared_ptr abilityInfo = std::make_shared(); sptr token(new (std::nothrow) MockAbilityToken()); - std::shared_ptr record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr contextImpl = std::make_shared(); diff --git a/test/unittest/js_ui_service_extension_test/js_ui_service_extension_test.cpp b/test/unittest/js_ui_service_extension_test/js_ui_service_extension_test.cpp index 4a14933d8e..051393d22f 100644 --- a/test/unittest/js_ui_service_extension_test/js_ui_service_extension_test.cpp +++ b/test/unittest/js_ui_service_extension_test/js_ui_service_extension_test.cpp @@ -104,8 +104,7 @@ void JsUIServiceExtensionTest::SetUp() std::shared_ptr info = std::make_shared(); info->name = "JsUIServiceExtensionTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); diff --git a/test/unittest/photo_editor_extension_test/photo_editor_extension_test.cpp b/test/unittest/photo_editor_extension_test/photo_editor_extension_test.cpp index d4cb80b467..b66ddcd3b2 100644 --- a/test/unittest/photo_editor_extension_test/photo_editor_extension_test.cpp +++ b/test/unittest/photo_editor_extension_test/photo_editor_extension_test.cpp @@ -84,7 +84,7 @@ HWTEST_F(PhotoEditorExtensionTest, PhotoEditor_Extension_0300, Function | Medium GTEST_LOG_(INFO) << "PhotoEditor_Extension_0300 start"; auto abilityInfo = std::make_shared(); sptr token = new AppExecFwk::MockAbilityToken(); - auto record = std::make_shared(abilityInfo, token); + auto record = std::make_shared(abilityInfo, token, nullptr, 0); auto application = std::make_shared(); auto contextImpl = std::make_shared(); auto applicationContext = ApplicationContext::GetInstance(); diff --git a/test/unittest/ui_service_extension_test/ui_service_extension_test.cpp b/test/unittest/ui_service_extension_test/ui_service_extension_test.cpp index 693b051b1b..46ba7157f9 100644 --- a/test/unittest/ui_service_extension_test/ui_service_extension_test.cpp +++ b/test/unittest/ui_service_extension_test/ui_service_extension_test.cpp @@ -97,8 +97,7 @@ HWTEST_F(UIServiceExtensionTest, CreateAndInitContext_0100, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "UIServiceExtensionTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken(); @@ -125,8 +124,7 @@ HWTEST_F(UIServiceExtensionTest, Init_0100, TestSize.Level1) std::shared_ptr info = std::make_shared(); info->name = "UIServiceExtensionTest"; - std::shared_ptr record = - std::make_shared(info, nullptr); + auto record = std::make_shared(info, nullptr, nullptr, 0); std::shared_ptr application = std::make_shared(); std::shared_ptr handler = std::make_shared(nullptr); sptr token = new AppExecFwk::MockAbilityToken();