• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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("../../../multimodalinput_mini.gni")
16
17module_output_path = "input/input"
18
19ohos_unittest("key_shortcut_rules_test") {
20  module_out_path = module_output_path
21  defines = input_default_defines
22
23  sources = [ "src/key_shortcut_rules_test.cpp" ]
24
25  cflags = [
26    "-Dprivate=public",
27    "-Dprotected=public",
28  ]
29
30  deps = [
31    "${mmi_path}/frameworks/proxy:libmmi-client",
32    "${mmi_path}/util:libmmi-util",
33  ]
34
35  external_deps = [
36    "c_utils:utilsbase",
37    "eventhandler:libeventhandler",
38    "googletest:gmock_main",
39    "googletest:gtest_main",
40    "hilog:libhilog",
41    "hilog:libhilog_base",
42    "ipc:ipc_core",
43  ]
44}
45
46ohos_unittest("InputActiveSubscriberHandlerTest") {
47  module_out_path = module_output_path
48
49  include_dirs = [
50    "${mmi_path}/service/connect_manager/include",
51    "${mmi_path}/service/event_handler/include",
52    "${mmi_path}/service/module_loader/include",
53    "${mmi_path}/service/subscriber/include",
54  ]
55
56  configs = [ "${mmi_path}:coverage_flags" ]
57
58  cflags = [
59    "-Dprivate=public",
60    "-Dprotected=public",
61  ]
62
63  sources = [ "input_active_subscriber_handler_test.cpp" ]
64
65  deps = [
66    "${mmi_path}/service:libmmi-server",
67    "${mmi_path}/util:libmmi-util",
68  ]
69
70  external_deps = [
71    "c_utils:utils",
72    "hilog:libhilog",
73    "googletest:gmock_main",
74    "googletest:gtest_main",
75    "hisysevent:libhisysevent",
76    "ipc:ipc_core",
77    "libinput:libinput-third-mmi",
78  ]
79}
80
81ohos_unittest("KeyGestureManagerTest") {
82  module_out_path = module_output_path
83
84  configs = [
85    "${mmi_path}:coverage_flags",
86    "${mmi_path}/service:libmmi_server_config",
87    "${mmi_path}/service/filter:mmi_event_filter_config",
88    "${mmi_path}/common/anco/comm:mmi_anco_channel_config",
89  ]
90
91  include_dirs = [
92    "${mmi_path}/libudev/include",
93    "${mmi_path}/service/account_manager/include",
94    "${mmi_path}/service/app_state_manager/include",
95    "${mmi_path}/service/display_state_manager/include",
96    "${mmi_path}/service/fingersense_wrapper/include",
97    "${mmi_path}/service/key_command/include",
98    "${mmi_path}/service/key_event_normalize/include",
99    "${mmi_path}/service/subscriber/include",
100    "${mmi_path}/service/timer_manager/include",
101    "${mmi_path}/service/window_manager/include",
102    "${mmi_path}/service/connect_manager/include",
103    "${mmi_path}/service/module_loader/include",
104    "${mmi_path}/test/facility/libinput_interface/include",
105  ]
106
107  sources = [
108    "${mmi_path}/service/app_state_manager/src/app_state_observer.cpp",
109    "${mmi_path}/service/subscriber/src/key_gesture_manager.cpp",
110    "${mmi_path}/service/subscriber/test/key_gesture_manager_test.cpp",
111    "${mmi_path}/service/timer_manager/src/timer_manager.cpp",
112  ]
113
114  cflags = [
115    "-Dprivate=public",
116    "-Dprotected=public",
117  ]
118
119  deps = [
120    "${mmi_path}/frameworks/proxy:libmmi-client",
121    "${mmi_path}/service:libmmi-server",
122    "${mmi_path}/test/facility/libinput_wrapper:libinput_wrapper_sources",
123    "${mmi_path}/test/facility/virtual_device:virtual_device_sources",
124    "${mmi_path}/util:libmmi-util",
125  ]
126
127  external_deps = [
128    "ability_runtime:app_manager",
129    "ability_runtime:dataobs_manager",
130    "cJSON:cjson",
131    "common_event_service:cesfwk_innerkits",
132    "hilog:libhilog",
133    "init:libbegetutil",
134    "ipc:ipc_core",
135    "libinput:libinput-third-mmi",
136    "samgr:samgr_proxy",
137  ]
138
139  if (input_feature_switch) {
140    external_deps += [
141      "graphic_2d:2d_graphics",
142      "graphic_2d:librender_service_client",
143    ]
144  }
145}
146
147group("mmi_subscriber_tests") {
148  testonly = true
149
150  deps = [
151    ":InputActiveSubscriberHandlerTest",
152    ":KeyGestureManagerTest",
153  ]
154  if (input_shortcut_key_rules_enabled) {
155    deps += [ ":key_shortcut_rules_test" ]
156  }
157}
158