1# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//build/test.gni")
16import("//foundation/communication/netstack/netstack_config.gni")
17
18NETSTACK_NAPI_ROOT = "$SUBSYSTEM_DIR/netstack/frameworks/js/napi/"
19
20utils_include = [
21  "$SUBSYSTEM_DIR/netstack/utils/common_utils/include",
22  "$SUBSYSTEM_DIR/netstack/utils/log/include",
23  "$THIRD_PARTY_ROOT/curl/include",
24]
25
26common_external_deps = [
27  "c_utils:utils",
28  "hilog:libhilog",
29]
30
31ohos_unittest("http_cache_unittest") {
32  sanitize = {
33    cfi = true
34    cfi_cross_dso = true
35    debug = false
36  }
37
38  branch_protector_ret = "pac_ret"
39
40  module_out_path = "netstack/http_cache_unittest"
41
42  include_dirs = [
43    "$NETSTACK_NAPI_ROOT/http/cache/cache_constant/include",
44    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/include",
45    "$NETSTACK_NAPI_ROOT/http/constant/include",
46    "$NETSTACK_NAPI_ROOT/http/options/include",
47    "$NETSTACK_NAPI_ROOT/http/cache/base64/include",
48  ]
49  include_dirs += utils_include
50
51  external_deps = common_external_deps
52
53  deps = [ "$SUBSYSTEM_DIR/netstack/utils/napi_utils:napi_utils" ]
54
55  sources = [
56    "$NETSTACK_NAPI_ROOT/http/cache/base64/src/base64_utils.cpp",
57    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_request.cpp",
58    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_response.cpp",
59    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_strategy.cpp",
60    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_time.cpp",
61    "$NETSTACK_NAPI_ROOT/http/constant/src/constant.cpp",
62    "$NETSTACK_NAPI_ROOT/http/options/src/http_request_options.cpp",
63    "$NETSTACK_NAPI_ROOT/http/options/src/http_response.cpp",
64    "$SUBSYSTEM_DIR/netstack/utils/common_utils/src/netstack_common_utils.cpp",
65    "Base64Test.cpp",
66    "HttpCacheStrategyTest.cpp",
67  ]
68
69  part_name = "netstack"
70  subsystem_name = "communication"
71}
72
73group("unittest") {
74  testonly = true
75  deps = [ ":http_cache_unittest" ]
76}
77