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/abilitymgr" 18 19ohos_unittest("ability_manager_service_eleven_test") { 20 use_exceptions = true 21 module_out_path = module_output_path 22 sanitize = { 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 blocklist = "../../cfi_blocklist.txt" 27 } 28 29 branch_protector_ret = "pac_ret" 30 31 include_dirs = [ 32 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/appexecfwk_core/include", 33 "${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime/", 34 "${ability_runtime_test_path}/mock/ability_manager_collaborator", 35 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", 36 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit/include", 37 "${ability_runtime_test_path}/unittest/app_debug_listener_stub_test", 38 "${ability_runtime_services_path}/abilitymgr/include/mission", 39 "${ability_runtime_services_path}/abilitymgr/include/scene_board", 40 "mock/include", 41 ] 42 43 sources = [ 44 "${ability_runtime_path}/services/abilitymgr/src/ability_auto_startup_service.cpp", 45 "${ability_runtime_services_path}/abilitymgr/src/ability_connect_callback_stub.cpp", 46 "${ability_runtime_services_path}/abilitymgr/src/process_options.cpp", 47 "${ability_runtime_services_path}/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp", 48 "${ability_runtime_services_path}/abilitymgr/src/utils/timeout_state_utils.cpp", 49 "${ability_runtime_services_path}/abilitymgr/src/utils/window_options_utils.cpp", 50 "${ability_runtime_services_path}/abilitymgr/src/utils/request_id_util.cpp", 51 "ability_manager_service_eleven_test.cpp", 52 "mock/src/mock_my_flag.cpp", 53 "mock/src/mock_permission_verification.cpp", 54 "mock/src/mock_scene_board_judgement.cpp", 55 ] 56 57 configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] 58 59 cflags = [ 60 "-Dprivate = public", 61 "-Dprotected = public", 62 ] 63 64 deps = [ 65 "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", 66 "${ability_runtime_innerkits_path}/ability_manager:mission_info", 67 "${ability_runtime_innerkits_path}/app_manager:app_manager", 68 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 69 "${ability_runtime_native_path}/ability/native:auto_startup_callback", 70 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 71 "${ability_runtime_path}/utils/global/freeze:freeze_util", 72 "${ability_runtime_path}/utils/server/startup:startup_util", 73 "${ability_runtime_services_path}/abilitymgr:abilityms", 74 "${ability_runtime_services_path}/abilitymgr:wantagent_manager", 75 "${ability_runtime_services_path}/common:app_util", 76 "${ability_runtime_services_path}/common:event_report", 77 "${ability_runtime_services_path}/common:perm_verification", 78 "${ability_runtime_services_path}/common:task_handler_wrap", 79 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit:aakit_mock", 80 ] 81 82 external_deps = [ 83 "ability_base:session_info", 84 "ability_base:want", 85 "ability_base:zuri", 86 "ability_runtime:ability_manager", 87 "access_token:libaccesstoken_sdk", 88 "access_token:libnativetoken", 89 "access_token:libtoken_setproc", 90 "bundle_framework:appexecfwk_base", 91 "bundle_framework:appexecfwk_core", 92 "cJSON:cjson", 93 "c_utils:utils", 94 "common_event_service:cesfwk_innerkits", 95 "eventhandler:libeventhandler", 96 "ffrt:libffrt", 97 "googletest:gmock_main", 98 "googletest:gtest_main", 99 "hilog:libhilog", 100 "hisysevent:libhisysevent", 101 "hitrace:hitrace_meter", 102 "ipc:ipc_core", 103 "kv_store:distributeddata_inner", 104 "safwk:api_cache_manager", 105 "selinux_adapter:librestorecon", 106 "window_manager:session_manager_lite", 107 ] 108 109 if (ability_runtime_graphics) { 110 external_deps += [ 111 "hitrace:libhitracechain", 112 "window_manager:libdm", 113 "window_manager:libwsutils", 114 "window_manager:scene_session", 115 ] 116 } 117 118 cflags_cc = [] 119 120 if (os_dlp_part_enabled) { 121 cflags_cc += [ "-DWITH_DLP" ] 122 } 123} 124 125group("unittest") { 126 testonly = true 127 deps = [ ":ability_manager_service_eleven_test" ] 128} 129