153c3577eSopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
253c3577eSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
353c3577eSopenharmony_ci# you may not use this file except in compliance with the License.
453c3577eSopenharmony_ci# You may obtain a copy of the License at
553c3577eSopenharmony_ci#
653c3577eSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
753c3577eSopenharmony_ci#
853c3577eSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
953c3577eSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1053c3577eSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1153c3577eSopenharmony_ci# See the License for the specific language governing permissions and
1253c3577eSopenharmony_ci# limitations under the License.
1353c3577eSopenharmony_ciimport("//build/test.gni")
1453c3577eSopenharmony_ciimport("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni")
1553c3577eSopenharmony_cimodule_output_path = "datamgr_service/distributeddatafwk"
1653c3577eSopenharmony_ci
1753c3577eSopenharmony_ci###############################################################################
1853c3577eSopenharmony_ciohos_unittest("AccountDelegateTest") {
1953c3577eSopenharmony_ci  module_out_path = module_output_path
2053c3577eSopenharmony_ci
2153c3577eSopenharmony_ci  sources = [
2253c3577eSopenharmony_ci    "${data_service_path}/framework/account/account_delegate.cpp",
2353c3577eSopenharmony_ci    "account_delegate_test.cpp",
2453c3577eSopenharmony_ci  ]
2553c3577eSopenharmony_ci  include_dirs = [
2653c3577eSopenharmony_ci    "//commonlibrary/c_utils/base/include",
2753c3577eSopenharmony_ci    "${data_service_path}/framework/include/account",
2853c3577eSopenharmony_ci    "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata/include",
2953c3577eSopenharmony_ci    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/autils",
3053c3577eSopenharmony_ci    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/utils",
3153c3577eSopenharmony_ci    "//foundation/distributeddatamgr/kv_store/frameworks/common",
3253c3577eSopenharmony_ci    "${data_service_path}/adapter/account/src",
3353c3577eSopenharmony_ci  ]
3453c3577eSopenharmony_ci  cflags = [
3553c3577eSopenharmony_ci    "-Dprivate=public",
3653c3577eSopenharmony_ci    "-Dprotected=public",
3753c3577eSopenharmony_ci  ]
3853c3577eSopenharmony_ci
3953c3577eSopenharmony_ci  deps = [
4053c3577eSopenharmony_ci    "../:distributeddata_account_static",
4153c3577eSopenharmony_ci    "//third_party/googletest:gtest_main",
4253c3577eSopenharmony_ci  ]
4353c3577eSopenharmony_ci
4453c3577eSopenharmony_ci  external_deps = [
4553c3577eSopenharmony_ci    "ability_base:base",
4653c3577eSopenharmony_ci    "ability_base:want",
4753c3577eSopenharmony_ci    "bundle_framework:appexecfwk_base",
4853c3577eSopenharmony_ci    "c_utils:utils",
4953c3577eSopenharmony_ci    "hilog:libhilog",
5053c3577eSopenharmony_ci    "ipc:ipc_core",
5153c3577eSopenharmony_ci    "kv_store:distributeddata_inner",
5253c3577eSopenharmony_ci    "kv_store:distributeddata_mgr",
5353c3577eSopenharmony_ci    "kv_store:distributeddb",
5453c3577eSopenharmony_ci    "os_account:libaccountkits",
5553c3577eSopenharmony_ci    "os_account:os_account_innerkits",
5653c3577eSopenharmony_ci  ]
5753c3577eSopenharmony_ci  if (os_account_part_is_enabled) {
5853c3577eSopenharmony_ci    sources += [ "${data_service_path}/adapter/account/src/account_delegate_normal_impl.cpp" ]
5953c3577eSopenharmony_ci    cflags_cc = [ "-DOS_ACCOUNT_PART_IS_ENABLED" ]
6053c3577eSopenharmony_ci    external_deps += [ "access_token:libaccesstoken_sdk" ]
6153c3577eSopenharmony_ci  } else {
6253c3577eSopenharmony_ci    sources += [ "${data_service_path}/adapter/account/src/account_delegate_default_impl.cpp" ]
6353c3577eSopenharmony_ci  }
6453c3577eSopenharmony_ci  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
6553c3577eSopenharmony_ci}
6653c3577eSopenharmony_ci
6753c3577eSopenharmony_ci###############################################################################
6853c3577eSopenharmony_cigroup("unittest") {
6953c3577eSopenharmony_ci  testonly = true
7053c3577eSopenharmony_ci
7153c3577eSopenharmony_ci  deps = []
7253c3577eSopenharmony_ci
7353c3577eSopenharmony_ci  deps += [ ":AccountDelegateTest" ]
7453c3577eSopenharmony_ci}
7553c3577eSopenharmony_ci###############################################################################
76