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/dfr_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_manager_test") { 48 module_out_path = module_output_path 49 50 include_dirs = [ 51 "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", 52 "${ability_runtime_services_path}/appdfr/include", 53 "${ability_runtime_services_path}/appmgr/include", 54 "${ability_runtime_services_path}/common/include", 55 ] 56 57 configs = [ 58 ":module_context_config", 59 ":ability_start_setting_config", 60 ] 61 62 sources = [ "appfreeze_manager_test.cpp" ] 63 64 deps = [ 65 "${ability_runtime_path}/utils/global/freeze:freeze_util", 66 "${ability_runtime_services_path}/abilitymgr:abilityms", 67 "${ability_runtime_services_path}/common:perm_verification", 68 "//third_party/googletest:gmock_main", 69 "//third_party/googletest:gtest_main", 70 ] 71 72 external_deps = [ 73 "ability_base:configuration", 74 "ability_base:session_info", 75 "ability_base:want", 76 "ability_base:zuri", 77 "ability_runtime:app_manager", 78 "access_token:libaccesstoken_sdk", 79 "access_token:libnativetoken", 80 "access_token:libtoken_setproc", 81 "bundle_framework:appexecfwk_base", 82 "c_utils:utils", 83 "common_event_service:cesfwk_innerkits", 84 "eventhandler:libeventhandler", 85 "ffrt:libffrt", 86 "hilog:libhilog", 87 "init:libbeget_proxy", 88 "ipc:ipc_core", 89 "json:nlohmann_json_static", 90 ] 91} 92 93############################################################################### 94 95group("unittest") { 96 testonly = true 97 deps = [ ":appfreeze_manager_test" ] 98} 99