From ea7ca97cf2c0c3381408c0a640ae2f8b2cddffab Mon Sep 17 00:00:00 2001 From: pwx1285814 Date: Wed, 27 Mar 2024 18:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E4=BB=B6=E5=8C=96=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: pwx1285814 --- bundle.json | 7 ++- common/BUILD.gn | 4 +- distributedscreen.gni | 12 +---- .../innerkits/native_cpp/screen_sink/BUILD.gn | 6 +-- .../native_cpp/screen_source/BUILD.gn | 7 ++- .../handlerinitsink_fuzzer/BUILD.gn | 7 ++- .../BUILD.gn | 7 ++- .../BUILD.gn | 7 ++- .../BUILD.gn | 7 ++- .../proxyinitsink_fuzzer/BUILD.gn | 7 ++- .../BUILD.gn | 7 ++- .../BUILD.gn | 7 ++- .../sinkproxydscreennotify_fuzzer/BUILD.gn | 7 ++- .../callbackonnotifyregresult_fuzzer/BUILD.gn | 15 +++---- .../callbackonnotifyregresult_fuzzer.cpp | 6 +-- .../BUILD.gn | 15 +++---- .../callbackonnotifyunregresult_fuzzer.cpp | 6 +-- .../callbackonremoterequest_fuzzer/BUILD.gn | 13 ++---- .../BUILD.gn | 14 ++---- .../handlerinitsource_fuzzer/BUILD.gn | 14 ++---- .../BUILD.gn | 14 ++---- .../BUILD.gn | 15 +++---- .../registerdistributedhardware_fuzzer.cpp | 6 +-- .../BUILD.gn | 15 +++---- .../unregisterdistributedhardware_fuzzer.cpp | 6 +-- .../BUILD.gn | 14 ++---- .../proxydscreennotify_fuzzer/BUILD.gn | 14 ++---- .../proxyinitsource_fuzzer/BUILD.gn | 14 ++---- .../BUILD.gn | 14 ++---- .../BUILD.gn | 14 ++---- .../test/include/mock_component_disable.h | 44 +++++++++++++++++++ .../test/include/mock_component_enable.h | 44 +++++++++++++++++++ .../test/unittest/screensinktest/BUILD.gn | 8 +--- .../test/unittest/screensourcetest/BUILD.gn | 8 +--- screenhandler/BUILD.gn | 7 +-- .../fuzztest/pluginhardware_fuzzer/BUILD.gn | 18 +++----- .../registerpluginlistener_fuzzer/BUILD.gn | 18 +++----- .../registerpluginlistener_fuzzer.cpp | 16 +++++-- .../fuzztest/unpluginhardware_fuzzer/BUILD.gn | 18 +++----- .../test/unittest/screenhandler/BUILD.gn | 7 ++- .../common/test/unittest/databuffer/BUILD.gn | 10 ++--- services/common/test/unittest/utils/BUILD.gn | 10 +---- services/screenclient/BUILD.gn | 9 ++-- .../include/screen_client_window_adapter.h | 3 +- services/screenclient/test/unittest/BUILD.gn | 8 +--- services/screendemo/BUILD.gn | 4 +- services/screendemo/decoder_demo.cpp | 3 +- services/screendemo/decoder_demo.h | 2 +- services/screendemo/test.cpp | 3 +- services/screenservice/sinkservice/BUILD.gn | 8 +--- services/screenservice/sourceservice/BUILD.gn | 10 +---- .../dscreenmgr/onchange_fuzzer/BUILD.gn | 10 ++--- .../sinkservice/dscreenservice/BUILD.gn | 2 +- .../sinkservice/screenregionmgr/BUILD.gn | 9 +--- .../sourceservice/dscreenmgr/BUILD.gn | 10 +---- .../sourceservice/dscreenservice/BUILD.gn | 4 +- .../screentransport/screensinktrans/BUILD.gn | 17 +++---- .../screensourcetrans/BUILD.gn | 16 +++---- .../onbufferavailable_fuzzer/BUILD.gn | 4 +- .../onbufferavailable_fuzzer/BUILD.gn | 4 +- .../onerror_fuzzer/BUILD.gn | 4 +- .../oninputbufferavailable_fuzzer/BUILD.gn | 4 +- .../onoutputbufferavailable_fuzzer/BUILD.gn | 4 +- .../onoutputformatchanged_fuzzer/BUILD.gn | 4 +- .../test/unittest/screendatachannel/BUILD.gn | 7 ++- .../unittest/screensinkprocessor/BUILD.gn | 7 ++- .../test/unittest/screensinktrans/BUILD.gn | 7 ++- .../unittest/screensourceprocessor/BUILD.gn | 8 +--- .../test/unittest/screensourcetrans/BUILD.gn | 10 +---- .../unittest/screentranstestutils/BUILD.gn | 10 +---- .../softbusadapter/test/unittest/BUILD.gn | 8 +--- 71 files changed, 302 insertions(+), 406 deletions(-) create mode 100644 interfaces/innerkits/native_cpp/test/include/mock_component_disable.h create mode 100644 interfaces/innerkits/native_cpp/test/include/mock_component_enable.h diff --git a/bundle.json b/bundle.json index b52df091..9b9190cb 100644 --- a/bundle.json +++ b/bundle.json @@ -44,11 +44,10 @@ "hitrace", "c_utils", "window_manager", - "distributed_hardware_fwk" - ], - "third_party": [ + "distributed_hardware_fwk", "libjpeg-turbo" - ] + ], + "third_party": [] }, "build": { "sub_component": [ diff --git a/common/BUILD.gn b/common/BUILD.gn index de5326d3..e4a4ead8 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -29,7 +29,6 @@ ohos_shared_library("distributed_screen_utils") { include_dirs = [ "${services_path}/common/utils/include", "${common_path}/include", - "${fwk_common_path}/utils/include", ] sources = [ @@ -40,6 +39,7 @@ ohos_shared_library("distributed_screen_utils") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "hilog:libhilog", diff --git a/distributedscreen.gni b/distributedscreen.gni index e07b95e2..85655724 100644 --- a/distributedscreen.gni +++ b/distributedscreen.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -12,18 +12,8 @@ # limitations under the License. distributedscreen_path = "//foundation/distributedhardware/distributed_screen" -distributedhardwarefwk_path = - "//foundation/distributedhardware/distributed_hardware_fwk" fuzz_test_path = "distributed_screen/distributed_screen" -windowmanager_path = "//foundation/window/window_manager" -driver_path = "//drivers/peripheral/display" -ipc_path = "//foundation/communication/ipc" common_path = "${distributedscreen_path}/common" services_path = "${distributedscreen_path}/services" interfaces_path = "${distributedscreen_path}/interfaces" -fwk_utils_path = "${distributedhardwarefwk_path}/utils" -fwk_common_path = "${distributedhardwarefwk_path}/common" -fwk_services_path = "${distributedhardwarefwk_path}/services" -fwk_interfaces_path = "${distributedhardwarefwk_path}/interfaces" -ipc_interfaces_path = "${ipc_path}/interfaces" build_flags = [ "-Werror" ] diff --git a/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn b/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn index 2a524ff2..ac3d3454 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn +++ b/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -26,9 +26,8 @@ ohos_shared_library("distributed_screen_sink_sdk") { ubsan = true } branch_protector_ret = "pac_ret" - include_dirs = [ "${fwk_common_path}/utils/include" ] - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", @@ -50,6 +49,7 @@ ohos_shared_library("distributed_screen_sink_sdk") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "hitrace:hitrace_meter", "ipc:ipc_core", diff --git a/interfaces/innerkits/native_cpp/screen_source/BUILD.gn b/interfaces/innerkits/native_cpp/screen_source/BUILD.gn index e6f944ab..11cb59ba 100644 --- a/interfaces/innerkits/native_cpp/screen_source/BUILD.gn +++ b/interfaces/innerkits/native_cpp/screen_source/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -26,9 +26,7 @@ ohos_shared_library("distributed_screen_source_sdk") { ubsan = true } branch_protector_ret = "pac_ret" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", @@ -52,6 +50,7 @@ ohos_shared_library("distributed_screen_source_sdk") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "hitrace:hitrace_meter", "ipc:ipc_core", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerinitsink_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerinitsink_fuzzer/BUILD.gn index f2cce162..9cfab359 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerinitsink_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerinitsink_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("HandlerInitSinkFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerinitsink_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("HandlerInitSinkFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/BUILD.gn index 201e4881..4f6f8b86 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("HandlerOnRemoteSinkSvrDiedFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("HandlerOnRemoteSinkSvrDiedFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlersubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlersubscribelocalhardware_fuzzer/BUILD.gn index 6346a9a4..bae58298 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlersubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlersubscribelocalhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("HandlerSubscribeLocalHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlersubscribelocalhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("HandlerSubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerunsubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerunsubscribelocalhardware_fuzzer/BUILD.gn index cdbce480..371aa256 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerunsubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerunsubscribelocalhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("HandlerUnsubscribeLocalHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handlerunsubscribelocalhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("HandlerUnsubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/BUILD.gn index 5c4bbb5a..4179e98a 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("ProxyInitSinkFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("ProxyInitSinkFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/BUILD.gn index 40ae672d..ac317ba0 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("ProxySubscribeLocalHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("ProxySubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/BUILD.gn index 378428fa..63f57dca 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("ProxyUnsubscribeLocalHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("ProxyUnsubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/BUILD.gn index 2b67181e..b4f990aa 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,9 +23,7 @@ ohos_fuzztest("SinkProxyDScreenNotifyFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -50,6 +48,7 @@ ohos_fuzztest("SinkProxyDScreenNotifyFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/BUILD.gn index 0a85d4be..13d5eb32 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,13 @@ ohos_fuzztest("CallBackOnNotifyRegResultFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", + "${interfaces_path}/innerkits/native_cpp/test/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +41,7 @@ ohos_fuzztest("CallBackOnNotifyRegResultFuzzTest") { sources = [ "callbackonnotifyregresult_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +51,7 @@ ohos_fuzztest("CallBackOnNotifyRegResultFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/callbackonnotifyregresult_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/callbackonnotifyregresult_fuzzer.cpp index 03e3bb3b..6a82004b 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/callbackonnotifyregresult_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyregresult_fuzzer/callbackonnotifyregresult_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,7 @@ #include #include -#include "component_enable.h" +#include "mock_component_enable.h" #include "dscreen_constants.h" #include "dscreen_source_callback.h" #include "dscreen_source_proxy.h" @@ -37,7 +37,7 @@ void OnNotifyRegResultFuzzTest(const uint8_t* data, size_t size) std::string reqId(reinterpret_cast(data), size); int32_t status = *(reinterpret_cast(data)); std::string dataStr(reinterpret_cast(data), size); - std::shared_ptr callback = std::make_shared(); + std::shared_ptr callback = std::make_shared(); sptr dScreenSourceCallback(new (std::nothrow) DScreenSourceCallback()); dScreenSourceCallback->PushRegRegisterCallback(reqId, callback); diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/BUILD.gn index 03dcc430..8e641b4f 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,13 @@ ohos_fuzztest("CallBackOnNotifyUnregResultFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", + "${interfaces_path}/innerkits/native_cpp/test/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +41,7 @@ ohos_fuzztest("CallBackOnNotifyUnregResultFuzzTest") { sources = [ "callbackonnotifyunregresult_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +51,7 @@ ohos_fuzztest("CallBackOnNotifyUnregResultFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/callbackonnotifyunregresult_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/callbackonnotifyunregresult_fuzzer.cpp index 7fe04bcd..5a20c204 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/callbackonnotifyunregresult_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonnotifyunregresult_fuzzer/callbackonnotifyunregresult_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,7 @@ #include #include -#include "component_disable.h" +#include "mock_component_disable.h" #include "dscreen_constants.h" #include "dscreen_source_callback.h" #include "dscreen_source_proxy.h" @@ -37,7 +37,7 @@ void OnNotifyUnregResultFuzzTest(const uint8_t* data, size_t size) std::string reqId(reinterpret_cast(data), size); int32_t status = *(reinterpret_cast(data)); std::string dataStr(reinterpret_cast(data), size); - std::shared_ptr uncallback = std::make_shared(); + std::shared_ptr uncallback = std::make_shared(); sptr dScreenSourceCallback(new (std::nothrow) DScreenSourceCallback()); diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonremoterequest_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonremoterequest_fuzzer/BUILD.gn index 45da2fdd..fa7fe27a 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonremoterequest_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonremoterequest_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,15 +23,12 @@ ohos_fuzztest("CallbackOnRemoteRequestFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_callback/callbackonremoterequest_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", ] cflags = [ @@ -43,10 +40,7 @@ ohos_fuzztest("CallbackOnRemoteRequestFuzzTest") { sources = [ "callbackonremoterequest_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -56,6 +50,7 @@ ohos_fuzztest("CallbackOnRemoteRequestFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerconfigdistributedhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerconfigdistributedhardware_fuzzer/BUILD.gn index 6965fef4..1ee23f19 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerconfigdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerconfigdistributedhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("HandlerConfigDistributedHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerconfigdistributedhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("HandlerConfigDistributedHardwareFuzzTest") { sources = [ "configdistributedhardware_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("HandlerConfigDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerinitsource_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerinitsource_fuzzer/BUILD.gn index 5c691f36..39e2de0e 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerinitsource_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerinitsource_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("HandlerInitSourceFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerinitsource_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("HandlerInitSourceFuzzTest") { sources = [ "initsource_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("HandlerInitSourceFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handleronremotesourcesvrdied_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handleronremotesourcesvrdied_fuzzer/BUILD.gn index a0967215..0b1dc166 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handleronremotesourcesvrdied_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handleronremotesourcesvrdied_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("HandlerOnRemoteSourceSvrDiedFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handleronremotesourcesvrdied_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("HandlerOnRemoteSourceSvrDiedFuzzTest") { sources = [ "onremotesourcesvrdied_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("HandlerOnRemoteSourceSvrDiedFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/BUILD.gn index 75d2037c..2a1d1f64 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,13 @@ ohos_fuzztest("HandlerRegisterDistributedHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", + "${interfaces_path}/innerkits/native_cpp/test/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +41,7 @@ ohos_fuzztest("HandlerRegisterDistributedHardwareFuzzTest") { sources = [ "registerdistributedhardware_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +51,7 @@ ohos_fuzztest("HandlerRegisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/registerdistributedhardware_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/registerdistributedhardware_fuzzer.cpp index 0f9d90f8..9b0f3cdb 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/registerdistributedhardware_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerregisterdistributedhardware_fuzzer/registerdistributedhardware_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +18,7 @@ #include #include -#include "component_enable.h" +#include "mock_component_enable.h" #include "dscreen_source_handler.h" namespace OHOS { @@ -36,7 +36,7 @@ void RegisterDistributedHardwareFuzzTest(const uint8_t* data, size_t size) EnableParam param; param.sinkVersion = version; param.sinkAttrs = attrs; - std::shared_ptr callback = std::make_shared(); + std::shared_ptr callback = std::make_shared(); DScreenSourceHandler::GetInstance().RegisterDistributedHardware(devId, dhId, param, callback); } diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/BUILD.gn index e08eb08f..a593be88 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,13 @@ ohos_fuzztest("HandlerUnregisterDistributedHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", + "${interfaces_path}/innerkits/native_cpp/test/include", ] cflags = [ @@ -44,10 +41,7 @@ ohos_fuzztest("HandlerUnregisterDistributedHardwareFuzzTest") { sources = [ "unregisterdistributedhardware_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +51,7 @@ ohos_fuzztest("HandlerUnregisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", ] diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/unregisterdistributedhardware_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/unregisterdistributedhardware_fuzzer.cpp index 7612e70b..f0b316a4 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/unregisterdistributedhardware_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_handler/handlerunregisterdistributedhardware_fuzzer/unregisterdistributedhardware_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +18,7 @@ #include #include -#include "component_disable.h" +#include "mock_component_disable.h" #include "dscreen_source_handler.h" namespace OHOS { @@ -31,7 +31,7 @@ void UnregisterDistributedHardwareFuzzTest(const uint8_t* data, size_t size) std::string devId(reinterpret_cast(data), size); std::string dhId(reinterpret_cast(data), size); - std::shared_ptr uncallback = std::make_shared(); + std::shared_ptr uncallback = std::make_shared(); DScreenSourceHandler::GetInstance().UnregisterDistributedHardware(devId, dhId, uncallback); } diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyconfigdistributedhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyconfigdistributedhardware_fuzzer/BUILD.gn index 88eb50bf..c3368602 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyconfigdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyconfigdistributedhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("ProxyConfigDistributedHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyconfigdistributedhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("ProxyConfigDistributedHardwareFuzzTest") { sources = [ "configdistributedhardware_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("ProxyConfigDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxydscreennotify_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxydscreennotify_fuzzer/BUILD.gn index 52adec80..cf704a15 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxydscreennotify_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxydscreennotify_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("ProxyDScreenNotifyFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxydscreennotify_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("ProxyDScreenNotifyFuzzTest") { sources = [ "dscreennotify_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("ProxyDScreenNotifyFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyinitsource_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyinitsource_fuzzer/BUILD.gn index 89a05f3a..4d38b33d 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyinitsource_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyinitsource_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("ProxyInitSourceFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyinitsource_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("ProxyInitSourceFuzzTest") { sources = [ "initsource_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("ProxyInitSourceFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyregisterdistributedhardware_fuzzer/BUILD.gn index 494b4a2d..9eebc5ca 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyregisterdistributedhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("ProxyRegisterDistributedHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyregisterdistributedhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("ProxyRegisterDistributedHardwareFuzzTest") { sources = [ "registerdistributedhardware_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("ProxyRegisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyunregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyunregisterdistributedhardware_fuzzer/BUILD.gn index 54c4c18d..32078c41 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyunregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyunregisterdistributedhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,16 +23,12 @@ ohos_fuzztest("ProxyUnregisterDistributedHardwareFuzzTest") { fuzz_config_file = "${interfaces_path}/innerkits/native_cpp/test/fuzztest/dscreen_source_proxy/proxyunregisterdistributedhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] cflags = [ @@ -44,10 +40,7 @@ ohos_fuzztest("ProxyUnregisterDistributedHardwareFuzzTest") { sources = [ "unregisterdistributedhardware_fuzzer.cpp" ] - deps = [ - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk", - ] + deps = [ "${interfaces_path}/innerkits/native_cpp/screen_source:distributed_screen_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -57,6 +50,7 @@ ohos_fuzztest("ProxyUnregisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/innerkits/native_cpp/test/include/mock_component_disable.h b/interfaces/innerkits/native_cpp/test/include/mock_component_disable.h new file mode 100644 index 00000000..747d579a --- /dev/null +++ b/interfaces/innerkits/native_cpp/test/include/mock_component_disable.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DSCREEN_MOCK_COMPONENT_DISABLE_H +#define OHOS_DSCREEN_MOCK_COMPONENT_DISABLE_H + +#include "dscreen_errcode.h" +#include "idistributed_hardware_source.h" + +namespace OHOS { +namespace DistributedHardware { +class MockComponentDisable : public std::enable_shared_from_this, public UnregisterCallback { +public: + MockComponentDisable() {} + + virtual ~MockComponentDisable() {} + + int32_t Disable(const std::string &networkId, const std::string &dhId, + IDistributedHardwareSource *handler) + { + return DH_SUCCESS; + } + + int32_t OnUnregisterResult(const std::string &networkId, const std::string &dhId, int32_t status, + const std::string &data) override + { + return DH_SUCCESS; + } +}; +} // namespace DistributedHardware +} // namespace OHOS +#endif diff --git a/interfaces/innerkits/native_cpp/test/include/mock_component_enable.h b/interfaces/innerkits/native_cpp/test/include/mock_component_enable.h new file mode 100644 index 00000000..f5e40618 --- /dev/null +++ b/interfaces/innerkits/native_cpp/test/include/mock_component_enable.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DSCREEN_MOCK_COMPONENT_ENABLE_H +#define OHOS_DSCREEN_MOCK_COMPONENT_ENABLE_H + +#include "dscreen_errcode.h" +#include "idistributed_hardware_source.h" + +namespace OHOS { +namespace DistributedHardware { +class MockComponentEnable : public std::enable_shared_from_this, public RegisterCallback { +public: + explicit MockComponentEnable() {} + + virtual ~MockComponentEnable() {} + + int32_t Enable(const std::string &uuid, const std::string &dhId, const EnableParam ¶m, + IDistributedHardwareSource *handler) + { + return DH_SUCCESS; + } + + int32_t OnRegisterResult(const std::string &uuid, const std::string &dhId, int32_t status, + const std::string &data) override + { + return DH_SUCCESS; + } +}; +} // namespace DistributedHardware +} // namespace OHOS +#endif diff --git a/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn b/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn index 125ae41a..21ec9a19 100644 --- a/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,11 +20,6 @@ module_out_path = "distributed_screen/source_trans_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include", - ] - - include_dirs += [ "./include", "${services_path}/screentransport/test/unittest/screentranstestutils/include", "${common_path}/include", @@ -58,6 +53,7 @@ ohos_unittest("ScreenSinkTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn b/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn index b40974ee..64cf1f3e 100644 --- a/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,11 +20,6 @@ module_out_path = "distributed_screen/source_trans_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include", - ] - - include_dirs += [ "./include", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", @@ -62,6 +57,7 @@ ohos_unittest("ScreenSourceTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/screenhandler/BUILD.gn b/screenhandler/BUILD.gn index 7784a76f..290fc78e 100644 --- a/screenhandler/BUILD.gn +++ b/screenhandler/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -27,11 +27,6 @@ ohos_shared_library("distributed_screen_handler") { } branch_protector_ret = "pac_ret" include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include", - ] - - include_dirs += [ "include", "${common_path}/include", ] diff --git a/screenhandler/test/fuzztest/pluginhardware_fuzzer/BUILD.gn b/screenhandler/test/fuzztest/pluginhardware_fuzzer/BUILD.gn index 82258b41..ec137a6c 100644 --- a/screenhandler/test/fuzztest/pluginhardware_fuzzer/BUILD.gn +++ b/screenhandler/test/fuzztest/pluginhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,14 +23,10 @@ ohos_fuzztest("PluginHardwareFuzzTest") { fuzz_config_file = "${distributedscreen_path}/screenhandler/test/fuzztest/pluginhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${distributedscreen_path}/screenhandler/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/localhardwaremanager", - "${fwk_common_path}/utils/include", ] cflags = [ @@ -42,10 +38,8 @@ ohos_fuzztest("PluginHardwareFuzzTest") { sources = [ "pluginhardware_fuzzer.cpp" ] - deps = [ - "${distributedscreen_path}/screenhandler:distributed_screen_handler", - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - ] + deps = + [ "${distributedscreen_path}/screenhandler:distributed_screen_handler" ] defines = [ "HI_LOG_ENABLE", @@ -55,6 +49,7 @@ ohos_fuzztest("PluginHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:libgraphic_utils", "graphic_surface:surface", "hilog:libhilog", @@ -66,7 +61,6 @@ ohos_fuzztest("PluginHardwareFuzzTest") { ############################################################################### group("fuzztest") { testonly = true - deps = [] - deps += [ ":PluginHardwareFuzzTest" ] + deps = [ ":PluginHardwareFuzzTest" ] } ############################################################################### diff --git a/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/BUILD.gn b/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/BUILD.gn index 67fe3ade..4b679f27 100644 --- a/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/BUILD.gn +++ b/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,14 +23,10 @@ ohos_fuzztest("RegisterPluginListenerFuzzTest") { fuzz_config_file = "${distributedscreen_path}/screenhandler/test/fuzztest/registerpluginlistener_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${distributedscreen_path}/screenhandler/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/localhardwaremanager", - "${fwk_common_path}/utils/include", ] cflags = [ @@ -42,10 +38,8 @@ ohos_fuzztest("RegisterPluginListenerFuzzTest") { sources = [ "registerpluginlistener_fuzzer.cpp" ] - deps = [ - "${distributedscreen_path}/screenhandler:distributed_screen_handler", - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - ] + deps = + [ "${distributedscreen_path}/screenhandler:distributed_screen_handler" ] defines = [ "HI_LOG_ENABLE", @@ -55,6 +49,7 @@ ohos_fuzztest("RegisterPluginListenerFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:libgraphic_utils", "graphic_surface:surface", "hilog:libhilog", @@ -66,7 +61,6 @@ ohos_fuzztest("RegisterPluginListenerFuzzTest") { ############################################################################### group("fuzztest") { testonly = true - deps = [] - deps += [ ":RegisterPluginListenerFuzzTest" ] + deps = [ ":RegisterPluginListenerFuzzTest" ] } ############################################################################### diff --git a/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/registerpluginlistener_fuzzer.cpp b/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/registerpluginlistener_fuzzer.cpp index b807086d..989023ad 100644 --- a/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/registerpluginlistener_fuzzer.cpp +++ b/screenhandler/test/fuzztest/registerpluginlistener_fuzzer/registerpluginlistener_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,10 +20,20 @@ #include "dscreen_handler.h" #include "device_type.h" -#include "plugin_listener_impl.h" +#include "ihardware_handler.h" namespace OHOS { namespace DistributedHardware { +class DScreenHandlerFuzzTestPluginListener : public PluginListener { +public: + explicit DScreenHandlerFuzzTestPluginListener(const DHType type) {} + virtual ~DScreenHandlerFuzzTestPluginListener() = default; + + void PluginHardware(const std::string &dhId, const std::string &attrs, const std::string &subtype) override {} + + void UnPluginHardware(const std::string &dhId) override {} +}; + void RegisterPluginListenerFuzzTest(const uint8_t* data, size_t size) { if ((data == nullptr) || (size == 0)) { @@ -31,7 +41,7 @@ void RegisterPluginListenerFuzzTest(const uint8_t* data, size_t size) } DHType dhType = DHType::SCREEN; - std::shared_ptr listener = std::make_shared(dhType); + std::shared_ptr listener = std::make_shared(dhType); DScreenHandler::GetInstance().RegisterPluginListener(listener); } diff --git a/screenhandler/test/fuzztest/unpluginhardware_fuzzer/BUILD.gn b/screenhandler/test/fuzztest/unpluginhardware_fuzzer/BUILD.gn index 972dd2a9..2f071618 100644 --- a/screenhandler/test/fuzztest/unpluginhardware_fuzzer/BUILD.gn +++ b/screenhandler/test/fuzztest/unpluginhardware_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,14 +23,10 @@ ohos_fuzztest("UnPluginHardwareFuzzTest") { fuzz_config_file = "${distributedscreen_path}/screenhandler/test/fuzztest/unpluginhardware_fuzzer" - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${distributedscreen_path}/screenhandler/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/localhardwaremanager", - "${fwk_common_path}/utils/include", ] cflags = [ @@ -42,10 +38,8 @@ ohos_fuzztest("UnPluginHardwareFuzzTest") { sources = [ "unpluginhardware_fuzzer.cpp" ] - deps = [ - "${distributedscreen_path}/screenhandler:distributed_screen_handler", - "${fwk_services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr", - ] + deps = + [ "${distributedscreen_path}/screenhandler:distributed_screen_handler" ] defines = [ "HI_LOG_ENABLE", @@ -55,6 +49,7 @@ ohos_fuzztest("UnPluginHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:libgraphic_utils", "graphic_surface:surface", "hilog:libhilog", @@ -66,7 +61,6 @@ ohos_fuzztest("UnPluginHardwareFuzzTest") { ############################################################################### group("fuzztest") { testonly = true - deps = [] - deps += [ ":UnPluginHardwareFuzzTest" ] + deps = [ ":UnPluginHardwareFuzzTest" ] } ############################################################################### diff --git a/screenhandler/test/unittest/screenhandler/BUILD.gn b/screenhandler/test/unittest/screenhandler/BUILD.gn index 7035f6e3..246d2edd 100644 --- a/screenhandler/test/unittest/screenhandler/BUILD.gn +++ b/screenhandler/test/unittest/screenhandler/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -19,9 +19,7 @@ module_out_path = "distributed_screen/dscreen_handler_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "./include", "${common_path}/include", "${distributedscreen_path}/screenhandler/include", @@ -50,6 +48,7 @@ ohos_unittest("DscreenHandlerTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:libgraphic_utils", "graphic_surface:surface", "hilog:libhilog", diff --git a/services/common/test/unittest/databuffer/BUILD.gn b/services/common/test/unittest/databuffer/BUILD.gn index 36707184..4ca0bf54 100644 --- a/services/common/test/unittest/databuffer/BUILD.gn +++ b/services/common/test/unittest/databuffer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -21,12 +21,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_common_path}/log/include", - "${fwk_utils_path}/include/log", - ] - - include_dirs += [ "include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -54,6 +48,8 @@ ohos_unittest("DataBufferTest") { "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] + + external_deps = [ "distributed_hardware_fwk:distributedhardwareutils" ] } group("data_buffer_test") { diff --git a/services/common/test/unittest/utils/BUILD.gn b/services/common/test/unittest/utils/BUILD.gn index 8ceb15fa..cd895f74 100644 --- a/services/common/test/unittest/utils/BUILD.gn +++ b/services/common/test/unittest/utils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -21,13 +21,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_common_path}/log/include", - "${fwk_utils_path}/include/log", - "${fwk_interfaces_path}/inner_kits/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -61,6 +54,7 @@ ohos_unittest("UtilsTest") { external_deps = [ "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", ] } diff --git a/services/screenclient/BUILD.gn b/services/screenclient/BUILD.gn index bf4554c4..0e526bee 100644 --- a/services/screenclient/BUILD.gn +++ b/services/screenclient/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -26,12 +26,8 @@ ohos_shared_library("distributed_screen_client") { ubsan = true } branch_protector_ret = "pac_ret" - include_dirs = [ - "${windowmanager_path}/interfaces/innerkits/wm", - "${fwk_common_path}/utils/include", - ] - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", ] @@ -51,6 +47,7 @@ ohos_shared_library("distributed_screen_client") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:libgraphic_utils", "graphic_2d:librender_service_client", "graphic_surface:surface", diff --git a/services/screenclient/include/screen_client_window_adapter.h b/services/screenclient/include/screen_client_window_adapter.h index 3cef7730..8c8b7729 100644 --- a/services/screenclient/include/screen_client_window_adapter.h +++ b/services/screenclient/include/screen_client_window_adapter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -28,6 +28,7 @@ #include "single_instance.h" #include "surface.h" #include "window.h" +#include "window_scene.h" #include "screen_client.h" #include "screen_client_common.h" diff --git a/services/screenclient/test/unittest/BUILD.gn b/services/screenclient/test/unittest/BUILD.gn index 9b85c343..d46c5a7e 100644 --- a/services/screenclient/test/unittest/BUILD.gn +++ b/services/screenclient/test/unittest/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -19,11 +19,6 @@ module_out_path = "distributed_screen/screen_client_test" config("module_private_config") { include_dirs = [ - "${windowmanager_path}/interfaces/innerkits/wm", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${services_path}/screenclient/include", @@ -56,6 +51,7 @@ ohos_unittest("ScreenClientTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:librender_service_client", "graphic_surface:surface", "input:libmmi-client", diff --git a/services/screendemo/BUILD.gn b/services/screendemo/BUILD.gn index bb30baf2..d612f2be 100644 --- a/services/screendemo/BUILD.gn +++ b/services/screendemo/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -28,7 +28,6 @@ ohos_executable("distributedScreenTest") { "${interfaces_path}/innerkits/native_cpp/screen_sink/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", - "${fwk_common_path}/utils/include", "${services_path}/screenclient/include", "${common_path}/include", ] @@ -57,6 +56,7 @@ ohos_executable("distributedScreenTest") { "access_token:libtoken_setproc", "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", "graphic_2d:librender_service_client", "graphic_surface:surface", diff --git a/services/screendemo/decoder_demo.cpp b/services/screendemo/decoder_demo.cpp index 49eb418a..cb5b74a2 100644 --- a/services/screendemo/decoder_demo.cpp +++ b/services/screendemo/decoder_demo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Huawei Device Co., Ltd. + * Copyright (C) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -22,6 +22,7 @@ #include "securec.h" #include "wm_common.h" #include "window.h" +#include "window_scene.h" #include "window_option.h" static const int32_t ES_R[325] = { diff --git a/services/screendemo/decoder_demo.h b/services/screendemo/decoder_demo.h index 6a74ec45..f178195c 100644 --- a/services/screendemo/decoder_demo.h +++ b/services/screendemo/decoder_demo.h @@ -92,6 +92,6 @@ private: uint32_t frameCount_ = 0; uint32_t defaultFrameCount_ = 0; }; -} // namespace Media +} // namespace MediaAVCodec } // namespace OHOS #endif // AVCODEC_VDEC_DEMO_H \ No newline at end of file diff --git a/services/screendemo/test.cpp b/services/screendemo/test.cpp index 78bedb1e..64676981 100644 --- a/services/screendemo/test.cpp +++ b/services/screendemo/test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -29,6 +29,7 @@ #include "screen_manager.h" #include "wm_common.h" #include "window.h" +#include "window_scene.h" #include "window_option.h" #include "nativetoken_kit.h" #include "token_setproc.h" diff --git a/services/screenservice/sinkservice/BUILD.gn b/services/screenservice/sinkservice/BUILD.gn index 11e3891e..3dfa9c08 100644 --- a/services/screenservice/sinkservice/BUILD.gn +++ b/services/screenservice/sinkservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -27,11 +27,6 @@ ohos_shared_library("distributed_screen_sink") { } branch_protector_ret = "pac_ret" include_dirs = [ - "${fwk_common_path}/utils/include", - "${distributedhardwarefwk_path}/interfaces/inner_kits/include", - ] - - include_dirs += [ "./dscreenservice/include", "${services_path}/screenservice/sinkservice/screenregionmgr", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -86,6 +81,7 @@ ohos_shared_library("distributed_screen_sink") { "av_codec:av_codec_client", "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_2d:libgraphic_utils", "graphic_2d:librender_service_client", diff --git a/services/screenservice/sourceservice/BUILD.gn b/services/screenservice/sourceservice/BUILD.gn index 0882306c..c07ad192 100644 --- a/services/screenservice/sourceservice/BUILD.gn +++ b/services/screenservice/sourceservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -27,13 +27,6 @@ ohos_shared_library("distributed_screen_source") { } branch_protector_ret = "pac_ret" include_dirs = [ - "//third_party/libjpeg-turbo", - "${distributedhardwarefwk_path}/interfaces/inner_kits/include", - "${distributedhardwarefwk_path}/utils/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "./dscreenservice/include", "./dscreenservice/include/callback", "${services_path}/screenservice/sourceservice/dscreenmgr", @@ -102,6 +95,7 @@ ohos_shared_library("distributed_screen_source") { "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", + "libjpeg-turbo:turbojpeg", "media_foundation:media_foundation", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/services/screenservice/test/fuzztest/sourceservice/dscreenmgr/onchange_fuzzer/BUILD.gn b/services/screenservice/test/fuzztest/sourceservice/dscreenmgr/onchange_fuzzer/BUILD.gn index 52370464..e7eaffc6 100644 --- a/services/screenservice/test/fuzztest/sourceservice/dscreenmgr/onchange_fuzzer/BUILD.gn +++ b/services/screenservice/test/fuzztest/sourceservice/dscreenmgr/onchange_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -23,12 +23,6 @@ ohos_fuzztest("OnChangeFuzzTest") { fuzz_config_file = "${services_path}/screenservice/test/fuzztest/sourceservice/dscreenmgr/onchange_fuzzer" include_dirs = [ - "${distributedhardwarefwk_path}/interfaces/inner_kits/include", - "${fwk_common_path}/utils/include", - "${windowmanager_path}/interfaces/innerkits/wm", - ] - - include_dirs += [ "./dscreenservice/include/callback", "${common_path}/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", @@ -62,6 +56,8 @@ ohos_fuzztest("OnChangeFuzzTest") { external_deps = [ "c_utils:utils", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "distributed_hardware_fwk:libdhfwk_sdk", "graphic_2d:librender_service_client", "graphic_surface:surface", "hilog:libhilog", diff --git a/services/screenservice/test/unittest/sinkservice/dscreenservice/BUILD.gn b/services/screenservice/test/unittest/sinkservice/dscreenservice/BUILD.gn index 8addd2b6..aa2bd625 100644 --- a/services/screenservice/test/unittest/sinkservice/dscreenservice/BUILD.gn +++ b/services/screenservice/test/unittest/sinkservice/dscreenservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/screenservice/test/unittest/sinkservice/screenregionmgr/BUILD.gn b/services/screenservice/test/unittest/sinkservice/screenregionmgr/BUILD.gn index e7577185..59b6980d 100644 --- a/services/screenservice/test/unittest/sinkservice/screenregionmgr/BUILD.gn +++ b/services/screenservice/test/unittest/sinkservice/screenregionmgr/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,12 +20,6 @@ module_out_path = "distributed_screen/dscreen_sink_service_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${distributedhardwarefwk_path}/interfaces/inner_kits/include", - "${distributedhardwarefwk_path}/utils/include", - ] - - include_dirs += [ "./include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include", "${interfaces_path}/innerkits/native_cpp/screen_sink/include/callback", @@ -79,6 +73,7 @@ ohos_unittest("DscreenRegionMgrTest") { "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributedhardwareutils", + "distributed_hardware_fwk:libdhfwk_sdk", "graphic_2d:libcomposer", "graphic_2d:libgraphic_utils", "graphic_2d:librender_service_client", diff --git a/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn b/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn index 328350ce..0d990214 100644 --- a/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn +++ b/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,14 +20,6 @@ module_out_path = "distributed_screen/DscreenMgrTest" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${driver_path}/interfaces/include", - "${distributedhardwarefwk_path}/interfaces/inner_kits/include", - "${distributedhardwarefwk_path}/common/utils/include", - "${distributedhardwarefwk_path}/utils/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "./include", "${common_path}/include", "${distributedscreen_path}/interfaces/innerkits/native_cpp/screen_sink/include", diff --git a/services/screenservice/test/unittest/sourceservice/dscreenservice/BUILD.gn b/services/screenservice/test/unittest/sourceservice/dscreenservice/BUILD.gn index 076e597b..b03cc16b 100644 --- a/services/screenservice/test/unittest/sourceservice/dscreenservice/BUILD.gn +++ b/services/screenservice/test/unittest/sourceservice/dscreenservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -25,7 +25,6 @@ config("module_private_config") { "${interfaces_path}/innerkits/native_cpp/screen_source/include", "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback", "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/screenservice/sourceservice/dscreenservice/include", "${services_path}/screenservice/sourceservice/dscreenservice/include/callback", ] @@ -56,6 +55,7 @@ ohos_unittest("DScreenSourceStubTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/screentransport/screensinktrans/BUILD.gn b/services/screentransport/screensinktrans/BUILD.gn index 691e644c..0c33a825 100644 --- a/services/screentransport/screensinktrans/BUILD.gn +++ b/services/screentransport/screensinktrans/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -26,14 +26,8 @@ ohos_shared_library("distributed_screen_sinktrans") { ubsan = true } branch_protector_ret = "pac_ret" - include_dirs = [ - "//third_party/libjpeg", - "${fwk_common_path}/utils/include", - "${fwk_interfaces_path}/inner_kits/include", - "${services_path}/common/utils/include", - ] - include_dirs += [ + include_dirs = [ "./include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -62,10 +56,7 @@ ohos_shared_library("distributed_screen_sinktrans") { "./src/screen_sink_trans.cpp", ] - deps = [ - "${common_path}:distributed_screen_utils", - "//third_party/libjpeg-turbo:turbojpeg_static", - ] + deps = [ "${common_path}:distributed_screen_utils" ] defines = [ "HI_LOG_ENABLE", @@ -77,12 +68,14 @@ ohos_shared_library("distributed_screen_sinktrans") { "av_codec:av_codec_client", "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "graphic_surface:surface", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", + "libjpeg-turbo:turbojpeg", "media_foundation:media_foundation", ] diff --git a/services/screentransport/screensourcetrans/BUILD.gn b/services/screentransport/screensourcetrans/BUILD.gn index b58c6723..c9ba06e4 100644 --- a/services/screentransport/screensourcetrans/BUILD.gn +++ b/services/screentransport/screensourcetrans/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -26,14 +26,9 @@ ohos_shared_library("distributed_screen_sourcetrans") { ubsan = true } branch_protector_ret = "pac_ret" + include_dirs = [ - "//third_party/libjpeg-turbo", - "${fwk_common_path}/utils/include", - "${fwk_interfaces_path}/inner_kits/include", "${services_path}/common/utils/include", - ] - - include_dirs += [ "./include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -61,10 +56,7 @@ ohos_shared_library("distributed_screen_sourcetrans") { "./src/screen_source_trans.cpp", ] - deps = [ - "${common_path}:distributed_screen_utils", - "//third_party/libjpeg-turbo:turbojpeg_static", - ] + deps = [ "${common_path}:distributed_screen_utils" ] defines = [ "HI_LOG_ENABLE", @@ -76,6 +68,7 @@ ohos_shared_library("distributed_screen_sourcetrans") { "av_codec:av_codec_client", "c_utils:utils", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "graphic_surface:surface", @@ -83,6 +76,7 @@ ohos_shared_library("distributed_screen_sourcetrans") { "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", + "libjpeg-turbo:turbojpeg", "media_foundation:media_foundation", ] diff --git a/services/screentransport/test/fuzztest/screensinkprocessor/onbufferavailable_fuzzer/BUILD.gn b/services/screentransport/test/fuzztest/screensinkprocessor/onbufferavailable_fuzzer/BUILD.gn index b534a8db..270aa094 100644 --- a/services/screentransport/test/fuzztest/screensinkprocessor/onbufferavailable_fuzzer/BUILD.gn +++ b/services/screentransport/test/fuzztest/screensinkprocessor/onbufferavailable_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -24,7 +24,6 @@ ohos_fuzztest("OnBufferAvailableFuzzTest") { include_dirs = [ "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/databuffer/include", "${services_path}/common/decision_center/include", "${services_path}/common/imageJpeg/include", @@ -63,6 +62,7 @@ ohos_fuzztest("OnBufferAvailableFuzzTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/screentransport/test/fuzztest/screensourceprocessor/onbufferavailable_fuzzer/BUILD.gn b/services/screentransport/test/fuzztest/screensourceprocessor/onbufferavailable_fuzzer/BUILD.gn index 50a341f4..a18bbd46 100644 --- a/services/screentransport/test/fuzztest/screensourceprocessor/onbufferavailable_fuzzer/BUILD.gn +++ b/services/screentransport/test/fuzztest/screensourceprocessor/onbufferavailable_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -24,7 +24,6 @@ ohos_fuzztest("OnBufferAvailableFuzzTest") { include_dirs = [ "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/databuffer/include", "${services_path}/common/decision_center/include", "${services_path}/common/imageJpeg/include", @@ -63,6 +62,7 @@ ohos_fuzztest("OnBufferAvailableFuzzTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/screentransport/test/fuzztest/screensourceprocessor/onerror_fuzzer/BUILD.gn b/services/screentransport/test/fuzztest/screensourceprocessor/onerror_fuzzer/BUILD.gn index b08e2d4e..46fe25fa 100644 --- a/services/screentransport/test/fuzztest/screensourceprocessor/onerror_fuzzer/BUILD.gn +++ b/services/screentransport/test/fuzztest/screensourceprocessor/onerror_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -31,7 +31,6 @@ ohos_fuzztest("OnErrorFuzzTest") { include_dirs = [ "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/databuffer/include", "${services_path}/common/decision_center/include", "${services_path}/common/imageJpeg/include", @@ -55,6 +54,7 @@ ohos_fuzztest("OnErrorFuzzTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/screentransport/test/fuzztest/screensourceprocessor/oninputbufferavailable_fuzzer/BUILD.gn b/services/screentransport/test/fuzztest/screensourceprocessor/oninputbufferavailable_fuzzer/BUILD.gn index f2766772..7c13758b 100644 --- a/services/screentransport/test/fuzztest/screensourceprocessor/oninputbufferavailable_fuzzer/BUILD.gn +++ b/services/screentransport/test/fuzztest/screensourceprocessor/oninputbufferavailable_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -31,7 +31,6 @@ ohos_fuzztest("OnInputBufferAvailableFuzzTest") { include_dirs = [ "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/databuffer/include", "${services_path}/common/decision_center/include", "${services_path}/common/imageJpeg/include", @@ -55,6 +54,7 @@ ohos_fuzztest("OnInputBufferAvailableFuzzTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/screentransport/test/fuzztest/screensourceprocessor/onoutputbufferavailable_fuzzer/BUILD.gn b/services/screentransport/test/fuzztest/screensourceprocessor/onoutputbufferavailable_fuzzer/BUILD.gn index 62f428be..fe7715a5 100644 --- a/services/screentransport/test/fuzztest/screensourceprocessor/onoutputbufferavailable_fuzzer/BUILD.gn +++ b/services/screentransport/test/fuzztest/screensourceprocessor/onoutputbufferavailable_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -32,7 +32,6 @@ ohos_fuzztest("OnOutputBufferAvailableFuzzTest") { include_dirs = [ "${services_path}/screentransport/test/unittest/screentranstestutils/include", "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/databuffer/include", "${services_path}/common/decision_center/include", "${services_path}/common/imageJpeg/include", @@ -56,6 +55,7 @@ ohos_fuzztest("OnOutputBufferAvailableFuzzTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/screentransport/test/fuzztest/screensourceprocessor/onoutputformatchanged_fuzzer/BUILD.gn b/services/screentransport/test/fuzztest/screensourceprocessor/onoutputformatchanged_fuzzer/BUILD.gn index bba65961..ed51e86a 100644 --- a/services/screentransport/test/fuzztest/screensourceprocessor/onoutputformatchanged_fuzzer/BUILD.gn +++ b/services/screentransport/test/fuzztest/screensourceprocessor/onoutputformatchanged_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -31,7 +31,6 @@ ohos_fuzztest("OnOutputFormatChangedFuzzTest") { include_dirs = [ "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/databuffer/include", "${services_path}/common/decision_center/include", "${services_path}/common/imageJpeg/include", @@ -55,6 +54,7 @@ ohos_fuzztest("OnOutputFormatChangedFuzzTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "distributed_hardware_fwk:libdhfwk_sdk", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/screentransport/test/unittest/screendatachannel/BUILD.gn b/services/screentransport/test/unittest/screendatachannel/BUILD.gn index 6f1c9c3a..0fc6328b 100644 --- a/services/screentransport/test/unittest/screendatachannel/BUILD.gn +++ b/services/screentransport/test/unittest/screendatachannel/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -19,9 +19,7 @@ module_out_path = "distributed_screen/data_channel_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "./include", "${services_path}/screentransport/test/unittest/screentranstestutils/include", "${common_path}/include", @@ -62,6 +60,7 @@ ohos_unittest("DataChannelTest") { "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", "hilog:libhilog", ] diff --git a/services/screentransport/test/unittest/screensinkprocessor/BUILD.gn b/services/screentransport/test/unittest/screensinkprocessor/BUILD.gn index e59428b7..16f674f3 100644 --- a/services/screentransport/test/unittest/screensinkprocessor/BUILD.gn +++ b/services/screentransport/test/unittest/screensinkprocessor/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -21,9 +21,7 @@ module_out_path = "distributed_screen/sink_processor_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "./include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -66,6 +64,7 @@ ohos_unittest("SinkProcessorTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_surface:surface", "hilog:libhilog", "media_foundation:media_foundation", diff --git a/services/screentransport/test/unittest/screensinktrans/BUILD.gn b/services/screentransport/test/unittest/screensinktrans/BUILD.gn index 8ca83c99..7d1f0bb7 100644 --- a/services/screentransport/test/unittest/screensinktrans/BUILD.gn +++ b/services/screentransport/test/unittest/screensinktrans/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -21,9 +21,7 @@ module_out_path = "distributed_screen/sink_trans_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "./include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -63,6 +61,7 @@ ohos_unittest("SinkTransTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", "graphic_surface:surface", "hilog:libhilog", diff --git a/services/screentransport/test/unittest/screensourceprocessor/BUILD.gn b/services/screentransport/test/unittest/screensourceprocessor/BUILD.gn index 4cd72d43..646b4802 100644 --- a/services/screentransport/test/unittest/screensourceprocessor/BUILD.gn +++ b/services/screentransport/test/unittest/screensourceprocessor/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,11 +20,6 @@ module_out_path = "distributed_screen/source_processor_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/", - ] - - include_dirs += [ "./include", "${services_path}/screentransport/test/unittest/screentranstestutils/include", "${common_path}/include", @@ -66,6 +61,7 @@ ohos_unittest("SourceProcessorTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_surface:surface", "graphic_surface:sync_fence", "ipc:ipc_core", diff --git a/services/screentransport/test/unittest/screensourcetrans/BUILD.gn b/services/screentransport/test/unittest/screensourcetrans/BUILD.gn index 242434d0..6b5db7f1 100644 --- a/services/screentransport/test/unittest/screensourcetrans/BUILD.gn +++ b/services/screentransport/test/unittest/screensourcetrans/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,13 +20,6 @@ module_out_path = "distributed_screen/source_trans_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/", - "${fwk_utils_path}/include/log", - ] - - include_dirs += [ "./include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -71,6 +64,7 @@ ohos_unittest("SourceTransTest") { "access_token:libtoken_setproc", "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", "graphic_2d:libgraphic_utils", "graphic_surface:surface", diff --git a/services/screentransport/test/unittest/screentranstestutils/BUILD.gn b/services/screentransport/test/unittest/screentranstestutils/BUILD.gn index 7da58c6e..d6b0e509 100644 --- a/services/screentransport/test/unittest/screentranstestutils/BUILD.gn +++ b/services/screentransport/test/unittest/screentranstestutils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,13 +20,6 @@ module_out_path = "distributed_screen/screen_callback_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/", - "${fwk_utils_path}/include/log", - ] - - include_dirs += [ "./include", "${services_path}/screentransport/test/unittest/screentranstestutils/include", "${common_path}/include", @@ -70,6 +63,7 @@ ohos_unittest("ScreenCallbackTest") { external_deps = [ "av_codec:av_codec_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_2d:libgraphic_utils", "graphic_surface:surface", "graphic_surface:sync_fence", diff --git a/services/softbusadapter/test/unittest/BUILD.gn b/services/softbusadapter/test/unittest/BUILD.gn index dae471e2..48fa3fdd 100644 --- a/services/softbusadapter/test/unittest/BUILD.gn +++ b/services/softbusadapter/test/unittest/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -20,11 +20,6 @@ module_out_path = "distributed_screen/soft_bus_adapter_test" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/", - ] - - include_dirs += [ "./include", "${common_path}/include", "${services_path}/common/databuffer/include", @@ -63,6 +58,7 @@ ohos_unittest("SoftBusAdapterTest") { "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", ] } -- Gitee