• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    "$NETSTACK_NAPI_ROOT/http/http_exec/include",
49  ]
50  include_dirs += utils_include
51
52  external_deps = common_external_deps
53  external_deps += [ "napi:ace_napi" ]
54
55  deps = [ "$SUBSYSTEM_DIR/netstack/utils/napi_utils:napi_utils" ]
56
57  sources = [
58    "$NETSTACK_NAPI_ROOT/http/cache/base64/src/base64_utils.cpp",
59    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_request.cpp",
60    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_response.cpp",
61    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_strategy.cpp",
62    "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_time.cpp",
63    "$NETSTACK_NAPI_ROOT/http/constant/src/constant.cpp",
64    "$NETSTACK_NAPI_ROOT/http/options/src/http_request_options.cpp",
65    "$NETSTACK_NAPI_ROOT/http/options/src/http_response.cpp",
66    "$SUBSYSTEM_DIR/netstack/utils/common_utils/src/netstack_common_utils.cpp",
67    "Base64Test.cpp",
68    "HttpCacheStrategyTest.cpp",
69  ]
70
71  part_name = "netstack"
72  subsystem_name = "communication"
73}
74
75group("unittest") {
76  testonly = true
77  deps = [ ":http_cache_unittest" ]
78}
79