# Copyright (c) 2025 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.

#####################hydra-fuzz###################
import("//build/config/features.gni")
import("//build/test.gni")
import("../../../multimodalinput_mini.gni")
module_output_path = "input/input"

##############################fuzztest##########################################
ohos_fuzztest("JudgeCameraInForeFuzzTest") {
  module_out_path = module_output_path
  fuzz_config_file = "${mmi_path}/test/fuzztest/judgecamerainfore_fuzzer"
  include_dirs = [
    "${mmi_path}/interfaces/util/common/include",
    "${mmi_path}/service/connect_manager/include",
    "${mmi_path}/service/filter/include/",
    "${mmi_path}/service/nap_process/include/",
    "${mmi_path}/service/module_loader/include",
    "${mmi_path}/service/delegate_task/include",
    "${mmi_path}/service/event_handler/include",
    "${mmi_path}/service/event_dispatch/include",
    "${mmi_path}/service/interceptor/include",
    "${mmi_path}/service/monitor/include",
    "${mmi_path}/service/event_hook/include",
    "${mmi_path}/service/event_hook/include/hook",
    "${mmi_path}/service/event_hook/include/checker",
    "${mmi_path}/service/key_event_normalize/include",
    "${mmi_path}/service/window_manager/include",
    "${mmi_path}/service/key_command/include",
    "${mmi_path}/service/subscriber/include",
    "${mmi_path}/service/mouse_event_normalize/include",
    "${mmi_path}/service/libinput_adapter/include",
    "${mmi_path}/service/message_handle/include",
    "${mmi_path}/service/account_manager/include",
    "${mmi_path}/service/common/include",
    "${mmi_path}/service/common/timer_manager/include",
    "${mmi_path}/service/common/setting_datashare/include",
  ]
  cflags = [
    "-g",
    "-O0",
    "-Wno-unused-variable",
    "-fno-omit-frame-pointer",
    "-Dprivate=public",
    "-Dprotected=public",
  ]
  sources = [
    "judgecamerainfore_fuzzer.cpp",
    "${mmi_path}/test/fuzztest/mmi_fuzzer_helper/mmi_fuzzer_helper.cpp",
  ]

  configs = [
    "${mmi_path}/service:libmmi_server_config",
  ]

  deps = [
    "${mmi_path}/frameworks/proxy:libmmi-client",
    "${mmi_path}/service:libmmi-server",
    "${mmi_path}/util:libmmi-util",
  ]

  external_deps = [
    "common_event_service:cesfwk_innerkits",
    "ability_runtime:app_manager",
    "cJSON:cjson",
    "c_utils:utils",
    "common_event_service:cesfwk_core",
    "data_share:datashare_consumer",
    "ffrt:libffrt",
    "graphic_2d:2d_graphics",
    "graphic_2d:librender_service_client",
    "hilog:libhilog",
    "image_framework:image_native",
    "ipc:ipc_single",
    "libinput:libinput-third-mmi",
    "window_manager:libwm",
  ]

  if (security_component_enable) {
    external_deps += [ "security_component_manager:libsecurity_component_sdk" ]
  }
}

###############################################################################
group("fuzztest") {
  testonly = true
  deps = []
  deps += [
    # deps file
    ":JudgeCameraInForeFuzzTest",
  ]
}
###############################################################################