• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/test.gni")
15import("../../../windowmanager_aafwk.gni")
16module_out_path = "window_manager/window_scene"
17
18group("unittest") {
19  testonly = true
20
21  deps = [
22    ":ws_scene_session_manager_proxy_test",
23    ":ws_scene_session_manager_stub_test",
24    ":ws_scene_session_manager_test",
25    ":ws_scene_session_test",
26    ":ws_screen_cutout_controller_test",
27    ":ws_screen_scene_config_test",
28    ":ws_screen_session_manager_test",
29    ":ws_session_manager_agent_controller_test",
30    ":ws_session_test",
31    ":ws_window_scene_config_test",
32    ":ws_window_session_property_test",
33  ]
34}
35
36ohos_unittest("ws_session_test") {
37  module_out_path = module_out_path
38
39  sources = [ "session_test.cpp" ]
40
41  deps = [ ":ws_unittest_common" ]
42
43  external_deps = [
44    "ability_base:session_info",
45    "ability_base:want",
46    "c_utils:utils",
47    "hilog:libhilog",
48  ]
49}
50
51ohos_unittest("ws_screen_cutout_controller_test") {
52  module_out_path = module_out_path
53
54  sources = [ "screen_cutout_controller_test.cpp" ]
55
56  deps = [ ":ws_unittest_common" ]
57  external_deps = [
58    "c_utils:utils",
59    "hilog:libhilog",
60  ]
61}
62
63ohos_unittest("ws_screen_scene_config_test") {
64  module_out_path = module_out_path
65
66  sources = [ "screen_scene_config_test.cpp" ]
67
68  deps = [ ":ws_unittest_common" ]
69
70  external_deps = [
71    "c_utils:utils",
72    "hilog:libhilog",
73  ]
74}
75
76ohos_unittest("ws_screen_session_manager_test") {
77  module_out_path = module_out_path
78
79  sources = [ "screen_session_manager_test.cpp" ]
80
81  deps = [ ":ws_unittest_common" ]
82
83  external_deps = [
84    "c_utils:utils",
85    "hilog:libhilog",
86  ]
87}
88
89ohos_unittest("ws_window_scene_config_test") {
90  module_out_path = module_out_path
91
92  sources = [ "window_scene_config_test.cpp" ]
93
94  deps = [ ":ws_unittest_common" ]
95
96  external_deps = [
97    "c_utils:utils",
98    "hilog:libhilog",
99  ]
100}
101
102ohos_unittest("ws_scene_session_manager_test") {
103  module_out_path = module_out_path
104
105  sources = [ "scene_session_manager_test.cpp" ]
106
107  deps = [ ":ws_unittest_common" ]
108
109  external_deps = [
110    "c_utils:utils",
111    "hilog:libhilog",
112  ]
113}
114
115ohos_unittest("ws_scene_session_manager_proxy_test") {
116  module_out_path = module_out_path
117
118  sources = [ "scene_session_manager_proxy_test.cpp" ]
119
120  deps = [ ":ws_unittest_common" ]
121
122  external_deps = [
123    "c_utils:utils",
124    "hilog:libhilog",
125  ]
126}
127
128ohos_unittest("ws_session_manager_agent_controller_test") {
129  module_out_path = module_out_path
130
131  sources = [ "session_manager_agent_controller_test.cpp" ]
132
133  deps = [ ":ws_unittest_common" ]
134
135  external_deps = [
136    "c_utils:utils",
137    "hilog:libhilog",
138  ]
139}
140
141ohos_unittest("ws_session_manager_test") {
142  module_out_path = module_out_path
143
144  sources = [ "session_manager_test.cpp" ]
145
146  deps = [ ":ws_unittest_common" ]
147
148  external_deps = [
149    "c_utils:utils",
150    "hilog:libhilog",
151  ]
152}
153
154ohos_unittest("ws_scene_session_manager_stub_test") {
155  module_out_path = module_out_path
156
157  sources = [ "scene_session_manager_stub_test.cpp" ]
158
159  deps = [ ":ws_unittest_common" ]
160
161  external_deps = [
162    "c_utils:utils",
163    "hilog:libhilog",
164  ]
165}
166
167ohos_unittest("ws_scene_session_test") {
168  module_out_path = module_out_path
169
170  sources = [ "scene_session_test.cpp" ]
171
172  deps = [ ":ws_unittest_common" ]
173
174  external_deps = [
175    "c_utils:utils",
176    "hilog:libhilog",
177  ]
178}
179
180ohos_unittest("ws_window_session_property_test") {
181  module_out_path = module_out_path
182
183  sources = [ "window_session_property_test.cpp" ]
184
185  deps = [ ":ws_unittest_common" ]
186
187  external_deps = [ "c_utils:utils" ]
188}
189
190## Build ws_unittest_common.a {{{
191config("ws_unittest_common_public_config") {
192  include_dirs = [
193    "${window_base_path}/test/common/mock",
194
195    # for WMError Code
196    "${window_base_path}/dm/include",
197    "${window_base_path}/dmserver/include",
198    "${window_base_path}/interfaces/innerkits/dm",
199    "${window_base_path}/interfaces/innerkits/wm",
200    "${window_base_path}/window_scene/session_manager/include",
201    "${window_base_path}/window_scene/session_manager_service/include",
202    "${window_base_path}/window_scene/common/include",
203    "${window_base_path}/window_scene",
204    "${window_base_path}/window_scene/test",
205    "//third_party/googletest/googlemock/include",
206
207    # for window_manager_interface
208    "${window_base_path}/wmserver/include",
209    "${window_base_path}/wmserver/include/zidl",
210    "${graphic_base_path}/graphic_2d/rosen/modules/animation/window_animation/include",
211    "${multimodalinput_path}/input/interfaces/native/innerkits/event/include",
212    "${multimodalinput_path}/input/util/common/include",
213    "${ability_runtime_inner_api_path}/ability_manager/include",
214    "${window_base_path}/wm/include",
215    "${window_base_path}/wm/include/zidl",
216
217    # for session_manager
218    "${multimodalinput_path}/input/interfaces/native/innerkits/event/include",
219    "${window_base_path}/window_scene/interfaces/include",
220    "${resourceschedule_path}/ffrt/interfaces/kits",
221    "${ability_runtime_inner_api_path}/ability_manager/include",
222    "${ability_runtime_inner_api_path}/session_handler/include",
223
224    # for screenlock_manager_interface
225    "${screenlock_mgr_path}/services/include",
226    "${screenlock_mgr_path}/utils/include",
227    "${screenlock_mgr_path}/frameworks/native/include",
228    "${window_base_path}/wm/include",
229    "${window_base_path}/wm/include/zidl",
230
231    # for window_manager_hilog
232    "${window_base_path}/utils/include",
233  ]
234}
235
236ohos_static_library("ws_unittest_common") {
237  visibility = [ ":*" ]
238  testonly = true
239
240  public_configs = [
241    ":ws_unittest_common_public_config",
242    "${window_base_path}/resources/config/build:coverage_flags",
243    "${window_base_path}/resources/config/build:testcase_flags",
244  ]
245
246  deps = [
247    "${window_base_path}/dm:libdm",
248    "${window_base_path}/utils:libwmutil",
249    "${window_base_path}/window_scene/common:window_scene_common",
250    "${window_base_path}/window_scene/session:scene_session",
251    "${window_base_path}/window_scene/session_manager:scene_session_manager",
252    "${window_base_path}/window_scene/session_manager:screen_session_manager",
253    "${window_base_path}/window_scene/session_manager:session_manager",
254    "${window_base_path}/wm:libwm",
255    "//third_party/googletest:gmock",
256    "//third_party/googletest:gtest_main",
257    "//third_party/libxml2:libxml2",
258  ]
259
260  public_deps = [
261    "${graphic_base_path}/graphic_2d/rosen/modules/render_service_client:librender_service_client",
262    "${window_base_path}/utils:libwmutil",
263  ]
264
265  external_deps = [
266    "ability_base:configuration",
267    "ability_base:want",
268    "c_utils:utils",
269    "hilog:libhilog",
270    "input:libmmi-client",
271    "ipc:ipc_single",
272  ]
273
274  part_name = "window_manager"
275  subsystem_name = "window"
276}
277## Build ws_unittest_common.a }}}
278