12d4d9a4dSopenharmony_ci# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
22d4d9a4dSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
32d4d9a4dSopenharmony_ci# you may not use this file except in compliance with the License.
42d4d9a4dSopenharmony_ci# You may obtain a copy of the License at
52d4d9a4dSopenharmony_ci#
62d4d9a4dSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
72d4d9a4dSopenharmony_ci#
82d4d9a4dSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
92d4d9a4dSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
102d4d9a4dSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112d4d9a4dSopenharmony_ci# See the License for the specific language governing permissions and
122d4d9a4dSopenharmony_ci# limitations under the License.
132d4d9a4dSopenharmony_ci
142d4d9a4dSopenharmony_ciimport("//build/test.gni")
152d4d9a4dSopenharmony_ciimport(
162d4d9a4dSopenharmony_ci    "//foundation/distributedhardware/distributed_input/distributedinput.gni")
172d4d9a4dSopenharmony_ci
182d4d9a4dSopenharmony_cimodule_out_path = "distributed_input/sink_manager"
192d4d9a4dSopenharmony_ci
202d4d9a4dSopenharmony_cigroup("sinkmanagerunittest") {
212d4d9a4dSopenharmony_ci  testonly = true
222d4d9a4dSopenharmony_ci
232d4d9a4dSopenharmony_ci  deps = [ ":distributed_input_sinkmanager_test" ]
242d4d9a4dSopenharmony_ci}
252d4d9a4dSopenharmony_ci
262d4d9a4dSopenharmony_ci## UnitTest distributed_input_manager_service_test {{{
272d4d9a4dSopenharmony_ciohos_unittest("distributed_input_sinkmanager_test") {
282d4d9a4dSopenharmony_ci  module_out_path = module_out_path
292d4d9a4dSopenharmony_ci
302d4d9a4dSopenharmony_ci  sanitize = {
312d4d9a4dSopenharmony_ci    cfi = true
322d4d9a4dSopenharmony_ci    cfi_cross_dso = true
332d4d9a4dSopenharmony_ci    debug = false
342d4d9a4dSopenharmony_ci  }
352d4d9a4dSopenharmony_ci
362d4d9a4dSopenharmony_ci  include_dirs = [
372d4d9a4dSopenharmony_ci    "${innerkits_path}/include",
382d4d9a4dSopenharmony_ci    "${innerkits_path}/src",
392d4d9a4dSopenharmony_ci    "${ipc_path}/include",
402d4d9a4dSopenharmony_ci    "${ipc_path}/src",
412d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/transportbase/include",
422d4d9a4dSopenharmony_ci    "${services_sink_path}/transport/include",
432d4d9a4dSopenharmony_ci    "${services_sink_path}/sinkmanager/include",
442d4d9a4dSopenharmony_ci    "${frameworks_path}/include",
452d4d9a4dSopenharmony_ci    "${common_path}/include",
462d4d9a4dSopenharmony_ci    "${services_state_path}/include",
472d4d9a4dSopenharmony_ci    "${service_common}/include",
482d4d9a4dSopenharmony_ci    "${services_sink_path}/inputcollector/include",
492d4d9a4dSopenharmony_ci    "${dfx_utils_path}/include",
502d4d9a4dSopenharmony_ci    "${utils_path}/include",
512d4d9a4dSopenharmony_ci    "${common_path}/test/mock",
522d4d9a4dSopenharmony_ci    "${services_sink_path}/sinkmanager/test/sinkmanagerunittest/mock/",
532d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/state/include",
542d4d9a4dSopenharmony_ci  ]
552d4d9a4dSopenharmony_ci
562d4d9a4dSopenharmony_ci  sources = [
572d4d9a4dSopenharmony_ci    "${common_path}/include/input_hub.cpp",
582d4d9a4dSopenharmony_ci    "${common_path}/include/white_list_util.cpp",
592d4d9a4dSopenharmony_ci    "${common_path}/test/mock/socket_mock.cpp",
602d4d9a4dSopenharmony_ci    "${common_path}/test/mock/softbus_bus_center_mock.cpp",
612d4d9a4dSopenharmony_ci    "${ipc_path}/src/distributed_input_sink_stub.cpp",
622d4d9a4dSopenharmony_ci    "${ipc_path}/src/get_sink_screen_infos_call_back_stub.cpp",
632d4d9a4dSopenharmony_ci    "${ipc_path}/src/sharing_dhid_listener_stub.cpp",
642d4d9a4dSopenharmony_ci    "${services_sink_path}/inputcollector/src/distributed_input_collector.cpp",
652d4d9a4dSopenharmony_ci    "${services_sink_path}/sinkmanager/src/distributed_input_sink_event_handler.cpp",
662d4d9a4dSopenharmony_ci    "${services_sink_path}/sinkmanager/src/distributed_input_sink_manager.cpp",
672d4d9a4dSopenharmony_ci    "${services_sink_path}/sinkmanager/test/sinkmanagerunittest/mock/mock_process.cpp",
682d4d9a4dSopenharmony_ci    "${services_sink_path}/transport/src/distributed_input_sink_switch.cpp",
692d4d9a4dSopenharmony_ci    "${services_sink_path}/transport/src/distributed_input_sink_transport.cpp",
702d4d9a4dSopenharmony_ci    "distributed_input_sinkmanager_test.cpp",
712d4d9a4dSopenharmony_ci  ]
722d4d9a4dSopenharmony_ci
732d4d9a4dSopenharmony_ci  cflags = [
742d4d9a4dSopenharmony_ci    "-Wall",
752d4d9a4dSopenharmony_ci    "-Werror",
762d4d9a4dSopenharmony_ci    "-g3",
772d4d9a4dSopenharmony_ci    "-Dprivate=public",
782d4d9a4dSopenharmony_ci    "-Dprotected=public",
792d4d9a4dSopenharmony_ci  ]
802d4d9a4dSopenharmony_ci
812d4d9a4dSopenharmony_ci  defines = [
822d4d9a4dSopenharmony_ci    "HI_LOG_ENABLE",
832d4d9a4dSopenharmony_ci    "DH_LOG_TAG=\"distributedinpututtest\"",
842d4d9a4dSopenharmony_ci    "LOG_DOMAIN=0xD004120",
852d4d9a4dSopenharmony_ci  ]
862d4d9a4dSopenharmony_ci
872d4d9a4dSopenharmony_ci  deps = [
882d4d9a4dSopenharmony_ci    "${dfx_utils_path}:libdinput_dfx_utils",
892d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/state:libdinput_sink_state",
902d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/transportbase:libdinput_trans_base",
912d4d9a4dSopenharmony_ci    "${services_sink_path}/transport:libdinput_sink_trans",
922d4d9a4dSopenharmony_ci    "${utils_path}:libdinput_utils",
932d4d9a4dSopenharmony_ci  ]
942d4d9a4dSopenharmony_ci
952d4d9a4dSopenharmony_ci  external_deps = [
962d4d9a4dSopenharmony_ci    "access_token:libaccesstoken_sdk",
972d4d9a4dSopenharmony_ci    "access_token:libnativetoken",
982d4d9a4dSopenharmony_ci    "access_token:libtoken_setproc",
992d4d9a4dSopenharmony_ci    "c_utils:utils",
1002d4d9a4dSopenharmony_ci    "config_policy:configpolicy_util",
1012d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:distributed_av_receiver",
1022d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:distributed_av_sender",
1032d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:distributedhardwareutils",
1042d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:libdhfwk_sdk",
1052d4d9a4dSopenharmony_ci    "dsoftbus:softbus_client",
1062d4d9a4dSopenharmony_ci    "eventhandler:libeventhandler",
1072d4d9a4dSopenharmony_ci    "graphic_surface:surface",
1082d4d9a4dSopenharmony_ci    "hicollie:libhicollie",
1092d4d9a4dSopenharmony_ci    "hilog:libhilog",
1102d4d9a4dSopenharmony_ci    "ipc:ipc_core",
1112d4d9a4dSopenharmony_ci    "json:nlohmann_json_static",
1122d4d9a4dSopenharmony_ci    "libevdev:libevdev",
1132d4d9a4dSopenharmony_ci    "openssl:libcrypto_shared",
1142d4d9a4dSopenharmony_ci    "safwk:system_ability_fwk",
1152d4d9a4dSopenharmony_ci    "samgr:samgr_proxy",
1162d4d9a4dSopenharmony_ci    "window_manager:libdm",
1172d4d9a4dSopenharmony_ci  ]
1182d4d9a4dSopenharmony_ci
1192d4d9a4dSopenharmony_ci  cflags_cc = [ "-DHILOG_ENABLE" ]
1202d4d9a4dSopenharmony_ci}
1212d4d9a4dSopenharmony_ci## UnitTest distributed_input_manager_service_test }}}
122