1# Copyright (c) 2021-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( 16 "//foundation/distributedhardware/distributed_input/distributedinput.gni") 17 18module_out_path = "distributed_input/sink_manager" 19 20group("sinkmanagerunittest") { 21 testonly = true 22 23 deps = [ ":distributed_input_sinkmanager_test" ] 24} 25 26## UnitTest distributed_input_manager_service_test {{{ 27ohos_unittest("distributed_input_sinkmanager_test") { 28 module_out_path = module_out_path 29 30 include_dirs = [ 31 "${av_transport_path}/common/include", 32 "${innerkits_path}/include", 33 "${innerkits_path}/src", 34 "${ipc_path}/include", 35 "${ipc_path}/src", 36 "${distributedinput_path}/services/transportbase/include", 37 "${services_sink_path}/transport/include", 38 "${services_sink_path}/sinkmanager/include", 39 "${frameworks_path}/include", 40 "${common_path}/include", 41 "${fwk_common_path}/log/include", 42 "${fwk_common_path}/utils/include", 43 "${service_common}/include", 44 "//third_party/json/include", 45 "${services_sink_path}/inputcollector/include", 46 "${dfx_utils_path}/include", 47 "${utils_path}/include", 48 "${fwk_interfaces_path}/include", 49 "${fwk_interfaces_path}/include/ipc", 50 "${common_path}/test/mock", 51 "${services_sink_path}/sinkmanager/test/sinkmanagerunittest/mock/", 52 "${distributedinput_path}/services/state/include", 53 ] 54 55 sources = [ 56 "${common_path}/include/input_hub.cpp", 57 "${common_path}/include/white_list_util.cpp", 58 "${common_path}/test/mock/session_mock.cpp", 59 "${common_path}/test/mock/softbus_bus_center_mock.cpp", 60 "${ipc_path}/src/distributed_input_sink_stub.cpp", 61 "${ipc_path}/src/get_sink_screen_infos_call_back_stub.cpp", 62 "${ipc_path}/src/sharing_dhid_listener_stub.cpp", 63 "${services_sink_path}/inputcollector/src/distributed_input_collector.cpp", 64 "${services_sink_path}/sinkmanager/src/distributed_input_sink_event_handler.cpp", 65 "${services_sink_path}/sinkmanager/src/distributed_input_sink_manager.cpp", 66 "${services_sink_path}/sinkmanager/test/sinkmanagerunittest/mock/mock_process.cpp", 67 "${services_sink_path}/transport/src/distributed_input_sink_switch.cpp", 68 "${services_sink_path}/transport/src/distributed_input_sink_transport.cpp", 69 "distributed_input_sinkmanager_test.cpp", 70 ] 71 72 cflags = [ 73 "-Wall", 74 "-Werror", 75 "-g3", 76 "-Dprivate=public", 77 "-Dprotected=public", 78 ] 79 80 defines = [ 81 "HI_LOG_ENABLE", 82 "DH_LOG_TAG=\"distributedinpututtest\"", 83 "LOG_DOMAIN=0xD004100", 84 ] 85 86 deps = [ 87 "${dfx_utils_path}:libdinput_dfx_utils", 88 "${distributedinput_path}/services/state:libdinput_state", 89 "${distributedinput_path}/services/transportbase:libdinput_trans_base", 90 "${services_sink_path}/transport:libdinput_sink_trans", 91 "${utils_path}:libdinput_utils", 92 "//third_party/libevdev:libevdev", 93 "//third_party/openssl:libcrypto_shared", 94 ] 95 96 external_deps = [ 97 "access_token:libaccesstoken_sdk", 98 "access_token:libnativetoken", 99 "access_token:libtoken_setproc", 100 "c_utils:utils", 101 "config_policy:configpolicy_util", 102 "distributed_hardware_fwk:libdhfwk_sdk", 103 "dsoftbus:softbus_client", 104 "eventhandler:libeventhandler", 105 "graphic_2d:surface", 106 "ipc:ipc_core", 107 "safwk:system_ability_fwk", 108 "samgr:samgr_proxy", 109 "window_manager:libdm", 110 ] 111 112 cflags_cc = [ "-DHILOG_ENABLE" ] 113} 114## UnitTest distributed_input_manager_service_test }}} 115