1# Copyright (c) 2023 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/ohos.gni")
15import("//build/test.gni")
16import("//foundation/ability/ability_runtime/ability_runtime.gni")
17
18module_output_path = "ability_runtime/appfreeze_inner_test"
19
20###############################################################################
21config("module_context_config") {
22  visibility = [ ":*" ]
23  include_dirs = [
24    "${ability_runtime_innerkits_path}/app_manager/include/appmgr",
25    "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include",
26    "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include",
27    "${ability_runtime_path}/interfaces/kits/native/appkit/app/task",
28    "${ability_runtime_path}/interfaces/kits/native/ability/native",
29  ]
30  cflags = []
31  if (target_cpu == "arm") {
32    cflags += [ "-DBINDER_IPC_32BIT" ]
33  }
34  defines = [ "AMS_LOG_TAG = \"ApplicationUnitTest\"" ]
35}
36
37config("ability_start_setting_config") {
38  visibility = [ ":*" ]
39  include_dirs = [
40    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
41    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
42    "${c_utils_base_path}/include",
43    "${ability_runtime_innerkits_path}/ability_manager/include",
44  ]
45}
46
47ohos_unittest("appfreeze_inner_test") {
48  module_out_path = module_output_path
49
50  include_dirs = [
51    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
52    "${ability_runtime_path}/utils/global/time/include",
53  ]
54
55  configs = [
56    ":module_context_config",
57    ":ability_start_setting_config",
58  ]
59
60  sources = [
61    "${ability_runtime_native_path}/appkit/dfr/appfreeze_inner.cpp",
62    "appfreeze_inner_test.cpp",
63  ]
64
65  deps = [
66    "${ability_runtime_abilitymgr_path}/:abilityms",
67    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
68    "${ability_runtime_innerkits_path}/app_manager:app_manager",
69    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
70    "${ability_runtime_innerkits_path}/runtime:runtime",
71    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
72    "${ability_runtime_native_path}/ability/native:ability_thread",
73    "${ability_runtime_native_path}/ability/native:abilitykit_native",
74    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
75    "${ability_runtime_native_path}/appkit:app_context",
76    "${ability_runtime_native_path}/appkit:app_context_utils",
77    "${ability_runtime_native_path}/appkit:appkit_native",
78    "${ability_runtime_path}/js_environment/frameworks/js_environment:js_environment",
79    "${ability_runtime_path}/utils/global/freeze:freeze_util",
80    "//third_party/googletest:gmock_main",
81    "//third_party/googletest:gtest_main",
82  ]
83
84  external_deps = [
85    "ability_base:configuration",
86    "ability_base:extractresourcemanager",
87    "ability_base:string_utils",
88    "ability_base:want",
89    "bundle_framework:appexecfwk_base",
90    "bundle_framework:appexecfwk_core",
91    "c_utils:utils",
92    "common_event_service:cesfwk_innerkits",
93    "eventhandler:libeventhandler",
94    "faultloggerd:libbacktrace_local",
95    "faultloggerd:libdfx_procinfo",
96    "faultloggerd:libfaultloggerd",
97    "ffrt:libffrt",
98    "graphic_2d:librender_service_client",
99    "hicollie:libhicollie",
100    "hilog:libhilog",
101    "hisysevent:libhisysevent",
102    "hitrace:hitrace_meter",
103    "init:libbegetutil",
104    "input:libmmi-client",
105    "ipc:ipc_core",
106    "json:nlohmann_json_static",
107    "napi:ace_napi",
108    "resource_management:global_resmgr",
109    "safwk:system_ability_fwk",
110    "samgr:samgr_proxy",
111  ]
112}
113
114###############################################################################
115
116group("unittest") {
117  testonly = true
118  deps = [ ":appfreeze_inner_test" ]
119}
120