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/test.gni") 15import("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17module_output_path = "ability_runtime/ability_runtime/abilitymgr" 18 19ohos_unittest("ability_keep_alive_service_test") { 20 module_out_path = module_output_path 21 22 include_dirs = [ 23 "mock/include", 24 "${ability_runtime_innerkits_path}/ability_manager/include", 25 "${ability_runtime_abilitymgr_path}/include", 26 "${ability_runtime_abilitymgr_path}/include/keep_alive", 27 "${ability_runtime_services_path}/common/include", 28 ] 29 30 sources = [ 31 "${ability_runtime_services_path}/abilitymgr/src/keep_alive/ability_keep_alive_service.cpp", 32 "ability_keep_alive_service_test.cpp", 33 "mock/src/ability_keep_alive_data_manager.cpp", 34 ] 35 36 configs = [] 37 38 deps = [ 39 "${ability_runtime_abilitymgr_path}/:abilityms", 40 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 41 "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", 42 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 43 "${ability_runtime_native_path}/ability:ability_context_native", 44 "${ability_runtime_services_path}/abilitymgr:abilityms", 45 "${ability_runtime_services_path}/common:app_util", 46 "${ability_runtime_services_path}/common:perm_verification", 47 ] 48 49 external_deps = [ 50 "ability_base:want", 51 "ability_base:zuri", 52 "ability_runtime:ability_manager", 53 "access_token:libaccesstoken_sdk", 54 "bundle_framework:appexecfwk_base", 55 "bundle_framework:appexecfwk_core", 56 "c_utils:utils", 57 "common_event_service:cesfwk_innerkits", 58 "eventhandler:libeventhandler", 59 "ffrt:libffrt", 60 "googletest:gtest_main", 61 "hilog:libhilog", 62 "hisysevent:libhisysevent", 63 "image_framework:image_native", 64 "ipc:ipc_core", 65 "kv_store:distributeddata_inner", 66 "safwk:api_cache_manager", 67 ] 68 if (ability_runtime_upms) { 69 deps += [ 70 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 71 ] 72 } 73} 74group("unittest") { 75 testonly = true 76 77 deps = [ ":ability_keep_alive_service_test" ] 78} 79