1# Copyright (c) 2024-2025 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/ohos.gni") 17import("//build/test.gni") 18import("//foundation/ability/ability_runtime/ability_runtime.gni") 19module_output_path = "ability_runtime/abilitymgr" 20 21##############################fuzztest########################################## 22ohos_fuzztest("ExtensionRecordManagerFuzzTest") { 23 module_out_path = module_output_path 24 25 fuzz_config_file = 26 "${ability_runtime_test_path}/fuzztest/extensionrecordmanager_fuzzer" 27 include_dirs = [ 28 "${ability_runtime_innerkits_path}/ability_manager/include", 29 "${ability_runtime_innerkits_path}/app_manager/include/appmgr", 30 "${ability_runtime_services_path}/abilitymgr/include", 31 "${ability_runtime_services_path}/abilitymgr/include/utils", 32 "${ability_runtime_test_path}/fuzztest", 33 ] 34 cflags = [ 35 "-g", 36 "-O0", 37 "-Wno-unused-variable", 38 "-fno-omit-frame-pointer", 39 ] 40 sources = [ 41 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/ability_state_data.cpp", 42 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_mgr_client.cpp", 43 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_service_manager.cpp", 44 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_state_data.cpp", 45 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/application_state_observer_stub.cpp", 46 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/page_state_data.cpp", 47 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/preload_process_data.cpp", 48 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/process_bind_data.cpp", 49 "${ability_runtime_innerkits_path}/app_manager/src/appmgr/process_data.cpp", 50 "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record.cpp", 51 "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", 52 "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", 53 "${ability_runtime_services_path}/abilitymgr/src/ui_extension/preload_uiext_state_observer.cpp", 54 "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record.cpp", 55 "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record_factory.cpp", 56 "${ability_runtime_services_path}/common/src/app_utils.cpp", 57 "${ability_runtime_services_path}/common/src/json_utils.cpp", 58 "extensionrecordmanager_fuzzer.cpp", 59 ] 60 61 configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] 62 cflags = [] 63 if (target_cpu == "arm") { 64 cflags += [ "-DBINDER_IPC_32BIT" ] 65 } 66 deps = [ 67 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 68 "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", 69 "${ability_runtime_native_path}/ability/native:abilitykit_native", 70 "${ability_runtime_path}/utils/server/startup:startup_util", 71 "${ability_runtime_services_path}/abilitymgr:abilityms", 72 ] 73 74 external_deps = [ 75 "ability_base:want", 76 "ability_base:zuri", 77 "bundle_framework:appexecfwk_base", 78 "bundle_framework:appexecfwk_core", 79 "cJSON:cjson", 80 "c_utils:utils", 81 "common_event_service:cesfwk_innerkits", 82 "config_policy:configpolicy_util", 83 "ffrt:libffrt", 84 "hilog:libhilog", 85 "hisysevent:libhisysevent", 86 "hitrace:hitrace_meter", 87 "init:libbeget_proxy", 88 "ipc:ipc_core", 89 "napi:ace_napi", 90 "safwk:system_ability_fwk", 91 "samgr:samgr_proxy", 92 "window_manager:libwsutils", 93 ] 94 if (ability_runtime_child_process) { 95 defines = [ "SUPPORT_CHILD_PROCESS" ] 96 } 97 if (ability_runtime_graphics) { 98 external_deps += [ "input:libmmi-client" ] 99 } 100 cflags_cc = [] 101 if (os_dlp_part_enabled) { 102 cflags_cc += [ "-DWITH_DLP" ] 103 } 104} 105 106############################################################################### 107group("fuzztest") { 108 testonly = true 109 deps = [] 110 deps += [ 111 # deps file 112 ":ExtensionRecordManagerFuzzTest", 113 ] 114} 115############################################################################### 116