1# Copyright (c) 2022-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("../../../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 = [
34    "${ressched_services}:resschedsvc_static",
35    "//third_party/googletest:gtest_main",
36  ]
37
38  external_deps = [
39    "ability_base:want",
40    "ability_runtime:abilitykit_native",
41    "ability_runtime:app_manager",
42    "ability_runtime:connection_obs_manager",
43    "ability_runtime:wantagent_innerkits",
44    "bundle_framework:appexecfwk_base",
45    "common_event_service:cesfwk_innerkits",
46    "hilog:libhilog",
47    "hisysevent:libhisysevent",
48    "hisysevent:libhisyseventmanager",
49    "input:libmmi-client",
50    "ipc:ipc_single",
51    "os_account:os_account_innerkits",
52    "samgr:samgr_proxy",
53  ]
54
55  defines = []
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 += [ "RESSCHED_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 += [ "audio_framework:audio_client" ]
76  }
77  if (ressched_with_telephony_state_registry_enable) {
78    defines += [ "RESSCHED_TELEPHONY_STATE_REGISTRY_ENABLE" ]
79    external_deps += [
80      "core_service:tel_core_service_api",
81      "state_registry:tel_state_registry_api",
82    ]
83  }
84
85  subsystem_name = "resourceschedule"
86  part_name = "resource_schedule_service"
87}
88
89group("unittest") {
90  testonly = true
91  deps = []
92  deps += [ ":event_controller_test" ]
93}
94