1# Copyright (c) 2021-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")
16
17module_out_path = "window_manager/wms"
18
19group("systemtest") {
20  testonly = true
21
22  deps = [
23    ":wms_window_animation_transition_test",
24    ":wms_window_app_floating_window_test",
25    ":wms_window_dialogwindow_test",
26    ":wms_window_display_zoom_test",
27    ":wms_window_drag_test",
28    ":wms_window_effect_test",
29    ":wms_window_focus_test",
30    ":wms_window_gamut_test",
31    ":wms_window_gesture_navigation_enabled_test",
32    ":wms_window_immersive_test",
33    ":wms_window_immersive_test2",
34    ":wms_window_input_method_test",
35    ":wms_window_input_test",
36    ":wms_window_layout_test",
37    ":wms_window_mode_support_info_test",
38    ":wms_window_multi_ability_test",
39    ":wms_window_nointeraction_listener_test",
40    ":wms_window_occupied_area_change_test",
41    ":wms_window_raisetoapptop_test",
42    ":wms_window_recover_test",
43    ":wms_window_rotation_test",
44    ":wms_window_split_immersive_test",
45    ":wms_window_split_test",
46    ":wms_window_subwindow_test",
47    ":wms_window_system_toast_window_test",
48    ":wms_window_systemsubwindow_test",
49    ":wms_window_touch_outside_test",
50    ":wms_window_visibility_info_test",
51    ":wms_window_water_mark_test",
52  ]
53  if (!window_manager_use_sceneboard) {
54    deps += [ ":wms_window_move_drag_test" ]
55  }
56}
57
58ohos_systemtest("wms_window_layout_test") {
59  module_out_path = module_out_path
60
61  sources = [ "window_layout_test.cpp" ]
62
63  include_dirs = [
64    "${window_base_path}/window_scene/test/mock",
65    "${window_base_path}/window_scene/interfaces/include",
66  ]
67
68  deps = [
69    ":wms_systemtest_common",
70    "${window_base_path}/test/common/utils:libtestutil",
71    "${window_base_path}/window_scene/common:window_scene_common",
72    "${window_base_path}/window_scene/interfaces/innerkits:libwsutils",
73    "${window_base_path}/window_scene/session:scene_session",
74  ]
75
76  external_deps = [
77    "c_utils:utils",
78    "hilog:libhilog",
79    "power_manager:powermgr_client",
80  ]
81}
82
83ohos_systemtest("wms_window_effect_test") {
84  module_out_path = module_out_path
85
86  sources = [ "window_effect_test.cpp" ]
87
88  deps = [
89    ":wms_systemtest_common",
90    "${window_base_path}/test/common/utils:libtestutil",
91  ]
92
93  external_deps = [
94    "c_utils:utils",
95    "hilog:libhilog",
96    "power_manager:powermgr_client",
97  ]
98}
99
100ohos_systemtest("wms_window_multi_ability_test") {
101  module_out_path = module_out_path
102
103  sources = [ "window_multi_ability_test.cpp" ]
104
105  deps = [ ":wms_systemtest_common" ]
106
107  external_deps = [
108    "c_utils:utils",
109    "hilog:libhilog",
110    "power_manager:powermgr_client",
111  ]
112}
113
114ohos_systemtest("wms_window_subwindow_test") {
115  module_out_path = module_out_path
116
117  sources = [ "window_subwindow_test.cpp" ]
118
119  deps = [ ":wms_systemtest_common" ]
120
121  external_deps = [
122    "bundle_framework:appexecfwk_base",
123    "c_utils:utils",
124    "hilog:libhilog",
125  ]
126}
127
128ohos_systemtest("wms_window_systemsubwindow_test") {
129  module_out_path = module_out_path
130
131  sources = [ "window_systemsubwindow_test.cpp" ]
132
133  deps = [
134    ":wms_systemtest_common",
135    "${window_base_path}/test/common/utils:libtestutil",
136  ]
137
138  external_deps = [
139    "bundle_framework:appexecfwk_base",
140    "c_utils:utils",
141    "hilog:libhilog",
142    "power_manager:powermgr_client",
143  ]
144}
145
146ohos_systemtest("wms_window_dialogwindow_test") {
147  module_out_path = module_out_path
148
149  sources = [ "window_dialogwindow_test.cpp" ]
150
151  deps = [ ":wms_systemtest_common" ]
152
153  external_deps = [
154    "bundle_framework:appexecfwk_base",
155    "c_utils:utils",
156    "common_event_service:cesfwk_innerkits",
157    "hilog:libhilog",
158  ]
159}
160
161ohos_systemtest("wms_window_immersive_test") {
162  module_out_path = module_out_path
163
164  sources = [ "window_immersive_test.cpp" ]
165
166  deps = [ ":wms_systemtest_common" ]
167
168  external_deps = [
169    "c_utils:utils",
170    "hilog:libhilog",
171    "power_manager:powermgr_client",
172  ]
173}
174
175ohos_systemtest("wms_window_immersive_test2") {
176  module_out_path = module_out_path
177
178  sources = [ "window_immersive_test2.cpp" ]
179
180  include_dirs = [
181    "${window_base_path}/window_scene/test/mock",
182    "${window_base_path}/interfaces/kits/napi/window_runtime/window_napi",
183  ]
184
185  deps = [
186    ":wms_systemtest_common",
187    "${window_base_path}/window_scene/common:window_scene_common",
188    "${window_base_path}/window_scene/session:scene_session",
189  ]
190
191  external_deps = [
192    "c_utils:utils",
193    "hilog:libhilog",
194    "power_manager:powermgr_client",
195  ]
196}
197
198ohos_systemtest("wms_window_focus_test") {
199  module_out_path = module_out_path
200
201  sources = [ "window_focus_test.cpp" ]
202
203  deps = [ ":wms_systemtest_common" ]
204
205  external_deps = [
206    "c_utils:utils",
207    "hilog:libhilog",
208    "power_manager:powermgr_client",
209  ]
210}
211
212ohos_systemtest("wms_window_split_immersive_test") {
213  module_out_path = module_out_path
214
215  sources = [ "window_split_immersive_test.cpp" ]
216
217  deps = [ ":wms_systemtest_common" ]
218
219  external_deps = [
220    "c_utils:utils",
221    "hilog:libhilog",
222    "power_manager:powermgr_client",
223  ]
224}
225
226ohos_systemtest("wms_window_split_test") {
227  module_out_path = module_out_path
228
229  sources = [ "window_split_test.cpp" ]
230
231  deps = [ ":wms_systemtest_common" ]
232
233  external_deps = [
234    "c_utils:utils",
235    "hilog:libhilog",
236    "power_manager:powermgr_client",
237  ]
238}
239
240ohos_systemtest("wms_window_move_drag_test") {
241  module_out_path = module_out_path
242
243  sources = [ "window_move_drag_test.cpp" ]
244
245  deps = [ ":wms_systemtest_common" ]
246
247  external_deps = [
248    "bundle_framework:appexecfwk_base",
249    "c_utils:utils",
250    "hilog:libhilog",
251    "power_manager:powermgr_client",
252  ]
253}
254
255ohos_systemtest("wms_window_input_method_test") {
256  module_out_path = module_out_path
257
258  sources = [ "window_input_method_test.cpp" ]
259
260  deps = [ ":wms_systemtest_common" ]
261
262  external_deps = [
263    "c_utils:utils",
264    "hilog:libhilog",
265    "power_manager:powermgr_client",
266  ]
267}
268
269ohos_systemtest("wms_window_gamut_test") {
270  module_out_path = module_out_path
271
272  sources = [ "window_gamut_test.cpp" ]
273
274  deps = [ ":wms_systemtest_common" ]
275
276  external_deps = [
277    "c_utils:utils",
278    "hilog:libhilog",
279    "power_manager:powermgr_client",
280  ]
281}
282
283ohos_systemtest("wms_window_gesture_navigation_enabled_test") {
284  module_out_path = module_out_path
285
286  sources = [ "window_gesture_navigation_enabled_test.cpp" ]
287
288  deps = [ ":wms_systemtest_common" ]
289
290  external_deps = [
291    "c_utils:utils",
292    "hilog:libhilog",
293  ]
294}
295
296ohos_systemtest("wms_window_input_test") {
297  module_out_path = module_out_path
298
299  sources = [ "window_input_test.cpp" ]
300
301  deps = [ ":wms_systemtest_common" ]
302
303  external_deps = [
304    "c_utils:utils",
305    "hilog:libhilog",
306    "power_manager:powermgr_client",
307  ]
308}
309
310ohos_systemtest("wms_window_visibility_info_test") {
311  module_out_path = module_out_path
312
313  sources = [ "window_visibility_info_test.cpp" ]
314
315  deps = [ ":wms_systemtest_common" ]
316
317  external_deps = [
318    "c_utils:utils",
319    "hilog:libhilog",
320    "power_manager:powermgr_client",
321  ]
322}
323
324ohos_systemtest("wms_window_display_zoom_test") {
325  module_out_path = module_out_path
326
327  sources = [ "window_display_zoom_test.cpp" ]
328
329  deps = [ ":wms_systemtest_common" ]
330
331  external_deps = [
332    "c_utils:utils",
333    "hilog:libhilog",
334    "power_manager:powermgr_client",
335  ]
336}
337
338ohos_systemtest("wms_window_drag_test") {
339  module_out_path = module_out_path
340
341  sources = [ "window_drag_test.cpp" ]
342
343  deps = [ ":wms_systemtest_common" ]
344
345  external_deps = [
346    "c_utils:utils",
347    "hilog:libhilog",
348    "power_manager:powermgr_client",
349  ]
350}
351
352ohos_systemtest("wms_window_raisetoapptop_test") {
353  module_out_path = module_out_path
354
355  sources = [ "window_raisetoapptop_test.cpp" ]
356
357  deps = [
358    ":wms_systemtest_common",
359    "${window_base_path}/test/common/utils:libtestutil",
360  ]
361
362  external_deps = [
363    "c_utils:utils",
364    "hilog:libhilog",
365    "power_manager:powermgr_client",
366  ]
367}
368
369ohos_systemtest("wms_window_rotation_test") {
370  module_out_path = module_out_path
371
372  sources = [ "window_rotation_test.cpp" ]
373
374  deps = [ ":wms_systemtest_common" ]
375
376  external_deps = [
377    "c_utils:utils",
378    "hilog:libhilog",
379    "power_manager:powermgr_client",
380  ]
381}
382
383ohos_systemtest("wms_window_recover_test") {
384  module_out_path = module_out_path
385
386  sources = [ "window_recover_test.cpp" ]
387
388  include_dirs = [
389    "${window_base_path}/test/common/mock",
390    "${window_base_path}/window_scene/test/mock",
391    "${window_base_path}/window_scene/session/host/include/zidl",
392    "${window_base_path}/window_scene/common/include",
393  ]
394
395  deps = [
396    ":wms_systemtest_common",
397    "${window_base_path}/window_scene/common:window_scene_common",
398    "${window_base_path}/window_scene/session:scene_session",
399  ]
400
401  external_deps = [
402    "ability_runtime:app_context",
403    "accessibility:accessibility_common",
404    "c_utils:utils",
405    "hilog:libhilog",
406    "init:libbegetutil",
407  ]
408}
409
410ohos_systemtest("wms_window_occupied_area_change_test") {
411  module_out_path = module_out_path
412
413  sources = [ "window_occupied_area_change_test.cpp" ]
414
415  deps = [ ":wms_systemtest_common" ]
416
417  external_deps = [
418    "c_utils:utils",
419    "hilog:libhilog",
420    "power_manager:powermgr_client",
421  ]
422}
423
424ohos_systemtest("wms_window_touch_outside_test") {
425  module_out_path = module_out_path
426
427  sources = [ "window_touch_outside_test.cpp" ]
428
429  deps = [ ":wms_systemtest_common" ]
430
431  external_deps = [
432    "c_utils:utils",
433    "hilog:libhilog",
434    "power_manager:powermgr_client",
435  ]
436}
437
438ohos_systemtest("wms_window_mode_support_info_test") {
439  module_out_path = module_out_path
440
441  sources = [ "window_mode_support_info_test.cpp" ]
442
443  deps = [ ":wms_systemtest_common" ]
444
445  external_deps = [
446    "c_utils:utils",
447    "hilog:libhilog",
448    "power_manager:powermgr_client",
449  ]
450}
451
452ohos_systemtest("wms_window_app_floating_window_test") {
453  module_out_path = module_out_path
454
455  sources = [ "window_app_floating_window_test.cpp" ]
456
457  deps = [
458    ":wms_systemtest_common",
459    "${window_base_path}/test/common/utils:libtestutil",
460  ]
461
462  external_deps = [
463    "c_utils:utils",
464    "common_event_service:cesfwk_innerkits",
465    "hilog:libhilog",
466    "power_manager:powermgr_client",
467  ]
468}
469
470ohos_systemtest("wms_window_system_toast_window_test") {
471  module_out_path = module_out_path
472
473  sources = [ "window_system_toast_test.cpp" ]
474
475  deps = [ ":wms_systemtest_common" ]
476
477  external_deps = [
478    "c_utils:utils",
479    "common_event_service:cesfwk_innerkits",
480    "hilog:libhilog",
481    "power_manager:powermgr_client",
482  ]
483}
484
485ohos_systemtest("wms_window_animation_transition_test") {
486  module_out_path = module_out_path
487
488  sources = [ "window_animation_transition_test.cpp" ]
489
490  deps = [
491    ":wms_systemtest_common",
492    "${window_base_path}/test/common/utils:libtestutil",
493  ]
494
495  external_deps = [
496    "c_utils:utils",
497    "hilog:libhilog",
498    "power_manager:powermgr_client",
499  ]
500}
501
502ohos_systemtest("wms_window_water_mark_test") {
503  module_out_path = module_out_path
504
505  sources = [ "window_water_mark_test.cpp" ]
506
507  deps = [ ":wms_systemtest_common" ]
508
509  external_deps = [
510    "c_utils:utils",
511    "hilog:libhilog",
512    "power_manager:powermgr_client",
513  ]
514}
515
516ohos_systemtest("wms_window_nointeraction_listener_test") {
517  module_out_path = module_out_path
518
519  sources = [ "window_nointeraction_listener_test.cpp" ]
520
521  deps = [ ":wms_systemtest_common" ]
522
523  external_deps = [
524    "c_utils:utils",
525    "hilog:libhilog",
526    "power_manager:powermgr_client",
527  ]
528}
529
530## Build wms_systemtest_common.a {{{
531config("wms_systemtest_common_public_config") {
532  include_dirs = [
533    "${window_base_path}/dm/include",
534    "${window_base_path}/dmserver/include",
535    "${window_base_path}/wm/include",
536    "${window_base_path}/wmserver/include",
537    "${window_base_path}/interfaces/innerkits/wm",
538    "${window_base_path}/utils/include",
539    "${window_base_path}/test/common/utils/include",
540    "//commonlibrary/c_utils/base/include",
541    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
542    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
543    "//third_party/googletest/googlemock/include",
544    "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
545
546    # for abilityContext
547    "${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
548    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
549    "//base/global/resource_management/interfaces/inner_api/include",
550    "//third_party/node/deps/icu-small/source/common",
551    "${ability_runtime_inner_api_path}/ability_manager/include",
552
553    # abilityContext end
554  ]
555}
556
557ohos_static_library("wms_systemtest_common") {
558  visibility = [ ":*" ]
559  testonly = true
560
561  sources = [ "window_test_utils.cpp" ]
562
563  public_configs = [
564    ":wms_systemtest_common_public_config",
565    "${window_base_path}/resources/config/build:coverage_flags",
566    "${window_base_path}/resources/config/build:testcase_flags",
567  ]
568
569  public_deps = [
570    "//foundation/arkui/ace_engine/interfaces/inner_api/ace:ace_uicontent",
571
572    # need delete it for abilitycontext
573    "${ability_runtime_inner_api_path}/ability_manager:ability_manager",
574    "${window_base_path}/dm:libdm",
575    "${window_base_path}/dmserver:libdms",
576    "${window_base_path}/utils:libwmutil",
577    "${window_base_path}/utils:libwmutil_base",
578    "${window_base_path}/window_scene/interfaces/innerkits:libwsutils",
579    "${window_base_path}/wm:libwm",
580    "//commonlibrary/c_utils/base:utils",
581    "//foundation/arkui/napi:ace_napi",
582    "//foundation/graphic/graphic_2d/rosen/modules/animation/window_animation:window_animation",
583    "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
584    "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client",
585    "//third_party/googletest:gmock",
586    "//third_party/googletest:gtest_main",
587  ]
588  external_deps = [
589    "ability_base:base",
590    "ability_base:want",
591    "ability_base:zuri",
592    "ability_runtime:ability_context_native",
593    "bundle_framework:appexecfwk_base",
594    "c_utils:utils",
595    "hilog:libhilog",
596    "ipc:ipc_single",
597    "power_manager:powermgr_client",
598  ]
599
600  part_name = "window_manager"
601  subsystem_name = "window"
602}
603## Build wms_systemtest_common.a }}}
604