# Copyright (c) 2022 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("CleanWindowStyleFuzzTest") {
  module_out_path = module_output_path
  fuzz_config_file = "${mmi_path}/test/fuzztest/cleanwindowstyle_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/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/timer_manager/include",
    "${mmi_path}/service/libinput_adapter/include",
    "${mmi_path}/service/message_handle/include",
  ]
  cflags = [
    "-g",
    "-O0",
    "-Wno-unused-variable",
    "-fno-omit-frame-pointer",
    "-Dprivate=public",
    "-Dprotected=public",
  ]
  sources = [ "cleanwindowstyle_fuzzer.cpp" ]

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

  external_deps = [
    "ability_runtime:app_manager",
    "c_utils:utils",
    "data_share:datashare_consumer",
    "graphic_2d:2d_graphics",
    "graphic_2d:librender_service_client",
    "hilog:libhilog",
    "image_framework:image_native",
    "ipc:ipc_single",
    "ipc:ipc_single",
    "libinput:libinput-third-mmi",
    "security_component_manager:libsecurity_component_sdk",
    "window_manager:libwm",
  ]

  if (enable_player_framework) {
    external_deps += [ "player_framework:media_client" ]
  }
}

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