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 = "resource_schedule_service/ressched" 19 20ohos_unittest("event_controller_test") { 21 module_out_path = module_output_path 22 23 include_dirs = [ 24 "${ressched_common}/include", 25 "${ressched_interfaces}/innerkits/ressched_client/include", 26 ] 27 28 sources = [ 29 "event_controller_test.cpp", 30 "observer_event_test.cpp", 31 ] 32 33 deps = [ "${ressched_services}:resschedsvc_static" ] 34 35 external_deps = [ 36 "ability_base:want", 37 "ability_runtime:abilitykit_native", 38 "ability_runtime:app_manager", 39 "ability_runtime:connection_obs_manager", 40 "ability_runtime:wantagent_innerkits", 41 "bundle_framework:appexecfwk_base", 42 "common_event_service:cesfwk_innerkits", 43 "hilog:libhilog", 44 "hisysevent:libhisysevent", 45 "input:libmmi-client", 46 "ipc:ipc_single", 47 "os_account:os_account_innerkits", 48 "samgr:samgr_proxy", 49 ] 50 51 defines = [] 52 53 if (resource_schedule_service_hisysevent_enable) { 54 defines += [ "RESOURCE_SCHEDULE_SERVICE_WITH_APP_NAP_ENABLE" ] 55 external_deps += [ "hisysevent:libhisyseventmanager" ] 56 } 57 if (ressched_with_communication_netmanager_base_enable) { 58 defines += [ "RESSCHED_COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 59 external_deps += [ "netmanager_base:net_conn_manager_if" ] 60 } 61 if (rss_request_enable) { 62 defines += [ "RESOURCE_REQUEST_REQUEST" ] 63 external_deps += [ "request:request_native" ] 64 } 65 if (device_movement_perception_enable) { 66 defines += [ "DEVICE_MOVEMENT_PERCEPTION_ENABLE" ] 67 external_deps += [ "movement:movement_client" ] 68 } 69 if (ressched_with_resourceschedule_multimedia_av_session_enable) { 70 defines += [ "RESSCHED_MULTIMEDIA_AV_SESSION_ENABLE" ] 71 external_deps += [ "av_session:avsession_client" ] 72 } 73 if (ressched_with_resourceschedule_multimedia_audio_framework_enable) { 74 defines += [ "RESSCHED_AUDIO_FRAMEWORK_ENABLE" ] 75 external_deps += [ 76 "audio_framework:audio_client", 77 "audio_framework:audio_foundation", 78 ] 79 } 80 if (ressched_with_telephony_state_registry_enable) { 81 defines += [ "RESSCHED_TELEPHONY_STATE_REGISTRY_ENABLE" ] 82 external_deps += [ 83 "core_service:tel_core_service_api", 84 "state_registry:tel_state_registry_api", 85 ] 86 } 87 88 subsystem_name = "resourceschedule" 89 part_name = "resource_schedule_service" 90} 91 92group("unittest") { 93 testonly = true 94 deps = [] 95 deps += [ ":event_controller_test" ] 96} 97