11e934351Sopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
21e934351Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
31e934351Sopenharmony_ci# you may not use this file except in compliance with the License.
41e934351Sopenharmony_ci# You may obtain a copy of the License at
51e934351Sopenharmony_ci#
61e934351Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
71e934351Sopenharmony_ci#
81e934351Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
91e934351Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
101e934351Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111e934351Sopenharmony_ci# See the License for the specific language governing permissions and
121e934351Sopenharmony_ci# limitations under the License.
131e934351Sopenharmony_ci
141e934351Sopenharmony_ciimport("//build/ohos.gni")
151e934351Sopenharmony_ciimport("//build/test.gni")
161e934351Sopenharmony_ciimport("//foundation/communication/netstack/netstack_config.gni")
171e934351Sopenharmony_ci
181e934351Sopenharmony_ciNETSTACK_NAPI_ROOT = "$SUBSYSTEM_DIR/netstack/frameworks/js/napi/"
191e934351Sopenharmony_ci
201e934351Sopenharmony_ciutils_include = [
211e934351Sopenharmony_ci  "$SUBSYSTEM_DIR/netstack/utils/common_utils/include",
221e934351Sopenharmony_ci  "$SUBSYSTEM_DIR/netstack/utils/log/include",
231e934351Sopenharmony_ci  "$THIRD_PARTY_ROOT/curl/include",
241e934351Sopenharmony_ci]
251e934351Sopenharmony_ci
261e934351Sopenharmony_cicommon_external_deps = [
271e934351Sopenharmony_ci  "c_utils:utils",
281e934351Sopenharmony_ci  "hilog:libhilog",
291e934351Sopenharmony_ci]
301e934351Sopenharmony_ci
311e934351Sopenharmony_ciohos_unittest("http_cache_unittest") {
321e934351Sopenharmony_ci  sanitize = {
331e934351Sopenharmony_ci    cfi = true
341e934351Sopenharmony_ci    cfi_cross_dso = true
351e934351Sopenharmony_ci    debug = false
361e934351Sopenharmony_ci  }
371e934351Sopenharmony_ci
381e934351Sopenharmony_ci  branch_protector_ret = "pac_ret"
391e934351Sopenharmony_ci
401e934351Sopenharmony_ci  module_out_path = "netstack/http_cache_unittest"
411e934351Sopenharmony_ci
421e934351Sopenharmony_ci  include_dirs = [
431e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/cache_constant/include",
441e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/include",
451e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/constant/include",
461e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/options/include",
471e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/base64/include",
481e934351Sopenharmony_ci  ]
491e934351Sopenharmony_ci  include_dirs += utils_include
501e934351Sopenharmony_ci
511e934351Sopenharmony_ci  external_deps = common_external_deps
521e934351Sopenharmony_ci
531e934351Sopenharmony_ci  deps = [ "$SUBSYSTEM_DIR/netstack/utils/napi_utils:napi_utils" ]
541e934351Sopenharmony_ci
551e934351Sopenharmony_ci  sources = [
561e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/base64/src/base64_utils.cpp",
571e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_request.cpp",
581e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_response.cpp",
591e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_strategy.cpp",
601e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_time.cpp",
611e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/constant/src/constant.cpp",
621e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/options/src/http_request_options.cpp",
631e934351Sopenharmony_ci    "$NETSTACK_NAPI_ROOT/http/options/src/http_response.cpp",
641e934351Sopenharmony_ci    "$SUBSYSTEM_DIR/netstack/utils/common_utils/src/netstack_common_utils.cpp",
651e934351Sopenharmony_ci    "Base64Test.cpp",
661e934351Sopenharmony_ci    "HttpCacheStrategyTest.cpp",
671e934351Sopenharmony_ci  ]
681e934351Sopenharmony_ci
691e934351Sopenharmony_ci  part_name = "netstack"
701e934351Sopenharmony_ci  subsystem_name = "communication"
711e934351Sopenharmony_ci}
721e934351Sopenharmony_ci
731e934351Sopenharmony_cigroup("unittest") {
741e934351Sopenharmony_ci  testonly = true
751e934351Sopenharmony_ci  deps = [ ":http_cache_unittest" ]
761e934351Sopenharmony_ci}
77