1# Copyright (c) 2024-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/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_connect_callback_stub", 52 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 53 "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", 54 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 55 "${ability_runtime_innerkits_path}/runtime:runtime", 56 "${ability_runtime_native_path}/ability:ability_context_native", 57 "${ability_runtime_native_path}/ability/native:ability_thread", 58 "${ability_runtime_native_path}/ability/native:abilitykit_native", 59 "${ability_runtime_native_path}/ability/native:abilitykit_utils", 60 "${ability_runtime_native_path}/ability/native:configuration_helper", 61 "${ability_runtime_native_path}/ability/native:insight_intent_executor", 62 "${ability_runtime_native_path}/ability/native:uiabilitykit_native", 63 "${ability_runtime_native_path}/appkit:app_context", 64 "${ability_runtime_native_path}/appkit:appkit_delegator", 65 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 66 "${ability_runtime_native_path}/appkit:appkit_native", 67 "${ability_runtime_native_path}/insight_intent/insight_intent_context:insightintentcontext", 68 "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi", 69 "${ability_runtime_path}/services/abilitymgr:abilityms_target", 70 "${ability_runtime_path}/utils/global/freeze:freeze_util", 71 "${ability_runtime_services_path}/common:event_report", 72 ] 73 74 external_deps = [ 75 "ability_base:base", 76 "ability_base:configuration", 77 "ability_base:session_info", 78 "ability_base:want", 79 "ability_runtime:ability_context_native", 80 "ability_runtime:runtime", 81 "ability_runtime:wantagent_innerkits", 82 "bundle_framework:appexecfwk_base", 83 "bundle_framework:appexecfwk_core", 84 "c_utils:utils", 85 "common_event_service:cesfwk_innerkits", 86 "eventhandler:libeventhandler", 87 "ffrt:libffrt", 88 "form_fwk:fmskit_native", 89 "googletest:gmock_main", 90 "googletest:gtest_main", 91 "hilog:libhilog", 92 "hisysevent:libhisysevent", 93 "hitrace:hitrace_meter", 94 "init:libbegetutil", 95 "ipc:ipc_core", 96 "napi:ace_napi", 97 "napi:cj_bind_ffi", 98 "napi:cj_bind_native", 99 "resource_management:global_resmgr", 100 "samgr:samgr_proxy", 101 "window_manager:cj_window_ffi", 102 "window_manager:scene_session", 103 "runtime_core:ani", 104 ] 105 106 if (ability_runtime_graphics) { 107 external_deps += [ 108 "image_framework:image_native", 109 "input:libmmi-client", 110 "window_manager:libwm", 111 ] 112 } 113} 114 115group("unittest") { 116 testonly = true 117 deps = [ ":cj_ui_ability_test" ] 118} 119