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/OH-DMS/window_scene" 17 18group("unittest") { 19 testonly = true 20 21 deps = [ 22 ":ws_screen_cutout_controller_test", 23 ":ws_screen_power_utils_test", 24 ":ws_screen_property_test", 25 ":ws_screen_rotation_property_test", 26 ":ws_screen_scene_config_test", 27 ":ws_screen_session_manager_client_proxy_test", 28 ":ws_screen_session_manager_client_stub_test", 29 ":ws_screen_session_manager_client_test", 30 ":ws_screen_session_manager_lite_proxy_test", 31 ":ws_screen_session_manager_lite_stub_test", 32 ":ws_screen_session_manager_lite_test", 33 ":ws_screen_session_manager_stub_test", 34 ":ws_screen_session_manager_test", 35 ":ws_screen_session_manager_two_test", 36 ":ws_screen_session_publish_test", 37 ":ws_screen_session_test", 38 ":ws_screen_setting_helper_test", 39 ":ws_screen_snapshot_picker_connection_test", 40 ":ws_session_display_power_controller_test", 41 ":ws_setting_observer_test", 42 ":ws_setting_provider_test", 43 ] 44 45 if (!window_manager_use_sceneboard) { 46 deps += [ ":ws_screen_session_manager_proxy_ut_test" ] 47 } else { 48 deps += [ ":ws_screen_session_manager_proxy_test" ] 49 } 50 51 if (!window_manager_use_sceneboard) { 52 deps += [ ":ws_screen_session_ability_connection_ut_test" ] 53 } else { 54 deps += [ ":ws_screen_session_ability_connection_test" ] 55 } 56 57 if (window_manager_fold_ability) { 58 deps += [ 59 ":ws_dual_display_fold_policy_test", 60 ":ws_dual_display_sensor_fold_state_manager_test", 61 ":ws_fold_screen_controller_test", 62 ":ws_fold_screen_sensor_manager_test", 63 ":ws_fold_screen_state_machine_test", 64 ":ws_secondary_display_fold_policy_test", 65 ":ws_secondary_display_sensor_fold_state_manager_test", 66 ":ws_secondary_fold_sensor_manager_test", 67 ":ws_sensor_fold_state_manager_test", 68 ":ws_single_display_fold_policy_test", 69 ":ws_single_display_pocket_fold_policy_test", 70 ":ws_single_display_sensor_fold_state_manager_test", 71 ":ws_single_display_sensor_pocket_fold_state_manager_test", 72 ":ws_super_fold_sensor_manager_test", 73 ":ws_super_fold_state_manager_test", 74 ] 75 } 76 77 if (window_manager_feature_multi_screen) { 78 deps += [ ":ws_multi_screen_manager_test" ] 79 } 80} 81 82ohos_unittest("ws_setting_observer_test") { 83 module_out_path = module_out_path 84 85 sources = [ "setting_observer_test.cpp" ] 86 87 deps = [ ":ws_unittest_common" ] 88 89 external_deps = [ 90 "ability_runtime:ability_manager", 91 "ability_runtime:dataobs_manager", 92 "c_utils:utils", 93 "hilog:libhilog", 94 ] 95} 96 97ohos_unittest("ws_setting_provider_test") { 98 module_out_path = module_out_path 99 100 sources = [ "setting_provider_test.cpp" ] 101 102 deps = [ ":ws_unittest_common" ] 103 104 external_deps = [ 105 "c_utils:utils", 106 "data_share:datashare_consumer", 107 "hilog:libhilog", 108 ] 109} 110 111ohos_unittest("ws_screen_session_publish_test") { 112 module_out_path = module_out_path 113 114 sources = [ "screen_session_publish_test.cpp" ] 115 116 deps = [ ":ws_unittest_common" ] 117 118 external_deps = [ 119 "ability_runtime:app_manager", 120 "c_utils:utils", 121 "common_event_service:cesfwk_innerkits", 122 "hilog:libhilog", 123 "init:libbegetutil", 124 ] 125} 126 127ohos_unittest("ws_screen_setting_helper_test") { 128 module_out_path = module_out_path 129 130 sources = [ "screen_setting_helper_test.cpp" ] 131 132 deps = [ 133 ":ws_unittest_common", 134 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 135 ] 136 external_deps = [ 137 "ability_runtime:app_manager", 138 "ability_runtime:dataobs_manager", 139 "c_utils:utils", 140 "hilog:libhilog", 141 "init:libbegetutil", 142 ] 143} 144 145ohos_unittest("ws_screen_session_manager_lite_test") { 146 module_out_path = module_out_path 147 148 sources = [ 149 "${window_base_path}/wmserver/src/zidl/mock_session_manager_service_proxy.cpp", 150 "screen_session_manager_lite_test.cpp", 151 ] 152 153 deps = [ 154 ":ws_unittest_common", 155 "${window_base_path}/dm_lite:libdm_lite", 156 "${window_base_path}/wmserver:sms", 157 ] 158 159 external_deps = [ 160 "ability_runtime:app_manager", 161 "c_utils:utils", 162 "hilog:libhilog", 163 ] 164} 165 166ohos_unittest("ws_multi_screen_manager_test") { 167 module_out_path = module_out_path 168 169 sanitize = { 170 cfi = true 171 cfi_cross_dso = true 172 debug = false 173 } 174 175 sources = [ "multi_screen_manager_test.cpp" ] 176 177 deps = [ ":ws_unittest_common" ] 178 179 external_deps = [ 180 "c_utils:utils", 181 "hilog:libhilog", 182 "hitrace:hitrace_meter", 183 ] 184} 185 186ohos_unittest("ws_screen_session_test") { 187 module_out_path = module_out_path 188 189 include_dirs = [ "${window_base_path}/window_scene/session/screen/include" ] 190 sources = [ "screen_session_test.cpp" ] 191 192 deps = [ 193 ":ws_unittest_common", 194 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 195 "${window_base_path}/window_scene/session:screen_session", 196 ] 197 198 external_deps = [ 199 "c_utils:utils", 200 "hilog:libhilog", 201 "init:libbegetutil", 202 ] 203 204 defines = [] 205 206 if (window_manager_fold_ability) { 207 defines += [ "FOLD_ABILITY_ENABLE" ] 208 } 209 210 if (window_manager_feature_screen_active_mode) { 211 defines += [ "WM_SCREEN_ACTIVE_MODE_ENABLE" ] 212 } 213 214 if (window_manager_feature_screen_color_gamut) { 215 defines += [ "WM_SCREEN_COLOR_GAMUT_ENABLE" ] 216 } 217 218 if (window_manager_feature_screen_hdr_format) { 219 defines += [ "WM_SCREEN_HDR_FORMAT_ENABLE" ] 220 } 221 222 if (window_manager_feature_screen_color_space) { 223 defines += [ "WM_SCREEN_COLOR_SPACE_ENABLE" ] 224 } 225 226 if (window_manager_feature_multi_screen) { 227 defines += [ "WM_MULTI_SCREEN_ENABLE" ] 228 } 229 230 if (window_manager_feature_multi_screen_frame_ctl) { 231 defines += [ "WM_MULTI_SCREEN_CTL_ABILITY_ENABLE" ] 232 } 233 if (window_manager_feature_cam_mode) { 234 defines += [ "WM_CAM_MODE_ABILITY_ENABLE" ] 235 } 236 237 if (window_manager_feature_multi_usr) { 238 defines += [ "WM_MULTI_USR_ABILITY_ENABLE" ] 239 } 240} 241 242ohos_unittest("ws_screen_session_ability_connection_test") { 243 module_out_path = module_out_path 244 245 include_dirs = [ "${window_base_path}/window_scene/session/screen/include" ] 246 sources = [ "screen_session_ability_connection_test.cpp" ] 247 248 deps = [ 249 ":ws_unittest_common", 250 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 251 "${window_base_path}/window_scene/session:screen_session", 252 ] 253 254 external_deps = [ 255 "ability_base:base", 256 "ability_base:want", 257 "ability_runtime:abilitykit_native", 258 "ability_runtime:extension_manager", 259 "c_utils:utils", 260 "ipc:ipc_core", 261 ] 262} 263 264ohos_unittest("ws_screen_session_ability_connection_ut_test") { 265 module_out_path = module_out_path 266 267 include_dirs = [ "${window_base_path}/window_scene/session/screen/include" ] 268 sources = [ "screen_session_ability_connection_ut_test.cpp" ] 269 270 deps = [ 271 ":ws_unittest_common", 272 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 273 "${window_base_path}/window_scene/session:screen_session", 274 ] 275 276 external_deps = [ 277 "ability_base:base", 278 "ability_base:want", 279 "ability_runtime:abilitykit_native", 280 "ability_runtime:extension_manager", 281 "c_utils:utils", 282 "ipc:ipc_core", 283 ] 284} 285 286ohos_unittest("ws_screen_snapshot_picker_connection_test") { 287 module_out_path = module_out_path 288 289 include_dirs = [ "${window_base_path}/window_scene/session/screen/include" ] 290 sources = [ "screen_snapshot_picker_connection_test.cpp" ] 291 292 deps = [ 293 ":ws_unittest_common", 294 "${window_base_path}/window_scene/session:screen_session", 295 ] 296 297 external_deps = [ 298 "ability_runtime:abilitykit_native", 299 "c_utils:utils", 300 ] 301} 302 303ohos_unittest("ws_screen_property_test") { 304 module_out_path = module_out_path 305 306 include_dirs = [ "${window_base_path}/window_scene/session/screen/include" ] 307 sources = [ "screen_property_test.cpp" ] 308 309 deps = [ 310 ":ws_unittest_common", 311 "${window_base_path}/window_scene/session:screen_session", 312 ] 313 314 external_deps = [ 315 "c_utils:utils", 316 "graphic_2d:librender_service_client", 317 ] 318} 319 320ohos_unittest("ws_screen_cutout_controller_test") { 321 module_out_path = module_out_path 322 323 sanitize = { 324 cfi = true 325 cfi_cross_dso = true 326 debug = false 327 } 328 329 sources = [ "screen_cutout_controller_test.cpp" ] 330 331 deps = [ ":ws_unittest_common" ] 332 external_deps = [ 333 "ability_runtime:app_manager", 334 "c_utils:utils", 335 "hilog:libhilog", 336 ] 337} 338 339ohos_unittest("ws_screen_scene_config_test") { 340 module_out_path = module_out_path 341 342 sources = [ "screen_scene_config_test.cpp" ] 343 344 deps = [ 345 ":ws_unittest_common", 346 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 347 ] 348 349 external_deps = [ 350 "c_utils:utils", 351 "hilog:libhilog", 352 ] 353} 354 355ohos_unittest("ws_screen_session_manager_client_proxy_test") { 356 module_out_path = module_out_path 357 358 sources = [ "screen_session_manager_client_proxy_test.cpp" ] 359 360 deps = [ ":ws_unittest_common" ] 361} 362 363ohos_unittest("ws_screen_session_manager_client_stub_test") { 364 module_out_path = module_out_path 365 366 include_dirs = [ "${window_base_path}/window_scene/screen_session_manager_client/include/zidl" ] 367 368 sources = [ "screen_session_manager_client_stub_test.cpp" ] 369 370 deps = [ ":ws_unittest_common" ] 371} 372 373ohos_unittest("ws_screen_session_manager_client_test") { 374 module_out_path = module_out_path 375 376 sources = [ "screen_session_manager_client_test.cpp" ] 377 378 deps = [ 379 ":ws_unittest_common", 380 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 381 ] 382} 383 384ohos_unittest("ws_screen_session_manager_lite_proxy_test") { 385 module_out_path = module_out_path 386 387 sources = [ 388 "${window_base_path}/window_scene/screen_session_manager/src/zidl/screen_session_manager_lite_proxy.cpp", 389 "screen_session_manager_lite_proxy_test.cpp", 390 ] 391 392 deps = [ 393 ":ws_unittest_common", 394 "${window_base_path}/dm_lite:libdm_lite", 395 "${window_base_path}/wmserver:sms", 396 ] 397} 398 399ohos_unittest("ws_screen_session_manager_lite_stub_test") { 400 module_out_path = module_out_path 401 402 sources = [ "screen_session_manager_lite_stub_test.cpp" ] 403 404 deps = [ 405 ":ws_unittest_common", 406 "${window_base_path}/wmserver:sms", 407 ] 408} 409 410ohos_unittest("ws_screen_session_manager_stub_test") { 411 module_out_path = module_out_path 412 413 sources = [ "screen_session_manager_stub_test.cpp" ] 414 415 deps = [ 416 ":ws_unittest_common", 417 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 418 ] 419 420 external_deps = [ 421 "ability_runtime:app_manager", 422 "c_utils:utils", 423 "hilog:libhilog", 424 ] 425} 426 427ohos_unittest("ws_screen_session_manager_proxy_test") { 428 module_out_path = module_out_path 429 430 sources = [ "screen_session_manager_proxy_test.cpp" ] 431 432 deps = [ 433 ":ws_unittest_common", 434 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 435 ] 436 437 external_deps = [ 438 "ability_runtime:app_manager", 439 "c_utils:utils", 440 "hilog:libhilog", 441 ] 442} 443 444ohos_unittest("ws_screen_session_manager_proxy_ut_test") { 445 module_out_path = module_out_path 446 447 sources = [ "screen_session_manager_proxy_ut_test.cpp" ] 448 449 deps = [ 450 ":ws_unittest_common", 451 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 452 ] 453 454 external_deps = [ 455 "ability_runtime:app_manager", 456 "c_utils:utils", 457 "hilog:libhilog", 458 ] 459} 460 461ohos_unittest("ws_screen_session_manager_test") { 462 module_out_path = module_out_path 463 464 sanitize = { 465 cfi = true 466 cfi_cross_dso = true 467 debug = false 468 } 469 470 sources = [ "screen_session_manager_test.cpp" ] 471 472 deps = [ 473 ":ws_unittest_common", 474 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 475 ] 476 477 external_deps = [ 478 "ability_runtime:ability_context_native", 479 "ability_runtime:app_manager", 480 "ability_runtime:runtime", 481 "c_utils:utils", 482 "hilog:libhilog", 483 "init:libbegetutil", 484 ] 485 486 defines = [] 487 488 if (window_manager_fold_ability) { 489 defines += [ "FOLD_ABILITY_ENABLE" ] 490 } 491 492 if (window_manager_feature_screen_active_mode) { 493 defines += [ "WM_SCREEN_ACTIVE_MODE_ENABLE" ] 494 } 495 496 if (window_manager_feature_screen_color_gamut) { 497 defines += [ "WM_SCREEN_COLOR_GAMUT_ENABLE" ] 498 } 499 500 if (window_manager_feature_screen_hdr_format) { 501 defines += [ "WM_SCREEN_HDR_FORMAT_ENABLE" ] 502 } 503 504 if (window_manager_feature_screen_color_space) { 505 defines += [ "WM_SCREEN_COLOR_SPACE_ENABLE" ] 506 } 507 508 if (window_manager_feature_multi_screen) { 509 defines += [ "WM_MULTI_SCREEN_ENABLE" ] 510 } 511 512 if (window_manager_feature_multi_screen_frame_ctl) { 513 defines += [ "WM_MULTI_SCREEN_CTL_ABILITY_ENABLE" ] 514 } 515 if (window_manager_feature_cam_mode) { 516 defines += [ "WM_CAM_MODE_ABILITY_ENABLE" ] 517 } 518 519 if (window_manager_feature_multi_usr) { 520 defines += [ "WM_MULTI_USR_ABILITY_ENABLE" ] 521 } 522} 523 524ohos_unittest("ws_screen_session_manager_two_test") { 525 module_out_path = module_out_path 526 527 sources = [ "screen_session_manager_two_test.cpp" ] 528 529 deps = [ 530 ":ws_unittest_common", 531 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 532 ] 533 534 external_deps = [ 535 "c_utils:utils", 536 "hilog:libhilog", 537 "init:libbegetutil", 538 ] 539} 540 541ohos_unittest("ws_screen_rotation_property_test") { 542 module_out_path = module_out_path 543 544 sources = [ "screen_rotation_property_test.cpp" ] 545 546 deps = [ ":ws_unittest_common" ] 547 548 external_deps = [ 549 "ability_runtime:app_manager", 550 "c_utils:utils", 551 "hilog:libhilog", 552 ] 553 defines = [] 554 if (defined(global_parts_info) && defined(global_parts_info.sensors_sensor)) { 555 external_deps += [ "sensor:sensor_interface_native" ] 556 defines += [ "SENSOR_ENABLE" ] 557 } 558} 559 560ohos_unittest("ws_screen_session_dumper_test") { 561 module_out_path = module_out_path 562 563 sources = [ "screen_session_dumper_test.cpp" ] 564 565 deps = [ ":ws_unittest_common" ] 566 567 external_deps = [ 568 "c_utils:utils", 569 "hilog:libhilog", 570 "init:libbegetutil", 571 ] 572} 573 574ohos_unittest("ws_screen_power_utils_test") { 575 module_out_path = module_out_path 576 577 sources = [ "screen_power_utils_test.cpp" ] 578 579 deps = [ ":ws_unittest_common" ] 580 581 external_deps = [ 582 "c_utils:utils", 583 "hilog:libhilog", 584 "init:libbegetutil", 585 ] 586} 587 588ohos_unittest("ws_session_display_power_controller_test") { 589 module_out_path = module_out_path 590 591 sources = [ "session_display_power_controller_test.cpp" ] 592 593 deps = [ ":ws_unittest_common" ] 594 595 external_deps = [ 596 "ability_runtime:app_manager", 597 "c_utils:utils", 598 "hilog:libhilog", 599 ] 600} 601 602if (window_manager_fold_ability) { 603 ohos_unittest("ws_single_display_fold_policy_test") { 604 module_out_path = module_out_path 605 606 sources = [ "single_display_fold_policy_test.cpp" ] 607 608 deps = [ ":ws_unittest_common" ] 609 610 external_deps = [ 611 "ability_runtime:app_manager", 612 "c_utils:utils", 613 "hilog:libhilog", 614 ] 615 } 616 617 ohos_unittest("ws_single_display_pocket_fold_policy_test") { 618 module_out_path = module_out_path 619 620 sources = [ "single_display_pocket_fold_policy_test.cpp" ] 621 622 deps = [ ":ws_unittest_common" ] 623 624 external_deps = [ 625 "ability_runtime:app_manager", 626 "c_utils:utils", 627 "hilog:libhilog", 628 "init:libbegetutil", 629 ] 630 } 631 632 ohos_unittest("ws_sensor_fold_state_manager_test") { 633 module_out_path = module_out_path 634 635 sources = [ "sensor_fold_state_manager_test.cpp" ] 636 637 deps = [ ":ws_unittest_common" ] 638 639 external_deps = [ 640 "ability_runtime:app_manager", 641 "c_utils:utils", 642 "hilog:libhilog", 643 "init:libbegetutil", 644 ] 645 } 646 647 ohos_unittest("ws_dual_display_fold_policy_test") { 648 module_out_path = module_out_path 649 650 sources = [ "dual_display_fold_policy_test.cpp" ] 651 652 deps = [ ":ws_unittest_common" ] 653 654 external_deps = [ 655 "ability_runtime:app_manager", 656 "c_utils:utils", 657 "hilog:libhilog", 658 "init:libbegetutil", 659 ] 660 } 661 662 ohos_unittest("ws_dual_display_sensor_fold_state_manager_test") { 663 module_out_path = module_out_path 664 665 sources = [ "dual_display_sensor_fold_state_manager_test.cpp" ] 666 667 deps = [ ":ws_unittest_common" ] 668 669 external_deps = [ 670 "ability_runtime:app_manager", 671 "c_utils:utils", 672 "hilog:libhilog", 673 "init:libbegetutil", 674 ] 675 } 676 677 ohos_unittest("ws_fold_screen_sensor_manager_test") { 678 module_out_path = module_out_path 679 680 sources = [ "fold_screen_sensor_manager_test.cpp" ] 681 682 deps = [ 683 ":ws_unittest_common", 684 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 685 ] 686 687 external_deps = [ 688 "ability_runtime:app_manager", 689 "c_utils:utils", 690 "hilog:libhilog", 691 "init:libbegetutil", 692 ] 693 694 defines = [] 695 if (defined(global_parts_info) && 696 defined(global_parts_info.sensors_sensor)) { 697 external_deps += [ "sensor:sensor_interface_native" ] 698 defines += [ "SENSOR_ENABLE" ] 699 } 700 } 701 702 ohos_unittest("ws_fold_screen_controller_test") { 703 module_out_path = module_out_path 704 705 sources = [ "fold_screen_controller_test.cpp" ] 706 707 deps = [ ":ws_unittest_common" ] 708 709 external_deps = [ 710 "ability_runtime:app_manager", 711 "c_utils:utils", 712 "hilog:libhilog", 713 "init:libbegetutil", 714 ] 715 } 716 717 ohos_unittest("ws_fold_screen_state_machine_test") { 718 module_out_path = module_out_path 719 720 sources = [ "fold_screen_state_machine_test.cpp" ] 721 722 deps = [ ":ws_unittest_common" ] 723 724 external_deps = [ 725 "ability_runtime:app_manager", 726 "c_utils:utils", 727 "hilog:libhilog", 728 ] 729 } 730 731 ohos_unittest("ws_single_display_sensor_fold_state_manager_test") { 732 module_out_path = module_out_path 733 734 sources = [ "single_display_sensor_fold_state_manager_test.cpp" ] 735 736 deps = [ 737 ":ws_unittest_common", 738 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 739 ] 740 741 external_deps = [ 742 "c_utils:utils", 743 "hilog:libhilog", 744 ] 745 } 746 747 ohos_unittest("ws_single_display_sensor_pocket_fold_state_manager_test") { 748 module_out_path = module_out_path 749 750 sources = [ "single_display_sensor_pocket_fold_state_manager_test.cpp" ] 751 752 deps = [ ":ws_unittest_common" ] 753 754 external_deps = [ 755 "ability_runtime:app_manager", 756 "c_utils:utils", 757 "hilog:libhilog", 758 ] 759 } 760 761 ohos_unittest("ws_super_fold_state_manager_test") { 762 module_out_path = module_out_path 763 764 sources = [ "super_fold_state_manager_test.cpp" ] 765 766 deps = [ ":ws_unittest_common" ] 767 768 external_deps = [ 769 "ability_runtime:app_manager", 770 "c_utils:utils", 771 "hilog:libhilog", 772 "init:libbegetutil", 773 ] 774 } 775 776 ohos_unittest("ws_super_fold_sensor_manager_test") { 777 module_out_path = module_out_path 778 779 sources = [ "super_fold_sensor_manager_test.cpp" ] 780 781 deps = [ 782 ":ws_unittest_common", 783 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 784 ] 785 786 external_deps = [ 787 "ability_runtime:app_manager", 788 "c_utils:utils", 789 "hilog:libhilog", 790 "init:libbegetutil", 791 "sensor:sensor_interface_native", 792 ] 793 } 794 795 ohos_unittest("ws_secondary_display_sensor_fold_state_manager_test") { 796 module_out_path = module_out_path 797 798 sources = [ "secondary_display_sensor_fold_state_manager_test.cpp" ] 799 800 deps = [ ":ws_unittest_common" ] 801 802 external_deps = [ 803 "ability_runtime:app_manager", 804 "c_utils:utils", 805 "hilog:libhilog", 806 "init:libbegetutil", 807 ] 808 } 809 810 ohos_unittest("ws_secondary_fold_sensor_manager_test") { 811 module_out_path = module_out_path 812 813 sources = [ "secondary_fold_sensor_manager_test.cpp" ] 814 815 deps = [ 816 ":ws_unittest_common", 817 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 818 ] 819 820 external_deps = [ 821 "ability_runtime:app_manager", 822 "c_utils:utils", 823 "hilog:libhilog", 824 "init:libbegetutil", 825 "sensor:sensor_interface_native", 826 ] 827 828 defines = [] 829 if (defined(global_parts_info) && 830 defined(global_parts_info.sensors_sensor)) { 831 external_deps += [ "sensor:sensor_interface_native" ] 832 defines += [ "SENSOR_ENABLE" ] 833 } 834 } 835 836 ohos_unittest("ws_secondary_display_fold_policy_test") { 837 module_out_path = module_out_path 838 839 sources = [ "secondary_display_fold_policy_test.cpp" ] 840 841 deps = [ ":ws_unittest_common" ] 842 843 external_deps = [ 844 "ability_runtime:app_manager", 845 "c_utils:utils", 846 "hilog:libhilog", 847 "init:libbegetutil", 848 ] 849 } 850} 851 852## Build ws_unittest_common.a {{{ 853config("ws_unittest_common_public_config") { 854 include_dirs = [ 855 "${window_base_path}/test/common/mock", 856 "${window_base_path}/test/common/utils/include", 857 858 # for WMError Code 859 "${window_base_path}/dm/include", 860 "${window_base_path}/dmserver/include", 861 "${window_base_path}/interfaces/innerkits/dm", 862 "${window_base_path}/interfaces/innerkits/wm", 863 "${window_base_path}/window_scene/screen_session_manager_client/include", 864 "${window_base_path}/window_scene/screen_session_manager/include", 865 "${window_base_path}/window_scene/session_manager/include", 866 "${window_base_path}/window_scene/session_manager_service/include", 867 "${window_base_path}/window_scene/common/include", 868 "${window_base_path}/window_scene", 869 "${window_base_path}/window_scene/test", 870 "${window_base_path}/window_scene/intention_event/service/event_stage/include", 871 "//third_party/googletest/googlemock/include", 872 873 # for window_manager_interface 874 "${window_base_path}/wmserver/include", 875 "${window_base_path}/wmserver/include/zidl", 876 "${graphic_base_path}/graphic_2d/rosen/modules/animation/window_animation/include", 877 "${multimodalinput_path}/input/interfaces/native/innerkits/event/include", 878 "${multimodalinput_path}/input/util/common/include", 879 "${ability_runtime_inner_api_path}/ability_manager/include", 880 "${window_base_path}/wm/include", 881 "${window_base_path}/wm/include/zidl", 882 883 # for session 884 "${window_base_path}/window_scene/session/container/include/zidl", 885 886 # for session_manager 887 "${multimodalinput_path}/input/interfaces/native/innerkits/event/include", 888 "${window_base_path}/window_scene/interfaces/include", 889 "${resourceschedule_path}/ffrt/interfaces/kits", 890 "${ability_runtime_inner_api_path}/ability_manager/include", 891 "${ability_runtime_inner_api_path}/session_handler/include", 892 893 "${window_base_path}/wm/include", 894 "${window_base_path}/wm/include/zidl", 895 896 # for window_manager_hilog 897 "${window_base_path}/utils/include", 898 899 "${accessibility_path}/interfaces/innerkits/common/include/", 900 "${accessibility_path}/common/interface/include/parcel/", 901 ] 902} 903 904ohos_static_library("ws_unittest_common") { 905 visibility = [ ":*" ] 906 testonly = true 907 908 public_configs = [ 909 ":ws_unittest_common_public_config", 910 "${window_base_path}/resources/config/build:coverage_flags", 911 "${window_base_path}/resources/config/build:testcase_flags", 912 ] 913 914 deps = [ 915 "${window_base_path}/dm:libdm", 916 "${window_base_path}/utils:libwmutil", 917 "${window_base_path}/utils:libwmutil_base", 918 "${window_base_path}/window_scene/common:window_scene_common", 919 "${window_base_path}/window_scene/intention_event/service:intention_event_anr_manager", 920 "${window_base_path}/window_scene/screen_session_manager:screen_session_manager", 921 "${window_base_path}/window_scene/screen_session_manager_client:screen_session_manager_client", 922 "${window_base_path}/window_scene/session:scene_session", 923 "${window_base_path}/window_scene/session:screen_session", 924 "${window_base_path}/window_scene/session_manager:scene_session_manager", 925 "${window_base_path}/window_scene/session_manager:session_manager", 926 "${window_base_path}/window_scene/session_manager:session_manager_lite", 927 "${window_base_path}/wm:libwm", 928 "//third_party/googletest:gmock", 929 "//third_party/googletest:gtest_main", 930 "//third_party/libxml2:libxml2", 931 ] 932 933 public_deps = [ 934 "${arkui_path}/napi:ace_napi", 935 "${graphic_base_path}/graphic_2d/rosen/modules/render_service_client:librender_service_client", 936 "${window_base_path}/utils:libwmutil", 937 "${window_base_path}/utils:libwmutil_base", 938 "../../../test/common/utils:libtestutil", 939 ] 940 941 external_deps = [ 942 "ability_base:configuration", 943 "accessibility:accessibility_common", 944 "accessibility:accessibility_interface", 945 "c_utils:utils", 946 "hilog:libhilog", 947 "input:libmmi-client", 948 "ipc:ipc_single", 949 ] 950 951 public_external_deps = [ 952 "ability_base:session_info", 953 "ability_base:want", 954 ] 955 defines = [] 956 if (defined(global_parts_info) && defined(global_parts_info.sensors_sensor)) { 957 external_deps += [ "sensor:sensor_interface_native" ] 958 defines += [ "SENSOR_ENABLE" ] 959 } 960 961 part_name = "window_manager" 962 subsystem_name = "window" 963} 964## Build ws_unittest_common.a }}} 965