1# Copyright (c) 2022 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 "hiviewdfx_hilog_native:libhilog", 29] 30 31ohos_unittest("http_cache_unittest") { 32 module_out_path = "netstack/http_cache_unittest" 33 34 include_dirs = [ 35 "$NETSTACK_NAPI_ROOT/http/cache/cache_constant/include", 36 "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/include", 37 "$NETSTACK_NAPI_ROOT/http/constant/include", 38 "$NETSTACK_NAPI_ROOT/http/options/include", 39 "$NETSTACK_NAPI_ROOT/http/cache/base64/include", 40 ] 41 include_dirs += utils_include 42 43 external_deps = common_external_deps 44 45 sources = [ 46 "$NETSTACK_NAPI_ROOT/http/cache/base64/src/base64_utils.cpp", 47 "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_request.cpp", 48 "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_response.cpp", 49 "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_cache_strategy.cpp", 50 "$NETSTACK_NAPI_ROOT/http/cache/cache_strategy/src/http_time.cpp", 51 "$NETSTACK_NAPI_ROOT/http/constant/src/constant.cpp", 52 "$NETSTACK_NAPI_ROOT/http/options/src/http_request_options.cpp", 53 "$NETSTACK_NAPI_ROOT/http/options/src/http_response.cpp", 54 "$SUBSYSTEM_DIR/netstack/utils/common_utils/src/netstack_common_utils.cpp", 55 "Base64Test.cpp", 56 "HttpCacheStrategyTest.cpp", 57 ] 58 59 part_name = "netstack" 60 subsystem_name = "communication" 61} 62 63group("unittest") { 64 testonly = true 65 deps = [ ":http_cache_unittest" ] 66} 67