# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../../../../os_account.gni") import("../../../os_account_service.gni") module_output_path = "os_account/services/app_account" config("app_account_service_config_mock") { include_dirs = [ "${app_account_services_path}/test/mock/app_account", "${app_account_services_path}/test/mock/common", "${app_account_innerkits_native_path}/include", ] } config("app_account_service_config_unittest") { visibility = [ ":*" ] include_dirs = [] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ "ACCOUNT_LOG_TAG = \"AppAccountMTest\"", "LOG_DOMAIN = 0xD001B00", ] } ohos_moduletest("app_account_check_labels_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path sources = [ "app_account_check_labels_module_test.cpp" ] configs = [ ":app_account_service_config_unittest" ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "samgr:samgr_proxy", ] } ohos_moduletest("app_account_authorization_extension_ability_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path include_dirs = [ "${app_account_extension_path}/include", "${os_account_path}/interfaces/innerkits/appaccount/native/include", "${account_napi_common_path}/include", "${app_account_innerkits_native_path}/include", "${app_account_services_path}/include", ] sources = [ "${app_account_services_path}/src/appaccount/app_account_authorization_extension_proxy.cpp", "app_account_authorization_extension_ability_test.cpp", ] configs = [ ":app_account_service_config_unittest" ] deps = [ "${account_napi_common_path}:account_napi_common", "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${common_path}:libaccount_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:ability_context_native", "ability_runtime:ability_manager", "ability_runtime:abilitykit_native", "ability_runtime:app_context", "ability_runtime:runtime", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", "samgr:samgr_proxy", ] } ohos_moduletest("account_permission_manager_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path sources = [ "account_permission_manager_module_test.cpp" ] deps = [ "${common_path}:libaccount_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", ] defines = [ "ACCOUNT_LOG_TAG = \"AppAccountMTest\"", "LOG_DOMAIN = 0xD001B00", ] } ohos_moduletest("app_account_manager_service_associated_data_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] cflags = [] sources = [ "${app_account_services_path}/src/account_data_storage.cpp", "${app_account_services_path}/src/appaccount/app_account_control_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/src/appaccount/app_account_stub.cpp", "${app_account_services_path}/src/appaccount/inner_app_account_manager.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_user_manager_adapter_proxy.cpp", "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "${bundle_framework_path}/common/log/src/app_log_wrapper.cpp", "${innerkits_native_path}/src/account_info_parcel.cpp", "app_account_associated_data_test.cpp", ] sources += ability_base_sources sources += app_account_sources_mock use_exceptions = true configs = [ ":app_account_service_config_unittest", "${app_account_services_path}/test/mock:mock_accountmgr_config", "${app_account_services_path}/test/mock:accountmgr_config", "${app_account_services_path}/test/mock:ability_manager_config", ] include_dirs = [ "${app_account_services_path}/test/mock/common", "${app_account_innerkits_native_path}/include", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${common_path}:libaccount_common", "${os_account_innerkits_native_path}:os_account_innerkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "mbedtls:mbedtls_shared", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] external_deps += [ "ability_runtime:wantagent_innerkits", "access_token:libtokenid_sdk", ] if (has_huks_part) { external_deps += [ "huks:libhukssdk" ] } if (has_storage_service_part) { external_deps += [ "storage_service:storage_manager_sa_proxy" ] } if (build_selinux) { external_deps += [ "selinux_adapter:librestorecon" ] } if (has_ces_part) { external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (has_hiviewdfx_hisysevent_part) { external_deps += [ "hisysevent:libhisysevent" ] } if (hicollie_enable == true) { external_deps += [ "hicollie:libhicollie" ] } if (security_guard_enabled) { external_deps += [ "security_guard:libsg_collect_sdk", "time_service:time_client", ] } if (has_hiviewdfx_hitrace_part) { external_deps += [ "hitrace:hitrace_meter" ] } if (has_user_auth_part) { external_deps += [ "access_token:libtokensetproc_shared", "user_auth_framework:userauth_client", ] } if (has_kv_store_part) { external_deps += [ "kv_store:distributeddata_inner" ] } if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (os_account_distributed_feature) { cflags += [ "-DDISTRIBUTED_FEATURE_ENABLED" ] } } ohos_moduletest("app_account_authenticator_callback_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] sources = [ "app_account_authenticator_callback_test.cpp" ] configs = [ ":app_account_service_config_unittest" ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", ] external_deps = [ "ability_base:want", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } ohos_moduletest("app_account_event_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] sources = [ "app_account_event_module_test.cpp" ] configs = [ ":app_account_service_config_unittest" ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } ohos_moduletest("app_account_authenticate_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] sources = [ "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "app_account_authenticate_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } ohos_moduletest("app_account_control_manager_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] cflags = [] sources = [ "${app_account_services_path}/src/appaccount/app_account_control_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/src/appaccount/app_account_stub.cpp", "${app_account_services_path}/src/appaccount/inner_app_account_manager.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_user_manager_adapter_proxy.cpp", "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/app_account/account_data_storage.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "${bundle_framework_path}/common/log/src/app_log_wrapper.cpp", "${innerkits_native_path}/src/account_info_parcel.cpp", "app_account_control_manager_module_test.cpp", ] sources += ability_base_sources sources += app_account_sources_mock use_exceptions = true configs = [ ":app_account_service_config_unittest", "${app_account_services_path}/test/mock:mock_accountmgr_config", "${app_account_services_path}/test/mock:accountmgr_config", "${app_account_services_path}/test/mock:ability_manager_config", ] include_dirs = [ "${app_account_services_path}/test/mock/common", "${app_account_innerkits_native_path}/include", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${common_path}:libaccount_common", "${os_account_innerkits_native_path}:os_account_innerkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "mbedtls:mbedtls_shared", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] external_deps += [ "ability_runtime:wantagent_innerkits", "access_token:libtokenid_sdk", ] if (has_huks_part) { external_deps += [ "huks:libhukssdk" ] } if (has_storage_service_part) { external_deps += [ "storage_service:storage_manager_sa_proxy" ] } if (build_selinux) { external_deps += [ "selinux_adapter:librestorecon" ] } if (has_ces_part) { external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (has_hiviewdfx_hisysevent_part) { external_deps += [ "hisysevent:libhisysevent" ] } if (hicollie_enable == true) { external_deps += [ "hicollie:libhicollie" ] } if (security_guard_enabled) { external_deps += [ "security_guard:libsg_collect_sdk", "time_service:time_client", ] } if (has_hiviewdfx_hitrace_part) { external_deps += [ "hitrace:hitrace_meter" ] } if (has_user_auth_part) { external_deps += [ "access_token:libtoken_setproc", "user_auth_framework:userauth_client", ] } if (has_kv_store_part) { external_deps += [ "kv_store:distributeddata_inner" ] } if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (os_account_distributed_feature) { cflags += [ "-DDISTRIBUTED_FEATURE_ENABLED" ] } } ohos_moduletest("app_account_authenticator_session_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false blocklist = "${os_account_path}/cfi_blocklist.txt" } module_out_path = module_output_path include_dirs = [ "${app_account_services_path}/test/mock/app_account", "${innerkits_native_path}/include", ] sources = [ "${app_account_services_path}/src/appaccount/app_account_control_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/src/appaccount/app_account_stub.cpp", "${app_account_services_path}/src/appaccount/inner_app_account_manager.cpp", "${app_account_services_path}/test/mock/app_account/app_account_authenticator_manager.cpp", "${app_account_services_path}/test/mock/app_account/mock_app_account_authenticator_stub.cpp", "${app_account_services_path}/test/mock/common/ability_manager_adapter.cpp", "app_account_authenticator_session_module_test.cpp", ] sources += [ "${app_account_innerkits_native_path}/src/app_account_authenticator_callback_proxy.cpp", "${app_account_innerkits_native_path}/src/app_account_authenticator_callback_stub.cpp", "${app_account_innerkits_native_path}/src/app_account_authorization_extension_callback_proxy.cpp", "${app_account_innerkits_native_path}/src/app_account_authorization_extension_callback_service.cpp", "${app_account_innerkits_native_path}/src/app_account_authorization_extension_callback_stub.cpp", "${app_account_innerkits_native_path}/src/app_account_common.cpp", "${app_account_innerkits_native_path}/src/app_account_info.cpp", "${app_account_innerkits_native_path}/src/app_account_subscribe_info.cpp", "${app_account_services_path}/src/appaccount/app_account_app_state_observer.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_callback.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_proxy.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_session.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_session_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_authorization_extension_proxy.cpp", "${app_account_services_path}/src/appaccount/app_account_check_labels_callback.cpp", "${app_account_services_path}/src/appaccount/app_account_check_labels_session.cpp", "${app_account_services_path}/src/appaccount/app_account_common_event_observer.cpp", "${app_account_services_path}/src/appaccount/app_account_common_event_subscriber.cpp", "${app_account_services_path}/src/appaccount/app_account_data_storage.cpp", "${app_account_services_path}/src/appaccount/app_account_event_proxy.cpp", "${app_account_services_path}/src/appaccount/app_account_subscribe_death_recipient.cpp", "${app_account_services_path}/src/appaccount/app_account_subscribe_manager.cpp", ] sources += [ "${app_account_services_path}/src/account_data_storage.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_user_manager_adapter_proxy.cpp", "${bundle_framework_path}/common/log/src/app_log_wrapper.cpp", "${innerkits_native_path}/src/account_info_parcel.cpp", "${services_path}/accountmgr/test/mock/common/bundle_manager_adapter.cpp", ] use_exceptions = true version_script = "${services_path}/accountmgr/libaccountmgr.map" configs = [ ":app_account_service_config_unittest" ] configs += [ "${app_account_services_path}/test/mock:mock_accountmgr_config", "${app_account_services_path}/test/mock:accountmgr_config", "${app_account_services_path}/test/mock:ability_manager_config", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:ability_context_native", "ability_runtime:ability_manager", "ability_runtime:abilitykit_native", "ability_runtime:app_context", "ability_runtime:app_manager", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "napi:ace_napi", "samgr:samgr_proxy", ] external_deps += [ "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "access_token:libtokensetproc_shared", "common_event_service:cesfwk_innerkits", "hicollie:libhicollie", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "selinux_adapter:librestorecon", "storage_service:storage_manager_sa_proxy", "user_auth_framework:userauth_client", ] if (has_huks_part) { external_deps += [ "huks:libhukssdk" ] } if (security_guard_enabled) { external_deps += [ "security_guard:libsg_collect_sdk", "time_service:time_client", ] } } ohos_moduletest("app_account_manager_service_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false blocklist = "${os_account_path}/cfi_blocklist.txt" } module_out_path = module_output_path cflags_cc = [] cflags = [] sources = [ "${app_account_services_path}/src/appaccount/app_account_common_event_observer.cpp", "${app_account_services_path}/src/appaccount/app_account_common_event_subscriber.cpp", "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "${common_path}/utils/src/account_permission_manager.cpp", "app_account_manager_service_module_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (os_account_distributed_feature) { cflags += [ "-DDISTRIBUTED_FEATURE_ENABLED" ] } } ohos_moduletest("app_account_manager_service_not_mock_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] cflags = [] sources = [ "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "app_account_manager_service_module_not_mock_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } ohos_moduletest("at_not_mock_app_account_manager_service_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path sources = [ "${app_account_services_path}/src/account_data_storage.cpp", "${app_account_services_path}/src/appaccount/app_account_control_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/src/appaccount/app_account_stub.cpp", "${app_account_services_path}/src/appaccount/inner_app_account_manager.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_user_manager_adapter_proxy.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "${bundle_framework_path}/common/log/src/app_log_wrapper.cpp", "${innerkits_native_path}/src/account_info_parcel.cpp", "at_not_mock_app_account_manager_service_module_test.cpp", ] sources += ability_base_sources sources += app_account_sources_mock use_exceptions = true configs = [ ":app_account_service_config_unittest" ] configs += [ "${app_account_services_path}/test/mock:mock_accountmgr_config", "${app_account_services_path}/test/mock:accountmgr_config", "${app_account_services_path}/test/mock:ability_manager_config", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "${os_account_innerkits_native_path}:os_account_innerkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:ability_context_native", "ability_runtime:ability_manager", "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "mbedtls:mbedtls_shared", "napi:ace_napi", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] external_deps += [ "ability_runtime:wantagent_innerkits", "access_token:libtokenid_sdk", ] if (has_huks_part) { external_deps += [ "huks:libhukssdk" ] } if (has_storage_service_part) { external_deps += [ "storage_service:storage_manager_sa_proxy" ] } if (build_selinux) { external_deps += [ "selinux_adapter:librestorecon" ] } if (has_ces_part) { external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (has_hiviewdfx_hisysevent_part) { external_deps += [ "hisysevent:libhisysevent" ] } if (hicollie_enable == true) { external_deps += [ "hicollie:libhicollie" ] } if (security_guard_enabled) { external_deps += [ "security_guard:libsg_collect_sdk", "time_service:time_client", ] } if (has_hiviewdfx_hitrace_part) { external_deps += [ "hitrace:hitrace_meter" ] } if (has_user_auth_part) { external_deps += [ "user_auth_framework:userauth_client" ] } if (has_kv_store_part) { external_deps += [ "kv_store:distributeddata_inner" ] } } ohos_moduletest("app_account_manager_service_subscribe_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] sources = [ "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "app_account_manager_service_subscribe_module_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } ohos_moduletest("app_account_manager_service_sync_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] cflags = [] sources = [ "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "${common_path}/utils/src/account_permission_manager.cpp", "app_account_manager_service_sync_module_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } if (os_account_distributed_feature) { cflags += [ "-DDISTRIBUTED_FEATURE_ENABLED" ] } } ohos_moduletest("bundle_manager_adapter_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path include_dirs = [ "${services_path}/accountmgr/include/bundle_manager_adapter" ] sources = [ "${services_path}/accountmgr/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", "bundle_manager_adapter_module_test.cpp", ] configs = [ ":app_account_service_config_unittest" ] deps = [ "${app_account_services_path}:accountmgr", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] } ohos_moduletest("app_account_authenticator_session_manager_module_test") { module_out_path = module_output_path include_dirs = [ "${app_account_services_path}/test/mock/app_account", "${innerkits_native_path}/include", ] sources = [ "${app_account_services_path}/src/appaccount/app_account_control_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_manager_service.cpp", "${app_account_services_path}/src/appaccount/app_account_stub.cpp", "${app_account_services_path}/src/appaccount/inner_app_account_manager.cpp", "${app_account_services_path}/test/mock/app_account/app_account_authenticator_manager.cpp", "${app_account_services_path}/test/mock/app_account/mock_app_account_authenticator_stub.cpp", "${app_account_services_path}/test/mock/common/ability_manager_adapter.cpp", "app_account_authenticator_session_manager_module_test.cpp", ] sources += [ "${app_account_innerkits_native_path}/src/app_account_authenticator_callback_proxy.cpp", "${app_account_innerkits_native_path}/src/app_account_authenticator_callback_stub.cpp", "${app_account_innerkits_native_path}/src/app_account_authorization_extension_callback_proxy.cpp", "${app_account_innerkits_native_path}/src/app_account_authorization_extension_callback_service.cpp", "${app_account_innerkits_native_path}/src/app_account_authorization_extension_callback_stub.cpp", "${app_account_innerkits_native_path}/src/app_account_common.cpp", "${app_account_innerkits_native_path}/src/app_account_info.cpp", "${app_account_innerkits_native_path}/src/app_account_subscribe_info.cpp", "${app_account_services_path}/src/appaccount/app_account_app_state_observer.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_callback.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_proxy.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_session.cpp", "${app_account_services_path}/src/appaccount/app_account_authenticator_session_manager.cpp", "${app_account_services_path}/src/appaccount/app_account_authorization_extension_proxy.cpp", "${app_account_services_path}/src/appaccount/app_account_check_labels_callback.cpp", "${app_account_services_path}/src/appaccount/app_account_check_labels_session.cpp", "${app_account_services_path}/src/appaccount/app_account_common_event_observer.cpp", "${app_account_services_path}/src/appaccount/app_account_common_event_subscriber.cpp", "${app_account_services_path}/src/appaccount/app_account_data_storage.cpp", "${app_account_services_path}/src/appaccount/app_account_event_proxy.cpp", "${app_account_services_path}/src/appaccount/app_account_subscribe_death_recipient.cpp", "${app_account_services_path}/src/appaccount/app_account_subscribe_manager.cpp", ] sources += [ "${app_account_services_path}/src/account_data_storage.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", "${app_account_services_path}/src/bundle_manager_adapter/bundle_user_manager_adapter_proxy.cpp", "${bundle_framework_path}/common/log/src/app_log_wrapper.cpp", "${innerkits_native_path}/src/account_info_parcel.cpp", "${services_path}/accountmgr/test/mock/common/bundle_manager_adapter.cpp", ] use_exceptions = true version_script = "${services_path}/accountmgr/libaccountmgr.map" configs = [ ":app_account_service_config_unittest" ] configs += [ "${app_account_services_path}/test/mock:mock_accountmgr_config", "${app_account_services_path}/test/mock:accountmgr_config", "${app_account_services_path}/test/mock:ability_manager_config", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:ability_context_native", "ability_runtime:ability_manager", "ability_runtime:abilitykit_native", "ability_runtime:app_context", "ability_runtime:app_manager", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "napi:ace_napi", "samgr:samgr_proxy", ] external_deps += [ "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "access_token:libtokensetproc_shared", "common_event_service:cesfwk_innerkits", "hicollie:libhicollie", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "selinux_adapter:librestorecon", "storage_service:storage_manager_sa_proxy", "user_auth_framework:userauth_client", ] if (has_huks_part) { external_deps += [ "huks:libhukssdk" ] } if (security_guard_enabled) { external_deps += [ "security_guard:libsg_collect_sdk", "time_service:time_client", ] } } ohos_moduletest("app_account_manager_service_thread_module_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] sources = [ "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "app_account_manager_service_thread_module_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } ohos_moduletest("app_account_subscribe_manager_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path cflags_cc = [] include_dirs = [ "${app_account_services_path}/include/appaccount" ] sources = [ "${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp", "${app_account_services_path}/test/mock/common/bundle_manager_adapter.cpp", "${services_path}/accountmgr/src/appaccount/app_account_subscribe_death_recipient.cpp", "${services_path}/accountmgr/src/appaccount/app_account_subscribe_manager.cpp", "app_account_subscribe_manager_test.cpp", ] configs = [ ":app_account_service_config_mock", ":app_account_service_config_unittest", ] deps = [ "${app_account_innerkits_native_path}:app_account_innerkits", "${app_account_services_path}:accountmgr", "${app_account_services_path}/src/appaccount:app_account_service_core", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_ces_part) { cflags_cc += [ "-DHAS_CES_PART" ] external_deps += [ "common_event_service:cesfwk_innerkits" ] } } group("moduletest") { testonly = true deps = [ ":app_account_authenticate_test", ":app_account_authenticator_callback_test", ":app_account_authenticator_session_manager_module_test", ":app_account_authenticator_session_module_test", ":app_account_authorization_extension_ability_test", ":app_account_check_labels_module_test", ":app_account_control_manager_module_test", ":app_account_event_module_test", ":app_account_manager_service_associated_data_test", ":app_account_manager_service_module_test", ":app_account_manager_service_not_mock_module_test", ":app_account_manager_service_subscribe_module_test", ":app_account_manager_service_sync_module_test", ":app_account_subscribe_manager_test", ":at_not_mock_app_account_manager_service_module_test", ] }