1885b47fbSopenharmony_ci# Copyright (C) 2022-2023 Huawei Device Co., Ltd.
2885b47fbSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3885b47fbSopenharmony_ci# you may not use this file except in compliance with the License.
4885b47fbSopenharmony_ci# You may obtain a copy of the License at
5885b47fbSopenharmony_ci#
6885b47fbSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7885b47fbSopenharmony_ci#
8885b47fbSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9885b47fbSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10885b47fbSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11885b47fbSopenharmony_ci# See the License for the specific language governing permissions and
12885b47fbSopenharmony_ci# limitations under the License.
13885b47fbSopenharmony_ci
14885b47fbSopenharmony_ciimport("//build/test.gni")
15885b47fbSopenharmony_ciimport("../../../accessibility_manager_service.gni")
16885b47fbSopenharmony_ciimport("../../../services/test/aamstestmock.gni")
17885b47fbSopenharmony_ci
18885b47fbSopenharmony_cimodule_output_path = "accessibility/accessibility"
19885b47fbSopenharmony_ci
20885b47fbSopenharmony_ci###############################################################################
21885b47fbSopenharmony_ciconfig("module_private_config") {
22885b47fbSopenharmony_ci  visibility = [ ":*" ]
23885b47fbSopenharmony_ci  visibility += [ "../../../../../arkui/ace_engine/frameworks/core/components_ng/test/pattern/ability_component:ability_component_pattern_test_ng" ]
24885b47fbSopenharmony_ci  cflags = []
25885b47fbSopenharmony_ci  if (target_cpu == "arm") {
26885b47fbSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
27885b47fbSopenharmony_ci  }
28885b47fbSopenharmony_ci  include_dirs = aams_mock_include_dirs
29885b47fbSopenharmony_ci  include_dirs += [
30885b47fbSopenharmony_ci    "${ability_runtime_inner_api_path}/ability_manager/include",
31885b47fbSopenharmony_ci    "../../../common/log/include",
32885b47fbSopenharmony_ci    "../include",
33885b47fbSopenharmony_ci    "./mock/include",
34885b47fbSopenharmony_ci    "../../acfwk/include",
35885b47fbSopenharmony_ci    "../../asacfwk/include",
36885b47fbSopenharmony_ci    "../../../interfaces/innerkits/aafwk/include",
37885b47fbSopenharmony_ci    "../../../interfaces/innerkits/acfwk/include",
38885b47fbSopenharmony_ci    "../../../interfaces/innerkits/asacfwk/include",
39885b47fbSopenharmony_ci    "../../../interfaces/innerkits/common/include",
40885b47fbSopenharmony_ci    "../../../services/aams/include",
41885b47fbSopenharmony_ci    "../../../common/interface/include",
42885b47fbSopenharmony_ci    "../../../common/interface/include/parcel",
43885b47fbSopenharmony_ci    "../../../services/test/mock/common",
44885b47fbSopenharmony_ci    "../../../services/test/mock/include/extern",
45885b47fbSopenharmony_ci    "../../../services/aams/test/mock/include",
46885b47fbSopenharmony_ci  ]
47885b47fbSopenharmony_ci
48885b47fbSopenharmony_ci  defines = [
49885b47fbSopenharmony_ci    "AAMS_LOG_TAG = \"accessibility_test\"",
50885b47fbSopenharmony_ci    "AAMS_LOG_DOMAIN = 0xD001D05",
51885b47fbSopenharmony_ci  ]
52885b47fbSopenharmony_ci
53885b47fbSopenharmony_ci  defines += accessibility_default_defines
54885b47fbSopenharmony_ci}
55885b47fbSopenharmony_ci
56885b47fbSopenharmony_ci###############################################################################
57885b47fbSopenharmony_ciohos_unittest("accessibility_ui_test_ability_impl_test") {
58885b47fbSopenharmony_ci  module_out_path = module_output_path
59885b47fbSopenharmony_ci  sources = [
60885b47fbSopenharmony_ci    "../../../services/test/mock/mock_accessible_ability_manager_service_stub.cpp",
61885b47fbSopenharmony_ci    "../../../services/test/mock/mock_bundle_manager.cpp",
62885b47fbSopenharmony_ci    "../../../services/test/mock/mock_service_registry.cpp",
63885b47fbSopenharmony_ci    "../src/accessibility_ui_test_ability_impl.cpp",
64885b47fbSopenharmony_ci    "./mock/src/mock_accessible_ability_client_impl.cpp",
65885b47fbSopenharmony_ci    "./mock/src/mock_accessible_ability_listener.cpp",
66885b47fbSopenharmony_ci    "unittest/accessibility_ui_test_ability_impl_test.cpp",
67885b47fbSopenharmony_ci  ]
68885b47fbSopenharmony_ci  sources += aams_mock_multimodalinput_src
69885b47fbSopenharmony_ci
70885b47fbSopenharmony_ci  configs = [
71885b47fbSopenharmony_ci    ":module_private_config",
72885b47fbSopenharmony_ci    "../../../resources/config/build:coverage_flags",
73885b47fbSopenharmony_ci  ]
74885b47fbSopenharmony_ci
75885b47fbSopenharmony_ci  deps = [
76885b47fbSopenharmony_ci    "../../../../../../third_party/googletest:gmock_main",
77885b47fbSopenharmony_ci    "../../../../../../third_party/googletest:gtest_main",
78885b47fbSopenharmony_ci    "../../../common/interface:accessibility_interface",
79885b47fbSopenharmony_ci    "../../../interfaces/innerkits/common:accessibility_common",
80885b47fbSopenharmony_ci  ]
81885b47fbSopenharmony_ci
82885b47fbSopenharmony_ci  external_deps = [
83885b47fbSopenharmony_ci    "ability_base:want",
84885b47fbSopenharmony_ci    "ability_base:zuri",
85885b47fbSopenharmony_ci    "ability_runtime:ability_manager",
86885b47fbSopenharmony_ci    "ability_runtime:abilitykit_native",
87885b47fbSopenharmony_ci    "ability_runtime:dataobs_manager",
88885b47fbSopenharmony_ci    "ability_runtime:extension_manager",
89885b47fbSopenharmony_ci    "bundle_framework:appexecfwk_core",
90885b47fbSopenharmony_ci    "c_utils:utils",
91885b47fbSopenharmony_ci    "data_share:datashare_common",
92885b47fbSopenharmony_ci    "data_share:datashare_consumer",
93885b47fbSopenharmony_ci    "eventhandler:libeventhandler",
94885b47fbSopenharmony_ci    "ffrt:libffrt",
95885b47fbSopenharmony_ci    "hilog:libhilog",
96885b47fbSopenharmony_ci    "init:libbeget_proxy",
97885b47fbSopenharmony_ci    "init:libbegetutil",
98885b47fbSopenharmony_ci    "ipc:ipc_core",
99885b47fbSopenharmony_ci    "os_account:os_account_innerkits",
100885b47fbSopenharmony_ci    "samgr:samgr_proxy",
101885b47fbSopenharmony_ci  ]
102885b47fbSopenharmony_ci}
103885b47fbSopenharmony_ci
104885b47fbSopenharmony_ci################################################################################
105885b47fbSopenharmony_ciohos_unittest("accessible_ability_test") {
106885b47fbSopenharmony_ci  module_out_path = module_output_path
107885b47fbSopenharmony_ci  sources = [
108885b47fbSopenharmony_ci    "../../../common/interface/src/accessibility_element_operator_callback_stub.cpp",
109885b47fbSopenharmony_ci    "../../../common/interface/src/accessible_ability_client_stub.cpp",
110885b47fbSopenharmony_ci    "../../../common/interface/src/accessible_ability_manager_service_proxy.cpp",
111885b47fbSopenharmony_ci    "../../../common/interface/src/parcel/accessibility_ability_info_parcel.cpp",
112885b47fbSopenharmony_ci    "../../../common/interface/src/parcel/accessibility_caption_parcel.cpp",
113885b47fbSopenharmony_ci    "../../../common/interface/src/parcel/accessibility_element_info_parcel.cpp",
114885b47fbSopenharmony_ci    "../../../common/interface/src/parcel/accessibility_event_info_parcel.cpp",
115885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_datashare_helper.cpp",
116885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_display_manager.cpp",
117885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_dumper.cpp",
118885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_power_manager.cpp",
119885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_setting_observer.cpp",
120885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_settings.cpp",
121885b47fbSopenharmony_ci    "../../../services/aams/src/accessibility_settings_config.cpp",
122885b47fbSopenharmony_ci    "../../../services/aams/src/accessible_ability_manager_service.cpp",
123885b47fbSopenharmony_ci    "../../../services/aams/src/accessible_ability_manager_service_event_handler.cpp",
124885b47fbSopenharmony_ci    "../../../services/aams/src/utils.cpp",
125885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_account_data.cpp",
126885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_common_event.cpp",
127885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_event_transmission.cpp",
128885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_input_interceptor.cpp",
129885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_setting_provider.cpp",
130885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_short_key.cpp",
131885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_short_key_dialog.cpp",
132885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_window_connection.cpp",
133885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessibility_window_manager.cpp",
134885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessible_ability_connection.cpp",
135885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessible_ability_manager_service_state_observer_proxy.cpp",
136885b47fbSopenharmony_ci    "../../../services/aams/test/mock/src/mock_accessible_ability_manager_service_state_observer_stub.cpp",
137885b47fbSopenharmony_ci    "../../../services/test/mock/mock_os_account_manager.cpp",
138885b47fbSopenharmony_ci    "../../../services/test/mock/mock_parameter.c",
139885b47fbSopenharmony_ci    "../../common/src/accessibility_caption.cpp",
140885b47fbSopenharmony_ci    "../../common/src/accessibility_constants.cpp",
141885b47fbSopenharmony_ci    "../../common/src/accessibility_element_info.cpp",
142885b47fbSopenharmony_ci    "../../common/src/accessibility_event_info.cpp",
143885b47fbSopenharmony_ci    "../../common/src/accessibility_gesture_inject_path.cpp",
144885b47fbSopenharmony_ci    "../../common/src/accessibility_window_info.cpp",
145885b47fbSopenharmony_ci    "../src/accessibility_element_operator_callback_impl.cpp",
146885b47fbSopenharmony_ci    "../src/accessibility_ui_test_ability_impl.cpp",
147885b47fbSopenharmony_ci    "../src/accessible_ability_channel_client.cpp",
148885b47fbSopenharmony_ci    "../src/accessible_ability_client_impl.cpp",
149885b47fbSopenharmony_ci    "./mock/src/mock_accessible_ability_channel_proxy.cpp",
150885b47fbSopenharmony_ci    "./mock/src/mock_accessible_ability_channel_stub.cpp",
151885b47fbSopenharmony_ci    "./mock/src/mock_accessible_ability_listener.cpp",
152885b47fbSopenharmony_ci    "unittest/accessibility_element_operator_callback_impl_test.cpp",
153885b47fbSopenharmony_ci    "unittest/accessible_ability_channel_client_test.cpp",
154885b47fbSopenharmony_ci    "unittest/accessible_ability_client_impl_test.cpp",
155885b47fbSopenharmony_ci  ]
156885b47fbSopenharmony_ci  sources += aams_mock_multimodalinput_src
157885b47fbSopenharmony_ci
158885b47fbSopenharmony_ci  configs = [
159885b47fbSopenharmony_ci    ":module_private_config",
160885b47fbSopenharmony_ci    "../../../resources/config/build:coverage_flags",
161885b47fbSopenharmony_ci  ]
162885b47fbSopenharmony_ci
163885b47fbSopenharmony_ci  deps = [
164885b47fbSopenharmony_ci    "../../../../../../third_party/googletest:gmock_main",
165885b47fbSopenharmony_ci    "../../../../../../third_party/googletest:gtest_main",
166885b47fbSopenharmony_ci    "../../../common/interface:accessibility_interface",
167885b47fbSopenharmony_ci    "../../../interfaces/innerkits/common:accessibility_common",
168885b47fbSopenharmony_ci  ]
169885b47fbSopenharmony_ci
170885b47fbSopenharmony_ci  external_deps = [
171885b47fbSopenharmony_ci    "ability_base:want",
172885b47fbSopenharmony_ci    "ability_base:zuri",
173885b47fbSopenharmony_ci    "ability_runtime:ability_manager",
174885b47fbSopenharmony_ci    "ability_runtime:abilitykit_native",
175885b47fbSopenharmony_ci    "ability_runtime:dataobs_manager",
176885b47fbSopenharmony_ci    "ability_runtime:extension_manager",
177885b47fbSopenharmony_ci    "c_utils:utils",
178885b47fbSopenharmony_ci    "data_share:datashare_common",
179885b47fbSopenharmony_ci    "data_share:datashare_consumer",
180885b47fbSopenharmony_ci    "display_manager:displaymgr",
181885b47fbSopenharmony_ci    "eventhandler:libeventhandler",
182885b47fbSopenharmony_ci    "ffrt:libffrt",
183885b47fbSopenharmony_ci    "graphic_2d:librender_service_client",
184885b47fbSopenharmony_ci    "hicollie:libhicollie",
185885b47fbSopenharmony_ci    "hilog:libhilog",
186885b47fbSopenharmony_ci    "hisysevent:libhisysevent",
187885b47fbSopenharmony_ci    "hitrace:hitrace_meter",
188885b47fbSopenharmony_ci    "ipc:ipc_core",
189885b47fbSopenharmony_ci    "os_account:os_account_innerkits",
190885b47fbSopenharmony_ci    "power_manager:powermgr_client",
191885b47fbSopenharmony_ci    "safwk:system_ability_fwk",
192885b47fbSopenharmony_ci    "samgr:samgr_proxy",
193885b47fbSopenharmony_ci    "window_manager:libdm",
194885b47fbSopenharmony_ci    "window_manager:libwm",
195885b47fbSopenharmony_ci  ]
196885b47fbSopenharmony_ci}
197885b47fbSopenharmony_ci
198885b47fbSopenharmony_ci###############################################################################
199885b47fbSopenharmony_ci
200885b47fbSopenharmony_cigroup("unittest") {
201885b47fbSopenharmony_ci  testonly = true
202885b47fbSopenharmony_ci  deps = []
203885b47fbSopenharmony_ci
204885b47fbSopenharmony_ci  deps += [
205885b47fbSopenharmony_ci    ":accessibility_ui_test_ability_impl_test",
206885b47fbSopenharmony_ci    ":accessible_ability_test",
207885b47fbSopenharmony_ci  ]
208885b47fbSopenharmony_ci}
209885b47fbSopenharmony_ci###############################################################################
210