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

import("//build/test.gni")
import("//foundation/aafwk/standard/form_runtime/form_runtime.gni")

module_output_path = "form_runtime/formmgrservice"

ohos_unittest("FmsFormSetNextRefreshTest") {
  module_out_path = module_output_path

  sources = [
    "${form_runtime_path}/test/mock/src/mock_bundle_manager.cpp",
    "${form_runtime_path}/test/unittest/fms_form_set_next_refresh_test/fms_form_set_next_refresh_test.cpp",
  ]

  include_dirs = [
    "//third_party/json/include",
    "${ability_runtime_path}/services/formmgr/include",
    "${bundlefwk_path}/services/bundlemgr/include",
    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include",
    "${form_runtime_path}/interfaces/inner_api/include",
    "${bundlefwk_inner_api_path}/appexecfwk_core/include/bundlemgr/",
    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include/",
    "${distributedschedule_path}/samgr/adapter/interfaces/innerkits/include/",
    "${bundlefwk_innerkits_path}/libeventhandler/include",
    "${form_runtime_path}/test/mock/include",
    "${distributeddatamgr_path}/distributeddatamgr/interfaces/innerkits/distributeddata/include",
  ]

  configs = [
    "${form_runtime_path}/test:formmgr_test_config",
    "${ability_runtime_path}/services/abilitymgr:abilityms_config",

    #"${bundlefwk_inner_api_path}/appexecfwk_core:bundlemgr_sdk_config",
    #"${form_runtime_path}:formmgr_config",
  ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
  deps = [
    "${ability_runtime_path}/frameworks/kits/wantagent:wantagent_innerkits",
    "${ability_runtime_path}/interfaces/innerkits/app_manager:app_manager",
    "${bundlefwk_inner_api_path}/appexecfwk_base:appexecfwk_base",
    "${form_runtime_path}:fms_target",
    "${form_runtime_path}:fmskit_native",
    "//base/miscservices/time/services:time_service",

    #"${libs_path}/libeventhandler:libeventhandler_target",
    "${distributeddatamgr_path}/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner",
    "${distributedschedule_path}/safwk/interfaces/innerkits/safwk:system_ability_fwk",
    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
    "//third_party/googletest:gmock_main",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "ability_base:base",
    "ability_base:want",
    "ability_base:zuri",
    "appspawn:appspawn_socket_client",
    "bundle_framework:appexecfwk_core",
    "common_event_service:cesfwk_core",
    "common_event_service:cesfwk_innerkits",
    "form_runtime:form_manager",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
  ]
}

###############################################################################
group("unittest") {
  testonly = true
  # deps = [ ":FmsFormSetNextRefreshTest" ]
}
###############################################################################
