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