1# Copyright (c) 2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/test.gni") 17import("../../../multimodalinput_mini.gni") 18module_output_path = "input/input" 19 20##############################fuzztest########################################## 21ohos_fuzztest("InjectEventFuzzTest") { 22 module_out_path = module_output_path 23 fuzz_config_file = "${mmi_path}/test/fuzztest/injectevent_fuzzer" 24 include_dirs = [ 25 "${mmi_path}/service/app_state_manager/include", 26 "${mmi_path}/service/device_config/include", 27 "${mmi_path}/service/device_manager/include", 28 "${mmi_path}/service/device_scalability/include", 29 "${mmi_path}/service/device_state_manager/include", 30 "${mmi_path}/service/delegate_task/include", 31 "${mmi_path}/service/display_state_manager/include", 32 "${mmi_path}/service/event_dispatch/include", 33 "${mmi_path}/service/key_event_normalize/include", 34 "${mmi_path}/service/event_handler/include", 35 "${mmi_path}/service/event_dump/include", 36 "${mmi_path}/service/fingersense_wrapper/include", 37 "${mmi_path}/service/gesturesense_wrapper/include", 38 "${mmi_path}/service/monitor/include", 39 "${mmi_path}/service/interceptor/include", 40 "${mmi_path}/service/joystick/include", 41 "${mmi_path}/service/dfx/include", 42 "${mmi_path}/service/libinput_adapter/include", 43 "${mmi_path}/service/message_handle/include", 44 "${mmi_path}/service/module_loader/include", 45 "${mmi_path}/service/window_manager/include", 46 "${mmi_path}/service/touch_event_normalize/include", 47 "${mmi_path}/service/key_command/include", 48 "${mmi_path}/service/subscriber/include", 49 "${mmi_path}/service/timer_manager/include", 50 "${mmi_path}/service/permission_helper/include", 51 "${mmi_path}/service/connect_manager/include", 52 "${mmi_path}/service/device_state_manager/include", 53 "${mmi_path}/service/filter/include", 54 "${mmi_path}/service/module_loader/include", 55 "${mmi_path}/service/nap_process/include", 56 "${mmi_path}/service/event_resample/include", 57 "${mmi_path}/interfaces/native/innerkits/proxy/include", 58 "${mmi_path}/interfaces/native/innerkits/event/include", 59 "${mmi_path}/service/mouse_event_normalize/include", 60 "${mmi_path}/interfaces/native/innerkits/common/include", 61 "${mmi_path}/util/common/include", 62 "${mmi_path}/util/socket/include", 63 "${mmi_path}/util/network/include", 64 "${mmi_path}/frameworks/proxy/event_handler/include", 65 ] 66 cflags = [ 67 "-g", 68 "-O0", 69 "-Wno-unused-variable", 70 "-fno-omit-frame-pointer", 71 ] 72 sources = [ "injectevent_fuzzer.cpp" ] 73 deps = [ 74 "${mmi_path}/frameworks/proxy:libmmi-client", 75 "${mmi_path}/service:libmmi-server", 76 "${mmi_path}/util:libmmi-util", 77 ] 78 79 external_deps = [ 80 "ability_base:want", 81 "ability_base:zuri", 82 "ability_runtime:ability_manager", 83 "ability_runtime:abilitykit_native", 84 "ability_runtime:app_manager", 85 "ability_runtime:dataobs_manager", 86 "access_token:libaccesstoken_sdk", 87 "access_token:libtokenid_sdk", 88 "cJSON:cjson", 89 "c_utils:utilsbase", 90 "common_event_service:cesfwk_innerkits", 91 "config_policy:configpolicy_util", 92 "data_share:datashare_consumer", 93 "eventhandler:libeventhandler", 94 "faultloggerd:libbacktrace_local", 95 "graphic_2d:2d_graphics", 96 "graphic_2d:librender_service_client", 97 "hicollie:libhicollie", 98 "hilog:libhilog", 99 "hilog:libhilog_base", 100 "hisysevent:libhisysevent", 101 "image_framework:image_native", 102 "init:libbeget_proxy", 103 "init:libbegetutil", 104 "ipc:ipc_single", 105 "libinput:libinput-third-mmi", 106 "napi:ace_napi", 107 "preferences:native_preferences", 108 "safwk:system_ability_fwk", 109 "samgr:samgr_proxy", 110 "window_manager:libwm", 111 "window_manager:libwsutils", 112 ] 113 114 if (hitrace_enabled) { 115 external_deps += [ "hitrace:hitrace_meter" ] 116 } 117 118 if (security_component_enable) { 119 external_deps += [ "security_component_manager:libsecurity_component_sdk" ] 120 } 121 122 if (resource_schedule_service_enabled) { 123 external_deps += [ "resource_schedule_service:ressched_client" ] 124 } 125 126 if (enable_player_framework) { 127 external_deps += [ "player_framework:media_client" ] 128 } 129} 130 131############################################################################### 132group("fuzztest") { 133 testonly = true 134 deps = [] 135 deps += [ 136 # deps file 137 ":InjectEventFuzzTest", 138 ] 139} 140############################################################################### 141