• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/test.gni")
15import("../screenlock.gni")
16
17module_output_path = "screenlock_mgr/screenlock_mgr/screenlock_service"
18
19ohos_unittest("ScreenLockServiceTest") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25  module_out_path = module_output_path
26  include_dirs = [
27    "unittest",
28    "${screenlock_mgr_path}/frameworks/native/include",
29    "${screenlock_mgr_path}/services/include",
30  ]
31
32  sources = [
33    "unittest/inner_listener_test.cpp",
34    "unittest/screenlock_callback_test.cpp",
35    "unittest/screenlock_client_test.cpp",
36    "unittest/screenlock_command_test.cpp",
37    "unittest/screenlock_manager_stub_test.cpp",
38    "unittest/screenlock_notify_test_instance.cpp",
39    "unittest/screenlock_preferences_test.cpp",
40    "unittest/screenlock_service_test.cpp",
41    "unittest/screenlock_strongauth_test.cpp",
42  ]
43
44  deps = [
45    "${screenlock_mgr_path}/interfaces/inner_api:screenlock_client_static",
46    "${screenlock_mgr_path}/services:screenlock_server_static",
47  ]
48
49  external_deps = [
50    "ability_base:base",
51    "ability_base:want",
52    "ability_runtime:ability_manager",
53    "ability_runtime:app_manager",
54    "access_token:libaccesstoken_sdk",
55    "access_token:libtoken_setproc",
56    "access_token:libtokenid_sdk",
57    "c_utils:utils",
58    "common_event_service:cesfwk_innerkits",
59    "eventhandler:libeventhandler",
60    "ffrt:libffrt",
61    "googletest:gtest_main",
62    "hilog:libhilog",
63    "hitrace:hitrace_meter",
64    "ipc:ipc_single",
65    "os_account:os_account_innerkits",
66    "samgr:samgr_proxy",
67    "time_service:time_client",
68    "user_auth_framework:userauth_client",
69    "window_manager:libdm",
70    "preferences:native_preferences",
71    "safwk:system_ability_fwk",
72  ]
73
74  if (screenlock_mgr_so_crop == true) {
75    cflags = [ "-DIS_SO_CROP_H" ]
76  }
77
78  defines = []
79}
80
81group("unittest") {
82  testonly = true
83
84  deps = []
85
86  deps += [ ":ScreenLockServiceTest" ]
87}
88