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