• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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")
16import("//foundation/ability/ability_runtime/test/unittest/ability_manager_service_third_test/abilitymgr.gni")
17
18module_output_path = "ability_runtime/ability_runtime/abilitymgr"
19
20ohos_unittest("ability_manager_service_third_test") {
21  module_out_path = module_output_path
22  sanitize = {
23    cfi = true
24    cfi_cross_dso = true
25    debug = false
26  }
27  branch_protector_ret = "pac_ret"
28
29  include_dirs = [
30    "${ability_runtime_innerkits_path}/uri_permission/include",
31    "${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime/",
32    "${ability_runtime_path}/interfaces/inner_api/ability_manager/include",
33    "${ability_runtime_services_path}/abilitymgr/include/utils",
34    "${ability_runtime_services_path}/abilitymgr/include",
35    "${ability_runtime_path}/services/abilitymgr/include/insight_intent",
36    "${ability_runtime_services_path}/common/include",
37    "${ability_runtime_test_path}/mock/mock_sa_call",
38    "${ability_runtime_test_path}/unittest/ability_manager_client_branch_test",
39    "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit/include",
40    "${ability_runtime_services_path}/appdfr/include",
41    "${ability_runtime_path}/interfaces/kits/native/ability/native/ui_service_extension_ability/connection",
42    "${ability_runtime_services_path}/abilitymgr/include/mission",
43    "mock/include",
44  ]
45
46  sources = [
47    "ability_manager_service_third_test.cpp",
48    "mock/src/mock_free_install_manager.cpp",
49    "mock/src/mock_want_utils.cpp",
50    "${ability_runtime_innerkits_path}/uri_permission/src/uri_permission_load_callback.cpp",
51    "${ability_runtime_services_path}/common/src/ffrt_task_handler_wrap.cpp",
52    "${ability_runtime_services_path}/common/src/queue_task_handler_wrap.cpp",
53    "${ability_runtime_services_path}/common/src/task_handler_wrap.cpp",
54    "${ability_runtime_services_path}/abilitymgr/src/ability_manager_service.cpp",
55    "${ability_runtime_services_path}/abilitymgr/src/preload_manager_service.cpp",
56    "${ability_runtime_services_path}/abilitymgr/src/report_data_partition_usage_manager.cpp",
57    "${ability_runtime_services_path}/abilitymgr/src/utils/request_id_util.cpp",
58  ]
59  sources += abilityms_files
60
61  configs = [
62    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
63    "${ability_runtime_services_path}/abilitymgr:abilityms_exception_config",
64  ]
65
66  deps = [
67    "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub",
68    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
69    "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting",
70    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
71    "${ability_runtime_innerkits_path}/ability_manager:mission_info",
72    "${ability_runtime_innerkits_path}/ability_manager:process_options",
73    "${ability_runtime_innerkits_path}/ability_manager:start_window_option",
74    "${ability_runtime_innerkits_path}/app_manager:app_manager",
75    "${ability_runtime_innerkits_path}/connectionobs_manager:connection_obs_manager",
76    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
77    "${ability_runtime_innerkits_path}/session_handler:session_handler",
78    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
79    "${ability_runtime_native_path}/ability/native:ability_business_error",
80    "${ability_runtime_native_path}/ability/native:abilitykit_native",
81    "${ability_runtime_native_path}/ability/native:auto_startup_callback",
82    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
83    "${ability_runtime_path}/utils/global/freeze:freeze_util",
84    "${ability_runtime_path}/utils/server/startup:startup_util",
85    "${ability_runtime_services_path}/abilitymgr:abilityms",
86    "${ability_runtime_services_path}/abilitymgr:wantagent_manager",
87    "${ability_runtime_services_path}/common:app_util",
88    "${ability_runtime_services_path}/common:event_report",
89    "${ability_runtime_services_path}/common:perm_verification",
90    "${ability_runtime_services_path}/common:rate_limiter",
91    "${ability_runtime_services_path}/common:record_cost_time_util",
92    "${ability_runtime_services_path}/common:res_sched_util",
93    "${ability_runtime_services_path}/common:task_handler_wrap",
94    "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit:aakit_mock",
95  ]
96
97  external_deps = [
98    "ability_base:base",
99    "ability_base:configuration",
100    "ability_base:extractortool",
101    "ability_base:session_info",
102    "ability_base:view_data",
103    "ability_base:want",
104    "ability_base:zuri",
105    "access_token:libaccesstoken_sdk",
106    "access_token:libtokenid_sdk",
107    "access_token:libnativetoken",
108    "access_token:libtoken_setproc",
109    "bundle_framework:appexecfwk_base",
110    "bundle_framework:appexecfwk_core",
111    "bundle_framework:libappexecfwk_common",
112    "c_utils:utils",
113    "cJSON:cjson",
114    "common_event_service:cesfwk_core",
115    "common_event_service:cesfwk_innerkits",
116    "config_policy:configpolicy_util",
117    "dsoftbus:softbus_client",
118    "eventhandler:libeventhandler",
119    "faultloggerd:libbacktrace_local",
120    "ffrt:libffrt",
121    "googletest:gmock_main",
122    "googletest:gtest_main",
123    "hicollie:libhicollie",
124    "hilog:libhilog",
125    "hisysevent:libhisysevent",
126    "hitrace:hitrace_meter",
127    "icu:shared_icuuc",
128    "init:libbeget_proxy",
129    "init:libbegetutil",
130    "ipc:ipc_core",
131    "json:nlohmann_json_static",
132    "kv_store:distributeddata_inner",
133    "os_account:os_account_innerkits",
134    "qos_manager:concurrent_task_client",
135    "relational_store:native_appdatafwk",
136    "relational_store:native_dataability",
137    "relational_store:native_rdb",
138    "safwk:api_cache_manager",
139    "safwk:system_ability_fwk",
140    "samgr:samgr_proxy",
141    "selinux_adapter:librestorecon",
142    "window_manager:libmodal_system_ui_extension_client",
143    "window_manager:libwsutils",
144    "window_manager:scene_session",
145    "window_manager:session_manager_lite",
146    "window_manager:sms",
147  ]
148  public_external_deps = [ "background_task_mgr:bgtaskmgr_innerkits" ]
149
150  if (background_task_mgr_continuous_task_enable) {
151    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
152  }
153
154  if (resource_schedule_service_enable) {
155    external_deps += [ "resource_schedule_service:ressched_client" ]
156  }
157
158  if (memmgr_override_enable) {
159    external_deps += [ "memmgr:memmgrclient" ]
160  }
161
162  cflags_cc = []
163  if (os_dlp_part_enabled) {
164    cflags_cc += [ "-DWITH_DLP" ]
165    external_deps += [
166      "dlp_permission_service:libdlp_permission_sdk",
167      "dlp_permission_service:libdlpparse",
168    ]
169  }
170
171  defines = []
172
173  if (ability_runtime_auto_fill) {
174    defines += [ "SUPPORT_AUTO_FILL" ]
175  }
176
177  if (ability_runtime_child_process) {
178    defines += [ "SUPPORT_CHILD_PROCESS" ]
179  }
180
181  if (ability_runtime_graphics) {
182    defines += [ "SUPPORT_GRAPHICS" ]
183    external_deps += [
184      "ability_base:session_info",
185      "i18n:intl_util",
186      "icu:shared_icuuc",
187      "image_framework:image_native",
188      "input:libmmi-client",
189      "resource_management:global_resmgr",
190      "window_manager:libdm",
191      "window_manager:libmodal_system_ui_extension_client",
192      "window_manager:libwm",
193      "window_manager:libwsutils",
194      "window_manager:scene_session",
195      "window_manager:sms",
196    ]
197  }
198
199  if (ability_runtime_graphics && ability_runtime_screenlock_enable) {
200    defines += [
201      "ABILITY_RUNTIME_SCREENLOCK_ENABLE"
202    ]
203    external_deps += [
204      "screenlock_mgr:screenlock_client",
205    ]
206  }
207
208  if (ability_runtime_upms) {
209    defines += [ "SUPPORT_UPMS" ]
210    deps += [
211      "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
212    ]
213  }
214
215  if (ability_runtime_feature_sandboxmanager) {
216    external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ]
217    defines += [
218      "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER",
219      "SUPPORT_APP_SELECTOR"
220    ]
221  }
222
223  if (include_app_domain_verify) {
224    external_deps += [
225      "app_domain_verify:app_domain_verify_common",
226      "app_domain_verify:app_domain_verify_mgr_client",
227    ]
228    defines += [ "APP_DOMAIN_VERIFY_ENABLED" ]
229  }
230
231  if (ability_runtime_power) {
232    defines += [ "SUPPORT_POWER" ]
233    external_deps += [ "power_manager:powermgr_client" ]
234  }
235
236  if (ability_runtime_graphics &&
237      ability_runtime_start_window_options_with_pixelmap) {
238    defines += [ "START_WINDOW_OPTIONS_WITH_PIXELMAP" ]
239    external_deps += [ "image_framework:image_native" ]
240  }
241
242  if (ability_runtime_no_screen) {
243    defines += ["DISABLE_LAUNCHER"]
244  }
245}
246
247group("unittest") {
248  testonly = true
249  deps = [ ":ability_manager_service_third_test" ]
250}
251