# Copyright (C) 2024 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")

ohos_unittest("preload_test") {
  module_out_path = "request/request/request"

  include_dirs = [
    "include",
    "../../../../interfaces/inner_kits/predownload/include",
    "../../../../common/include",
    "../../../common/utf8_utils/include",
  ]

  sources = [
    "src/abnormal.cpp",
    "src/cancel.cpp",
    "src/common.cpp",
    "src/fail.cpp",
    "src/get_info.cpp",
    "src/progress.cpp",
    "src/success.cpp",
    "src/clear_cache.cpp",
  ]

  deps = [ 
    "../../../../frameworks/native/cache_download:preload_native",
    "../../common/set_permission:common_permission",
  ]
  external_deps = [
    "c_utils:utils",
    "googletest:gmock",
    "googletest:gtest_main",
    "hilog:libhilog",
    "hisysevent:libhisysevent",
    "rust_cxx:cxx_cppdeps",
  ]
}

group("unittest") {
  testonly = true
  deps = []
  if (device_name != "rk3568") {
    deps = [ ":preload_test" ]
  }
}