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 "//third_party/cJSON", 66 "${preferences_path}/frameworks/native/include", 67 "${graphics_path}/2d_graphics/include", 68 ] 69 cflags = [ 70 "-g", 71 "-O0", 72 "-Wno-unused-variable", 73 "-fno-omit-frame-pointer", 74 ] 75 sources = [ "injectevent_fuzzer.cpp" ] 76 deps = [ 77 "${mmi_path}/frameworks/proxy:libmmi-client", 78 "${mmi_path}/service:libmmi-server", 79 "${mmi_path}/util:libmmi-util", 80 ] 81 82 external_deps = [ 83 "ability_base:want", 84 "ability_base:zuri", 85 "ability_runtime:ability_manager", 86 "ability_runtime:abilitykit_native", 87 "ability_runtime:app_manager", 88 "ability_runtime:dataobs_manager", 89 "access_token:libaccesstoken_sdk", 90 "access_token:libtokenid_sdk", 91 "common_event_service:cesfwk_innerkits", 92 "config_policy:configpolicy_util", 93 "data_share:datashare_consumer", 94 "faultloggerd:libbacktrace_local", 95 "graphic_2d:2d_graphics", 96 "graphic_2d:librender_service_client", 97 "hicollie:libhicollie", 98 "hilog:libhilog", 99 "hisysevent:libhisysevent", 100 "hitrace:hitrace_meter", 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 "window_manager:libwm", 110 "window_manager:libwsutils", 111 ] 112 113 if (security_component_enable) { 114 external_deps += [ "security_component_manager:libsecurity_component_sdk" ] 115 } 116 117 if (resource_schedule_service_enabled) { 118 external_deps += [ "resource_schedule_service:ressched_client" ] 119 } 120 121 if (enable_player_framework) { 122 external_deps += [ "player_framework:media_client" ] 123 } 124} 125 126############################################################################### 127group("fuzztest") { 128 testonly = true 129 deps = [] 130 deps += [ 131 # deps file 132 ":InjectEventFuzzTest", 133 ] 134} 135############################################################################### 136