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 = "multimodalinput/mmi_unit_out" 18 19ohos_unittest("key_shortcut_manager_test") { 20 module_out_path = module_output_path 21 defines = input_default_defines 22 23 include_dirs = [ 24 "include", 25 "${mmi_path}/interfaces/native/innerkits/proxy/include", 26 "${mmi_path}/service/app_state_manager/include", 27 "${mmi_path}/service/connect_manager/include", 28 "${mmi_path}/service/delegate_task/include", 29 "${mmi_path}/service/device_config/include", 30 "${mmi_path}/service/device_manager/include", 31 "${mmi_path}/service/display_state_manager/include", 32 "${mmi_path}/service/dfx/include", 33 "${mmi_path}/service/event_dispatch/include", 34 "${mmi_path}/service/event_handler/include", 35 "${mmi_path}/service/filter/include", 36 "${mmi_path}/service/fingersense_wrapper/include", 37 "${mmi_path}/service/hardware_cursor_pointer_manager/include", 38 "${mmi_path}/service/interceptor/include", 39 "${mmi_path}/service/key_command/include", 40 "${mmi_path}/service/key_event_normalize/include", 41 "${mmi_path}/service/module_loader/include", 42 "${mmi_path}/service/monitor/include", 43 "${mmi_path}/service/mouse_event_normalize/include", 44 "${mmi_path}/service/nap_process/include", 45 "${mmi_path}/service/subscriber/include", 46 "${mmi_path}/service/window_manager/include", 47 ] 48 49 if (input_ext_feature_anco) { 50 include_dirs += [ "${mmi_path}/common/anco/comm/include" ] 51 } 52 53 sources = [ 54 "${mmi_path}/service/app_state_manager/src/app_state_observer.cpp", 55 "${mmi_path}/service/device_config/src/device_config_file_parser.cpp", 56 "${mmi_path}/service/device_manager/src/input_device_manager.cpp", 57 "${mmi_path}/service/dfx/src/dfx_hisysevent.cpp", 58 "${mmi_path}/service/display_state_manager/src/display_event_monitor.cpp", 59 "${mmi_path}/service/subscriber/src/key_shortcut_manager.cpp", 60 "src/key_shortcut_manager_test.cpp", 61 "src/timer_manager.cpp", 62 ] 63 64 cflags = [ 65 "-Dprivate=public", 66 "-Dprotected=public", 67 ] 68 69 deps = [ "${mmi_path}/util:libmmi-util" ] 70 71 external_deps = [ 72 "ability_runtime:ability_manager", 73 "ability_runtime:app_manager", 74 "cJSON:cjson", 75 "c_utils:utils", 76 "config_policy:configpolicy_util", 77 "data_share:datashare_consumer", 78 "drivers_interface_display:libdisplay_composer_hdi_impl_1.2", 79 "drivers_interface_display:libdisplay_composer_proxy_1.0", 80 "eventhandler:libeventhandler", 81 "googletest:gmock_main", 82 "googletest:gtest_main", 83 "graphic_2d:2d_graphics", 84 "graphic_2d:libcomposer", 85 "graphic_2d:librender_service_base", 86 "graphic_2d:librender_service_client", 87 "graphic_2d:window_animation", 88 "hilog:libhilog", 89 "hisysevent:libhisysevent", 90 "ipc:ipc_core", 91 "ipc:ipc_single", 92 "libinput:libinput-third-mmi", 93 "preferences:native_preferences", 94 "safwk:system_ability_fwk", 95 "samgr:samgr_proxy", 96 "window_manager:libwm_lite", 97 ] 98} 99 100ohos_unittest("key_shortcut_rules_test") { 101 module_out_path = module_output_path 102 defines = input_default_defines 103 104 sources = [ "src/key_shortcut_rules_test.cpp" ] 105 106 cflags = [ 107 "-Dprivate=public", 108 "-Dprotected=public", 109 ] 110 111 deps = [ 112 "${mmi_path}/frameworks/proxy:libmmi-client", 113 "${mmi_path}/util:libmmi-util", 114 ] 115 116 external_deps = [ 117 "c_utils:utilsbase", 118 "eventhandler:libeventhandler", 119 "googletest:gmock_main", 120 "googletest:gtest_main", 121 "hilog:libhilog", 122 "hilog:libhilog_base", 123 "ipc:ipc_core", 124 ] 125} 126 127group("mmi_subscriber_tests") { 128 testonly = true 129 deps = [ ":key_shortcut_manager_test" ] 130 131 if (input_shortcut_key_rules_enabled) { 132 deps += [ ":key_shortcut_rules_test" ] 133 } 134} 135