1# Copyright (c) 2022-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("../../../ressched.gni") 17 18module_output_path = 19 "resource_schedule_service/resource_schedule_service/ressched" 20 21ohos_unittest("event_controller_test") { 22 module_out_path = module_output_path 23 24 include_dirs = [ 25 "${ressched_common}/include", 26 "${ressched_interfaces}/innerkits/ressched_client/include", 27 ] 28 29 sources = [ 30 "event_controller_test.cpp", 31 "observer_event_test.cpp", 32 ] 33 34 deps = [ "${ressched_services}:resschedsvc_static" ] 35 36 external_deps = [ 37 "ability_base:want", 38 "ability_runtime:abilitykit_native", 39 "ability_runtime:app_manager", 40 "ability_runtime:connection_obs_manager", 41 "ability_runtime:wantagent_innerkits", 42 "bundle_framework:appexecfwk_base", 43 "common_event_service:cesfwk_innerkits", 44 "hilog:libhilog", 45 "hisysevent:libhisysevent", 46 "input:libmmi-client", 47 "ipc:ipc_single", 48 "os_account:os_account_innerkits", 49 "samgr:samgr_proxy", 50 "window_manager:libwm", 51 "window_manager:libwm_lite", 52 "window_manager:libwmutil_base", 53 "ffrt:libffrt", 54 ] 55 56 defines = [] 57 58 if (resource_schedule_service_with_app_nap_enable) { 59 defines += [ "RESOURCE_SCHEDULE_SERVICE_WITH_APP_NAP_ENABLE" ] 60 external_deps += [ "hisysevent:libhisyseventmanager" ] 61 } 62 if (ressched_with_communication_netmanager_base_enable) { 63 defines += [ "RESSCHED_COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 64 external_deps += [ "netmanager_base:net_conn_manager_if" ] 65 } 66 if (rss_request_enable) { 67 defines += [ "RESOURCE_REQUEST_REQUEST" ] 68 external_deps += [ "request:request_native" ] 69 } 70 if (device_movement_perception_enable) { 71 defines += [ "DEVICE_MOVEMENT_PERCEPTION_ENABLE" ] 72 external_deps += [ "movement:movement_client" ] 73 } 74 if (ressched_with_resourceschedule_multimedia_av_session_enable) { 75 defines += [ "RESSCHED_MULTIMEDIA_AV_SESSION_ENABLE" ] 76 external_deps += [ "av_session:avsession_client" ] 77 } 78 if (ressched_with_resourceschedule_multimedia_audio_framework_enable) { 79 defines += [ "RESSCHED_AUDIO_FRAMEWORK_ENABLE" ] 80 external_deps += [ 81 "audio_framework:audio_client", 82 "audio_framework:audio_foundation", 83 ] 84 } 85 if (ressched_with_telephony_state_registry_enable) { 86 defines += [ "RESSCHED_TELEPHONY_STATE_REGISTRY_ENABLE" ] 87 external_deps += [ 88 "core_service:tel_core_service_api", 89 "state_registry:tel_state_registry_api", 90 ] 91 } 92 if (has_bg_task_mgr) { 93 defines += [ "CONFIG_BGTASK_MGR" ] 94 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 95 } 96 if (rss_mmi_enable) { 97 defines += [ "MMI_ENABLE" ] 98 external_deps += [ "input:libmmi-client" ] 99 } 100 branch_protector_ret = "pac_ret" 101 102 sanitize = { 103 cfi = true 104 cfi_cross_dso = true 105 debug = false 106 } 107 108 subsystem_name = "resourceschedule" 109 part_name = "resource_schedule_service" 110} 111 112group("unittest") { 113 testonly = true 114 deps = [] 115 deps += [ ":event_controller_test" ] 116} 117