1# Copyright (c) 2022 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/wmserver"
17
18group("unittest") {
19  testonly = true
20  deps = [
21    ":wmserver_accessibility_connection_test",
22    ":wmserver_display_group_controller_test",
23    ":wmserver_display_group_info_test",
24    ":wmserver_drag_controller_test",
25    ":wmserver_mock_session_manager_service_test",
26    ":wmserver_window_common_event_test",
27    ":wmserver_window_display_zoom_controller_test",
28    ":wmserver_window_dumper_test",
29    ":wmserver_window_freeze_controller_test",
30    ":wmserver_window_group_mgr_test",
31    ":wmserver_window_inner_window_test",
32    ":wmserver_window_layout_policy_test",
33    ":wmserver_window_manager_config_test",
34    ":wmserver_window_manager_proxy_test",
35    ":wmserver_window_manager_service_utils_test",
36    ":wmserver_window_manager_stub_test",
37    ":wmserver_window_node_container_test",
38    ":wmserver_window_snapshot_test",
39    ":wmserver_window_system_effect_test",
40    ":wmserver_window_zorder_policy_test",
41  ]
42}
43
44test_external_deps = [
45  "ability_base:want",
46  "ability_runtime:ability_context_native",
47  "ability_runtime:ability_manager",
48  "ace_engine:ace_uicontent",
49  "bundle_framework:appexecfwk_base",
50  "c_utils:utils",
51  "common_event_service:cesfwk_innerkits",
52  "config_policy:configpolicy_util",
53  "display_manager:displaymgr",
54  "eventhandler:libeventhandler",
55  "graphic_2d:librender_service_client",
56  "graphic_2d:window_animation",
57  "hicollie:libhicollie",
58  "hilog:libhilog",
59  "hisysevent:libhisysevent",
60  "hitrace:hitrace_meter",
61  "input:libmmi-client",
62  "ipc:ipc_single",
63  "napi:ace_napi",
64  "power_manager:powermgr_client",
65  "safwk:system_ability_fwk",
66]
67
68test_public_deps = [
69  "//third_party/googletest:gmock",
70  "//third_party/googletest:gtest_main",
71]
72
73test_inner_deps = [
74  "${window_base_path}/dm:libdm",
75  "${window_base_path}/utils:libwmutil",
76  "${window_base_path}/utils:libwmutil_base",
77  "${window_base_path}/window_scene/interfaces/innerkits:libwsutils",
78  "${window_base_path}/wm:libwm",
79  "${window_base_path}/wmserver:sms",
80  "../..:libwms",
81  "../../../dmserver:libdms",
82  "../../../test/common/utils:libtestutil",
83  "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
84]
85
86config("wmserver_unittest_common_public_config") {
87  include_dirs = [
88    "../../../test/common/mock",
89    "../../../test/common/utils/include",
90    "../../../wm/include",
91    "../../include",
92    "../../include/zidl",
93    "../../include/window_snapshot",
94    "../../../interfaces/innerkits/wm",
95    "../../../utils/include",
96    "//third_party/googletest/googlemock/include",
97    "foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/",
98  ]
99}
100
101test_public_config = [
102  ":wmserver_unittest_common_public_config",
103  "../../../resources/config/build:coverage_flags",
104  "../../../resources/config/build:testcase_flags",
105]
106
107ohos_unittest("wmserver_window_manager_service_test") {
108  module_out_path = module_out_path
109
110  sources = [ "window_manager_service_test.cpp" ]
111  configs = test_public_config
112
113  deps = test_inner_deps
114  public_deps = test_public_deps
115  external_deps = test_external_deps
116}
117
118ohos_unittest("wmserver_input_window_monitor_test") {
119  module_out_path = module_out_path
120  configs = test_public_config
121  sources = [ "input_window_monitor_test.cpp" ]
122
123  deps = test_inner_deps
124  public_deps = test_public_deps
125  external_deps = test_external_deps
126}
127
128ohos_unittest("wmserver_avoid_area_controller_test") {
129  module_out_path = module_out_path
130  configs = test_public_config
131  sources = [ "avoid_area_controller_test.cpp" ]
132
133  deps = test_inner_deps
134  public_deps = test_public_deps
135  external_deps = test_external_deps
136}
137
138ohos_unittest("wmserver_window_controller_test") {
139  module_out_path = module_out_path
140  configs = test_public_config
141  sources = [ "window_controller_test.cpp" ]
142
143  deps = test_inner_deps
144  public_deps = test_public_deps
145  external_deps = test_external_deps
146}
147
148ohos_unittest("wmserver_minimize_app_test") {
149  module_out_path = module_out_path
150  configs = test_public_config
151  sources = [ "minimize_app_test.cpp" ]
152
153  deps = test_inner_deps
154  public_deps = test_public_deps
155  external_deps = test_external_deps
156}
157
158ohos_unittest("wmserver_window_layout_policy_test") {
159  module_out_path = module_out_path
160  configs = test_public_config
161  sources = [ "window_layout_policy_test.cpp" ]
162
163  deps = test_inner_deps
164  public_deps = test_public_deps
165  external_deps = test_external_deps
166}
167
168ohos_unittest("wmserver_window_manager_config_test") {
169  module_out_path = module_out_path
170  configs = test_public_config
171  sources = [ "window_manager_config_test.cpp" ]
172  deps = test_inner_deps
173  public_deps = test_public_deps
174  external_deps = test_external_deps
175
176  deps += [ "//third_party/libxml2:libxml2" ]
177}
178
179ohos_unittest("wmserver_window_snapshot_test") {
180  module_out_path = module_out_path
181  configs = test_public_config
182  sources = [ "window_snapshot_test.cpp" ]
183
184  deps = test_inner_deps
185  public_deps = test_public_deps
186  external_deps = test_external_deps
187
188  external_deps += [ "image_framework:image_native" ]
189}
190
191ohos_unittest("wmserver_window_zorder_policy_test") {
192  module_out_path = module_out_path
193  configs = test_public_config
194  sources = [ "window_zorder_policy_test.cpp" ]
195
196  deps = test_inner_deps
197  public_deps = test_public_deps
198  external_deps = test_external_deps
199}
200
201ohos_unittest("wmserver_window_node_container_test") {
202  module_out_path = module_out_path
203  configs = test_public_config
204  sources = [ "window_node_container_test.cpp" ]
205
206  deps = test_inner_deps
207  public_deps = test_public_deps
208  external_deps = test_external_deps
209}
210
211ohos_unittest("wmserver_window_node_test") {
212  module_out_path = module_out_path
213  configs = test_public_config
214  sources = [ "window_node_test.cpp" ]
215
216  deps = test_inner_deps
217  public_deps = test_public_deps
218  external_deps = test_external_deps
219}
220
221ohos_unittest("wmserver_window_pair_test") {
222  module_out_path = module_out_path
223  configs = test_public_config
224
225  sources = [ "window_pair_test.cpp" ]
226
227  deps = test_inner_deps
228  public_deps = test_public_deps
229  external_deps = test_external_deps
230}
231
232ohos_unittest("wmserver_window_manager_stub_test") {
233  module_out_path = module_out_path
234  configs = test_public_config
235  sources = [ "window_manager_stub_test.cpp" ]
236
237  deps = test_inner_deps
238  public_deps = test_public_deps
239  external_deps = test_external_deps
240}
241
242ohos_unittest("wmserver_starting_window_test") {
243  module_out_path = module_out_path
244  configs = test_public_config
245  sources = [ "starting_window_test.cpp" ]
246
247  deps = test_inner_deps
248  public_deps = test_public_deps
249  external_deps = test_external_deps
250}
251
252ohos_unittest("wmserver_window_manager_proxy_test") {
253  module_out_path = module_out_path
254  configs = test_public_config
255  sources = [ "window_manager_proxy_test.cpp" ]
256
257  deps = test_inner_deps
258  public_deps = test_public_deps
259  external_deps = test_external_deps
260}
261
262ohos_unittest("wmserver_window_dumper_test") {
263  module_out_path = module_out_path
264  configs = test_public_config
265  sources = [ "window_dumper_test.cpp" ]
266
267  deps = test_inner_deps
268  public_deps = test_public_deps
269  external_deps = test_external_deps
270}
271
272ohos_unittest("wmserver_display_group_controller_test") {
273  module_out_path = module_out_path
274  configs = test_public_config
275  sources = [ "display_group_controller_test.cpp" ]
276
277  deps = test_inner_deps
278  public_deps = test_public_deps
279  external_deps = test_external_deps
280}
281
282ohos_unittest("wmserver_window_display_zoom_controller_test") {
283  module_out_path = module_out_path
284  configs = test_public_config
285  sources = [ "window_display_zoom_controller_test.cpp" ]
286
287  deps = test_inner_deps
288  public_deps = test_public_deps
289  external_deps = test_external_deps
290}
291
292ohos_unittest("wmserver_display_group_info_test") {
293  module_out_path = module_out_path
294  configs = test_public_config
295  sources = [ "display_group_info_test.cpp" ]
296
297  deps = test_inner_deps
298  public_deps = test_public_deps
299  external_deps = test_external_deps
300}
301
302ohos_unittest("wmserver_accessibility_connection_test") {
303  module_out_path = module_out_path
304  configs = test_public_config
305  sources = [ "accessibility_connection_test.cpp" ]
306
307  deps = test_inner_deps
308  public_deps = test_public_deps
309  external_deps = test_external_deps
310}
311
312ohos_unittest("wmserver_window_freeze_controller_test") {
313  module_out_path = module_out_path
314  configs = test_public_config
315  sources = [ "window_freeze_controller_test.cpp" ]
316
317  deps = test_inner_deps
318  public_deps = test_public_deps
319  external_deps = test_external_deps
320}
321
322ohos_unittest("wmserver_window_inner_window_test") {
323  module_out_path = module_out_path
324  configs = test_public_config
325  sources = [ "window_inner_window_test.cpp" ]
326
327  deps = test_inner_deps
328  public_deps = test_public_deps
329  external_deps = test_external_deps
330}
331
332ohos_unittest("wmserver_remote_animation_test") {
333  module_out_path = module_out_path
334  configs = test_public_config
335  sources = [ "remote_animation_test.cpp" ]
336
337  deps = test_inner_deps
338  public_deps = test_public_deps
339  external_deps = test_external_deps
340}
341
342ohos_unittest("wmserver_drag_controller_test") {
343  module_out_path = module_out_path
344  configs = test_public_config
345  sources = [ "drag_controller_test.cpp" ]
346
347  deps = test_inner_deps
348  public_deps = test_public_deps
349  external_deps = test_external_deps
350}
351
352ohos_unittest("wmserver_window_inner_manager_test") {
353  module_out_path = module_out_path
354  configs = test_public_config
355  sources = [ "window_inner_manager_test.cpp" ]
356
357  deps = test_inner_deps
358  public_deps = test_public_deps
359  external_deps = test_external_deps
360}
361
362ohos_unittest("wmserver_window_root_test") {
363  module_out_path = module_out_path
364  configs = test_public_config
365  sources = [ "window_root_test.cpp" ]
366
367  deps = test_inner_deps
368  public_deps = test_public_deps
369  external_deps = test_external_deps
370}
371
372ohos_unittest("wmserver_window_system_effect_test") {
373  module_out_path = module_out_path
374  configs = test_public_config
375  sources = [ "window_system_effect_test.cpp" ]
376
377  deps = test_inner_deps
378  public_deps = test_public_deps
379  external_deps = test_external_deps
380}
381
382ohos_unittest("wmserver_window_manager_service_utils_test") {
383  module_out_path = module_out_path
384  configs = test_public_config
385  sources = [ "window_manager_service_utils_test.cpp" ]
386
387  deps = test_inner_deps
388  public_deps = test_public_deps
389  external_deps = test_external_deps
390  if (is_standard_system) {
391    external_deps += [ "init:libbegetutil" ]
392  } else {
393    external_deps += [ "init_lite:libbegetutil" ]
394  }
395}
396
397ohos_unittest("wmserver_window_group_mgr_test") {
398  module_out_path = module_out_path
399  configs = test_public_config
400  sources = [ "window_group_mgr_test.cpp" ]
401
402  deps = test_inner_deps
403  public_deps = test_public_deps
404  external_deps = test_external_deps
405}
406
407ohos_unittest("wmserver_mock_session_manager_service_test") {
408  module_out_path = module_out_path
409  configs = test_public_config
410  sources = [ "mock_session_manager_service_test.cpp" ]
411
412  deps = test_inner_deps
413  public_deps = test_public_deps
414  external_deps = test_external_deps
415}
416
417ohos_unittest("wmserver_window_common_event_test") {
418  module_out_path = module_out_path
419  configs = test_public_config
420  sources = [ "window_common_event_test.cpp" ]
421
422  deps = test_inner_deps
423  public_deps = test_public_deps
424  external_deps = test_external_deps
425}
426