• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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
18ohos_unittest("cj_ui_ability_test") {
19  module_out_path = "ability_runtime/ability_runtime/cj_ui_ability_test"
20  include_dirs = [
21    "${ability_runtime_test_path}/mock/common/include",
22    "${ability_runtime_path}/utils/global/freeze",
23    "${ability_runtime_path}/utils/global/freeze/include/freeze_util.h",
24    "${ability_runtime_path}/interfaces/kits/native/ability/native/ability_runtime",
25    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
26    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
27    "${ability_runtime_path}/interfaces/kits/native/appkit/app_startup",
28    "${ability_runtime_path}/interfaces/kits/native/ability/native",
29    "${ability_runtime_path}/interfaces/inner_api/runtime/include",
30    "${ability_runtime_native_path}/runtime",
31    "${ability_runtime_path}/cj_environment/interfaces/inner_api",
32  ]
33
34  cflags = []
35  if (target_cpu == "arm") {
36    cflags += [ "-DBINDER_IPC_32BIT" ]
37  }
38
39  sources = [
40    "${ability_runtime_native_path}/appkit/app/ability_record_mgr.cpp",
41    "${ability_runtime_native_path}/appkit/app/app_context.cpp",
42    "${ability_runtime_native_path}/appkit/app/app_loader.cpp",
43    "${ability_runtime_native_path}/appkit/app/application_cleaner.cpp",
44    "${ability_runtime_native_path}/appkit/app/ohos_application.cpp",
45    "cj_ui_ability_test.cpp",
46    "mock_lifecycle_observer.cpp",
47    "mock_lifecycle_observer.h",
48  ]
49
50  deps = [
51    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
52    "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting",
53    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
54    "${ability_runtime_innerkits_path}/runtime:runtime",
55    "${ability_runtime_native_path}/ability:ability_context_native",
56    "${ability_runtime_native_path}/ability/native:ability_thread",
57    "${ability_runtime_native_path}/ability/native:abilitykit_native",
58    "${ability_runtime_native_path}/ability/native:configuration_helper",
59    "${ability_runtime_native_path}/ability/native:insight_intent_executor",
60    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
61    "${ability_runtime_native_path}/appkit:app_context",
62    "${ability_runtime_native_path}/appkit:appkit_delegator",
63    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
64    "${ability_runtime_native_path}/appkit:appkit_native",
65    "${ability_runtime_native_path}/insight_intent/insight_intent_context:insightintentcontext",
66    "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi",
67    "${ability_runtime_path}/utils/global/freeze:freeze_util",
68    "${ability_runtime_services_path}/common:event_report",
69  ]
70
71  external_deps = [
72    "ability_base:base",
73    "ability_base:configuration",
74    "ability_base:session_info",
75    "ability_base:want",
76    "ability_runtime:ability_context_native",
77    "ability_runtime:runtime",
78    "ability_runtime:wantagent_innerkits",
79    "bundle_framework:appexecfwk_base",
80    "bundle_framework:appexecfwk_core",
81    "c_utils:utils",
82    "common_event_service:cesfwk_innerkits",
83    "eventhandler:libeventhandler",
84    "ffrt:libffrt",
85    "googletest:gmock_main",
86    "googletest:gtest_main",
87    "hilog:libhilog",
88    "hitrace:hitrace_meter",
89    "init:libbegetutil",
90    "ipc:ipc_core",
91    "napi:ace_napi",
92    "napi:cj_bind_ffi",
93    "napi:cj_bind_native",
94    "resource_management:global_resmgr",
95    "samgr:samgr_proxy",
96    "window_manager:cj_window_ffi",
97    "window_manager:scene_session",
98  ]
99
100  if (ability_runtime_graphics) {
101    external_deps += [
102      "image_framework:image_native",
103      "input:libmmi-client",
104      "window_manager:libwm",
105    ]
106  }
107}
108
109group("unittest") {
110  testonly = true
111  deps = [ ":cj_ui_ability_test" ]
112}
113