1# Copyright (c) 2022-2023 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 14import("//build/config/features.gni") 15import("//build/test.gni") 16 17#####################hydra-fuzz################### 18import("//foundation/arkui/ace_engine/ace_config.gni") 19module_output_path = "ace_engine/ace_engine/imageloader" 20 21##############################fuzztest########################################## 22ohos_fuzztest("ImageLoaderFuzzTest") { 23 module_out_path = module_output_path 24 fuzz_config_file = 25 "//foundation/arkui/ace_engine/test/fuzztest/imageloader_fuzzer" 26 deps = [ 27 "$ace_root/frameworks/base:ace_memory_monitor_ohos", 28 "$ace_root/frameworks/base/resource:ace_resource", 29 "$ace_root/frameworks/core/components/theme:build_theme_code", 30 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 31 "$ace_root/test/unittest:ace_unittest_log", 32 "$ace_root/test/unittest:ace_unittest_trace", 33 "$cjson_root:cjson", 34 "//third_party/googletest:gmock", 35 "//third_party/googletest:gmock_main", 36 ] 37 sources = [ 38 "$ace_root/frameworks/core/common/container_scope.cpp", 39 "$ace_root/frameworks/core/image/image_cache.cpp", 40 "$ace_root/frameworks/core/image/image_compressor.cpp", 41 "$ace_root/frameworks/core/image/image_file_cache.cpp", 42 "$ace_root/frameworks/core/image/image_loader.cpp", 43 "$ace_root/frameworks/core/image/image_object.cpp", 44 "$ace_root/frameworks/core/image/image_provider.cpp", 45 "$ace_root/frameworks/core/image/image_source_info.cpp", 46 "$ace_root/test/mock/base/mock_background_task_executor.cpp", 47 "$ace_root/test/mock/base/mock_download_manager.cpp", 48 "$ace_root/test/mock/core/common/mock_ace_application_info.cpp", 49 "imageloader_fuzzer.cpp", 50 ] 51 52 if (is_asan) { 53 sources += [ 54 "$ace_root/frameworks/base/json/json_util.cpp", 55 "$ace_root/frameworks/base/log/ace_tracker.cpp", 56 "$ace_root/frameworks/core/common/ace_engine.cpp", 57 "$ace_root/frameworks/core/common/container.cpp", 58 "$ace_root/frameworks/core/common/resource/resource_manager.cpp", 59 "$ace_root/frameworks/core/components/common/properties/color.cpp", 60 "$ace_root/frameworks/core/components_ng/image_provider/adapter/skia_image_data.cpp", 61 "$ace_root/frameworks/core/pipeline/pipeline_base.cpp", 62 "$ace_root/test/mock/adapter/mock_file_uri_helper_ohos.cpp", 63 "$ace_root/test/mock/base/mock_event_report.cpp", 64 "$ace_root/test/mock/core/common/mock_resource_adapter_v2.cpp", 65 "$ace_root/test/mock/core/common/mock_theme_constants.cpp", 66 "$ace_root/test/mock/core/common/mock_watch_dog.cpp", 67 "$ace_root/test/mock/core/render/mock_canvas_image.cpp", 68 "$ace_root/test/mock/core/render/mock_skia_image.cpp", 69 "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", 70 "$ace_root/test/unittest/core/pipeline/mock_event_manager.cpp", 71 ] 72 } 73 configs = [ "$ace_root/test/fuzztest:ace_fuzz_config" ] 74 if (ace_use_rosen_drawing) { 75 include_dirs = [ 76 "//foundation/graphic/graphic_2d/rosen/modules/2d_engine", 77 "//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text", 78 ] 79 external_deps = [ "graphic_2d:2d_graphics" ] 80 } 81} 82 83############################################################################### 84group("fuzztest") { 85 testonly = true 86 deps = [] 87 if (!is_asan) { 88 deps += [ ":ImageLoaderFuzzTest" ] 89 } 90} 91############################################################################### 92