1# Copyright (c) 2020-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#     http://www.apache.org/licenses/LICENSE-2.0
6# Unless required by applicable law or agreed to in writing, software
7# distributed under the License is distributed on an "AS IS" BASIS,
8# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9# See the License for the specific language governing permissions and
10# limitations under the License.
11
12import("//build/test.gni")
13import("../wallpaper.gni")
14
15## UnitTest wallpaper_test {{{
16
17ohos_unittest("wallpaper_test") {
18  testonly = true
19  resource_config_file =
20      "${wallpaper_path}/test/unittest/resource/ohos_test.xml"
21  module_out_path = "wallpaper_mgr/wallpaper_test"
22  sources = [ "unittest/wallpaper_test.cpp" ]
23
24  include_dirs = [ "${wallpaper_path}/services/include" ]
25  deps = [
26    "${utils_path}:wallpaper_utils",
27    "${wallpaper_path}/frameworks/native:wallpapermanager_static",
28    "${wallpaper_path}/services:wallpaper_service",
29  ]
30  external_deps = [
31    "ability_base:want",
32    "ability_runtime:ability_manager",
33    "ability_runtime:abilitykit_native",
34    "access_token:libaccesstoken_sdk",
35    "access_token:libnativetoken",
36    "access_token:libtoken_setproc",
37    "access_token:libtokenid_sdk",
38    "c_utils:utils",
39    "common_event_service:cesfwk_innerkits",
40    "hilog:libhilog",
41    "hisysevent:libhisysevent",
42    "hitrace:hitrace_meter",
43    "image_framework:image",
44    "image_framework:image_native",
45    "ipc:ipc_single",
46    "os_account:os_account_innerkits",
47    "player_framework:media_client",
48    "safwk:system_ability_fwk",
49    "samgr:samgr_proxy",
50    "window_manager:libwm",
51    "window_manager:libwsutils",
52  ]
53}
54
55ohos_unittest("wallpaper_permission_test") {
56  testonly = true
57  resource_config_file =
58      "${wallpaper_path}/test/unittest/resource/ohos_test.xml"
59  module_out_path = "wallpaper_mgr/wallpaper_permission_test"
60  sources = [ "unittest/wallpaper_permission_test.cpp" ]
61
62  include_dirs = []
63  deps = [ "${wallpaper_path}/frameworks/native:wallpapermanager_static" ]
64  external_deps = [
65    "access_token:libtokenid_sdk",
66    "c_utils:utils",
67    "common_event_service:cesfwk_innerkits",
68    "hilog:libhilog",
69    "image_framework:image",
70    "image_framework:image_native",
71    "ipc:ipc_single",
72    "player_framework:media_client",
73    "safwk:system_ability_fwk",
74    "samgr:samgr_proxy",
75    "window_manager:libwm",
76  ]
77}
78
79ohos_unittest("wallpaper_dfx_test") {
80  testonly = true
81  module_out_path = "wallpaper_mgr/wallpaper_dfx_test"
82  sources = [ "unittest/wallpaper_dfx_test.cpp" ]
83
84  include_dirs = []
85  deps = [
86    "${utils_path}:wallpaper_utils",
87    "${wallpaper_path}/frameworks/native:wallpapermanager_static",
88    "${wallpaper_path}/services:wallpaper_service",
89  ]
90  external_deps = [
91    "c_utils:utils",
92    "hilog:libhilog",
93    "hisysevent:libhisysevent",
94    "hitrace:hitrace_meter",
95    "player_framework:media_client",
96  ]
97}
98
99group("unittest") {
100  testonly = true
101
102  deps = []
103
104  deps += [
105    ":wallpaper_dfx_test",
106    ":wallpaper_permission_test",
107    ":wallpaper_test",
108  ]
109}
110