# Copyright (c) 2023 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. import("//base/inputmethod/imf/inputmethod.gni") #####################hydra-fuzz################### import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") group("system_ability_stub_fuzztest") { testonly = true deps = [ ":ConnectSystemCmdFuzzTest", ":DisplayOptionalInputMethodFuzzTest", ":ExitCurrentInputTypeFuzzTest", ":GetCurrentInputmethodFuzzTest", ":GetCurrentInputmethodSubtypeFuzzTest", ":GetDefaultInputmethodFuzzTest", ":GetInputMethodConfigFuzzTest", ":GetSecurityModeFuzzTest", ":HideCurrentInputDeprecatedFuzzTest", ":HideCurrentInputFuzzTest", ":HideInputFuzzTest", ":ImsCmdLastFuzzTest", ":IsCurrentImeFuzzTest", ":IsDefaultImeFuzzTest", ":IsInputTypeSupportedFuzzTest", ":IsPanelShownFuzzTest", ":ListCurrentInputmethodSubtypeFuzzTest", ":ListInputmethodFuzzTest", ":ListInputmethodSubtypeFuzzTest", ":PanelStatusChangeFuzzTest", ":ReleaseInputFuzzTest", ":RequestHideInputFuzzTest", ":RequestShowInputFuzzTest", ":SetCoreAndAgentFuzzTest", ":ShowCurrentInputDeprecatedFuzzTest", ":ShowCurrentInputFuzzTest", ":ShowInputFuzzTest", ":StartInputFuzzTest", ":StartInputTypeFuzzTest", ":StopInputSessionFuzzTest", ":SwitchInputMethodFuzzTest", ":UnRegisteredProxyImeFuzzTest", ":UpdateListenEventFlagFuzzTest", ] } common_external_deps = [ "ability_runtime:ability_manager", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_core", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "input:libmmi-client", ] common_deps = [ "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common:imf_sa_stub_fuzztest_common_static", "//third_party/cJSON:cjson", ] ##############################fuzztest########################################## ohos_fuzztest("GetCurrentInputmethodFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethod_fuzzer" sources = [ "getcurrentinputmethod_fuzzer/getcurrentinputmethod_fuzzer.cpp" ] include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethod_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("GetCurrentInputmethodSubtypeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethodsubtype_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethodsubtype_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "getcurrentinputmethodsubtype_fuzzer/getcurrentinputmethodsubtype_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("HideCurrentInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "hidecurrentinput_fuzzer/hidecurrentinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("HideCurrentInputDeprecatedFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinputdeprecated_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinputdeprecated_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "hidecurrentinputdeprecated_fuzzer/hidecurrentinputdeprecated_fuzzer.cpp", ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ListCurrentInputmethodSubtypeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listcurrentinputmethodsubtype_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listcurrentinputmethodsubtype_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "listcurrentinputmethodsubtype_fuzzer/listcurrentinputmethodsubtype_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ListInputmethodFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethod_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethod_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "listinputmethod_fuzzer/listinputmethod_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ListInputmethodSubtypeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethodsubtype_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethodsubtype_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "listinputmethodsubtype_fuzzer/listinputmethodsubtype_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("PanelStatusChangeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/panelstatuschange_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/panelstatuschange_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "panelstatuschange_fuzzer/panelstatuschange_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ReleaseInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/releaseinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/releaseinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "releaseinput_fuzzer/releaseinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("SetCoreAndAgentFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/setcoreandagent_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/setcoreandagent_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "setcoreandagent_fuzzer/setcoreandagent_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ShowCurrentInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "showcurrentinput_fuzzer/showcurrentinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ShowCurrentInputDeprecatedFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinputdeprecated_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinputdeprecated_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "showcurrentinputdeprecated_fuzzer/showcurrentinputdeprecated_fuzzer.cpp", ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("StartInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/startinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/startinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "startinput_fuzzer/startinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ImsCmdLastFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/imscmdlast_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/imscmdlast_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "imscmdlast_fuzzer/imscmdlast_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("StopInputSessionFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/stopinputsession_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/stopinputsession_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "stopinputsession_fuzzer/stopinputsession_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("UpdateListenEventFlagFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/updatelisteneventflag_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/updatelisteneventflag_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "updatelisteneventflag_fuzzer/updatelisteneventflag_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("SwitchInputMethodFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/switchinputmethod_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/switchinputmethod_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "switchinputmethod_fuzzer/switchinputmethod_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("DisplayOptionalInputMethodFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/displayoptionalinputmethod_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/displayoptionalinputmethod_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "displayoptionalinputmethod_fuzzer/displayoptionalinputmethod_fuzzer.cpp", ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ExitCurrentInputTypeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/exitcurrentinputtype_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/exitcurrentinputtype_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "exitcurrentinputtype_fuzzer/exitcurrentinputtype_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("IsCurrentImeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/iscurrentime_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/iscurrentime_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "iscurrentime_fuzzer/iscurrentime_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("IsInputTypeSupportedFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/isinputtypesupported_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/isinputtypesupported_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "isinputtypesupported_fuzzer/isinputtypesupported_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("IsPanelShownFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/ispanelshown_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/ispanelshown_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "ispanelshown_fuzzer/ispanelshown_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("UnRegisteredProxyImeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/unregisteredproxyime_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/unregisteredproxyime_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "unregisteredproxyime_fuzzer/unregisteredproxyime_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("StartInputTypeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/startinputtype_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/startinputtype_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "startinputtype_fuzzer/startinputtype_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("GetDefaultInputmethodFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getdefaultinputmethod_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getdefaultinputmethod_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "getdefaultinputmethod_fuzzer/getdefaultinputmethod_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("GetInputMethodConfigFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getinputmethodconfig_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getinputmethodconfig_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "getinputmethodconfig_fuzzer/getinputmethodconfig_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("HideInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hideinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hideinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "hideinput_fuzzer/hideinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ShowInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "showinput_fuzzer/showinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("RequestShowInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/requestshowinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/requestshowinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "requestshowinput_fuzzer/requestshowinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("RequestHideInputFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/requesthideinput_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/requesthideinput_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "requesthideinput_fuzzer/requesthideinput_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("GetSecurityModeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getsecuritymode_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getsecuritymode_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "getsecuritymode_fuzzer/getsecuritymode_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("IsDefaultImeFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/isdefaultime_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/isdefaultime_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "isdefaultime_fuzzer/isdefaultime_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps } ohos_fuzztest("ConnectSystemCmdFuzzTest") { module_out_path = "imf/imf" fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/connectsystemcmd_fuzzer" include_dirs = [ "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/connectsystemcmd_fuzzer", "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", ] sources = [ "connectsystemcmd_fuzzer/connectsystemcmd_fuzzer.cpp" ] deps = common_deps external_deps = common_external_deps }