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