1# Copyright (c) 2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/test.gni") 15import("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17module_output_path = "ability_runtime/ability_runtime/appmgr" 18 19ohos_unittest("app_mgr_service_second_test") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 blocklist = "../../cfi_blocklist.txt" 25 } 26 branch_protector_ret = "pac_ret" 27 module_out_path = module_output_path 28 29 include_dirs = [ "mock/include" ] 30 31 sources = [ 32 "app_mgr_service_second_test.cpp", 33 "mock/src/mock_ipc_skeleton.cpp", 34 "mock/src/mock_my_flag.cpp", 35 "mock/src/mock_permission_verification.cpp", 36 ] 37 38 configs = [ "${ability_runtime_services_path}/appmgr:appmgr_config" ] 39 40 cflags = [ 41 "-Dprivate=public", 42 "-Dprotected=public", 43 ] 44 45 deps = [ 46 "${ability_runtime_innerkits_path}/runtime:runtime", 47 "${ability_runtime_native_path}/appkit:appkit_native", 48 "${ability_runtime_path}/utils/server/startup:startup_util", 49 "${ability_runtime_services_path}/appmgr:libappms", 50 "${ability_runtime_services_path}/common:app_util", 51 "${ability_runtime_services_path}/common:task_handler_wrap", 52 ] 53 54 external_deps = [ 55 "ability_base:configuration", 56 "ability_base:want", 57 "ability_runtime:app_manager", 58 "access_token:libaccesstoken_sdk", 59 "access_token:libnativetoken", 60 "access_token:libtoken_setproc", 61 "appspawn:appspawn_client", 62 "bundle_framework:appexecfwk_base", 63 "bundle_framework:appexecfwk_core", 64 "cJSON:cjson", 65 "c_utils:utils", 66 "eventhandler:libeventhandler", 67 "ffrt:libffrt", 68 "googletest:gmock_main", 69 "googletest:gtest_main", 70 "hilog:libhilog", 71 "hisysevent:libhisysevent", 72 "hitrace:hitrace_meter", 73 "init:libbeget_proxy", 74 "init:libbegetutil", 75 "ipc:ipc_core", 76 "napi:ace_napi", 77 "safwk:system_ability_fwk", 78 "samgr:samgr_proxy", 79 "selinux_adapter:librestorecon", 80 ] 81 82 defines = [] 83 if (background_task_mgr_continuous_task_enable) { 84 defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 85 } 86 87 if (ability_command_for_test) { 88 defines += [ "ABILITY_COMMAND_FOR_TEST" ] 89 } 90 91 if (ability_runtime_child_process) { 92 defines += [ "SUPPORT_CHILD_PROCESS" ] 93 } 94 95 if (ability_runtime_graphics) { 96 external_deps += [ "window_manager:libwm" ] 97 } 98} 99 100group("unittest") { 101 testonly = true 102 103 deps = [ ":app_mgr_service_second_test" ] 104} 105