1# Copyright (c) 2024-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") 16 17group("unittest") { 18 testonly = true 19 deps = [ 20 ":extension_data_handler_test", 21 ":ws_extension_session_manager_test", 22 ] 23 if(window_manager_use_sceneboard) { 24 deps += [ 25 ":ws_extension_session_test", 26 ":ws_scene_session_manager_extension_test", 27 ] 28 } 29} 30 31module_out_path = "window_manager/window_manager/window_scene/ui_extension" 32ws_unittest_common = "../:ws_unittest_common" 33 34test_external_deps = [ 35 "ability_base:configuration", 36 "ability_runtime:ability_manager", 37 "ability_runtime:app_manager", 38 "ability_runtime:session_handler", 39 "accessibility:accessibility_common", 40 "accessibility:accessibility_interface", 41 "access_token:libaccesstoken_sdk", 42 "bundle_framework:libappexecfwk_common", 43 "c_utils:utils", 44 "ffrt:libffrt", 45 "googletest:gmock", 46 "googletest:gtest", 47 "googletest:gtest_main", 48 "graphic_2d:librender_service_base", 49 "graphic_2d:librender_service_client", 50 "graphic_2d:window_animation", 51 "hilog:libhilog", 52 "image_framework:image_native", 53 "input:libmmi-client", 54 "input:libmmi-napi", 55 "ipc:ipc_single", 56 "libxml2:libxml2", 57 "napi:ace_napi", 58 "safwk:system_ability_fwk", 59] 60 61ohos_unittest("extension_data_handler_test") { 62 module_out_path = module_out_path 63 sources = [ "data_handler/extension_data_handler_test.cpp" ] 64 include_dirs = [ "${window_base_path}/window_scene/session/host/include" ] 65 deps = [ ws_unittest_common ] 66 external_deps = [ 67 "c_utils:utils", 68 "eventhandler:libeventhandler", 69 "googletest:gmock", 70 "googletest:gtest", 71 "googletest:gtest_main", 72 ] 73} 74 75ohos_unittest("ws_extension_session_manager_test") { 76 module_out_path = module_out_path 77 78 sources = [ "extension_session_manager_test.cpp" ] 79 80 deps = [ ws_unittest_common ] 81 82 external_deps = [ 83 "bundle_framework:appexecfwk_base", 84 "c_utils:utils", 85 "graphic_2d:librender_service_client", 86 "hilog:libhilog", 87 "image_framework:image_native", 88 "input:libmmi-napi", 89 ] 90} 91 92ohos_unittest("ws_extension_session_test") { 93 module_out_path = module_out_path 94 95 sources = [ "extension_session_test.cpp" ] 96 include_dirs = [ "${window_base_path}/window_scene/session/host/include" ] 97 98 deps = [ ws_unittest_common ] 99 defines = [ "ACCESSIBILITY_MOCK" ] 100 101 external_deps = [ 102 "ability_base:session_info", 103 "ability_base:want", 104 "accessibility:accessibility_common", 105 "accessibility:accessibility_interface", 106 "bundle_framework:appexecfwk_base", 107 "c_utils:utils", 108 "googletest:gmock", 109 "googletest:gtest", 110 "googletest:gtest_main", 111 "graphic_2d:librender_service_client", 112 "hilog:libhilog", 113 "image_framework:image_native", 114 "input:libmmi-napi", 115 ] 116} 117 118ohos_unittest("ws_scene_session_manager_extension_test") { 119 module_out_path = module_out_path 120 include_dirs = [ 121 "${window_base_path}/test/common/utils/include/", 122 "${window_base_path}/window_scene/test/mock", 123 "${window_base_path}/window_scene/test/unittest/ui_extension/mock", 124 ] 125 126 sources = [ 127 "scene_session_manager_extension_test.cpp", 128 "mock/mock_uiext_session_permission.cpp", 129 "../../mock/mock_ability_manager_client.cpp", 130 ] 131 132 defines = [ 133 "ENABLE_MOCK_IS_SYSTEM_CALLING", 134 "ENABLE_MOCK_VERIFY_CALLING_PERMISSION", 135 "ENABLE_MOCK_START_BY_HDCD", 136 ] 137 138 deps = [ ws_unittest_common ] 139 140 external_deps = test_external_deps 141 external_deps += [ 142 "ability_base:configuration", 143 "ability_base:session_info", 144 "ability_runtime:ability_context_native", 145 "ability_runtime:mission_info", 146 "bundle_framework:appexecfwk_base", 147 "bundle_framework:appexecfwk_core", 148 "eventhandler:libeventhandler", 149 ] 150} 151