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("../../../../common/config/common.gni") 16 17module_output_path = "enterprise_device_management/enterprise_device_management" 18 19ohos_unittest("EdmInnerApiUnitTest") { 20 module_out_path = module_output_path 21 22 include_dirs = [ 23 "./proxy/mock/include", 24 "../../common/mock/include", 25 ] 26 27 sources = [ 28 "../../common/mock/src/edm_sys_manager_mock.cpp", 29 "./common/domain_account_policy_test.cpp", 30 "./common/ent_info_test.cpp", 31 ] 32 33 configs = [ "../../../../common/config:coverage_flags" ] 34 35 deps = [ 36 "../../../../common/native:edm_commom", 37 "../../../../interfaces/inner_api:edmservice_kits", 38 "../../utils:edm_unittest_utils", 39 ] 40 41 external_deps = [ 42 "ability_base:want", 43 "access_token:libaccesstoken_sdk", 44 "access_token:libnativetoken", 45 "access_token:libtoken_setproc", 46 "bundle_framework:appexecfwk_base", 47 "bundle_framework:appexecfwk_core", 48 "c_utils:utils", 49 "googletest:gmock_main", 50 "hilog:libhilog", 51 "init:libbegetutil", 52 "ipc:ipc_core", 53 "samgr:samgr_proxy", 54 ] 55 56 defines = [] 57 if (os_account_edm_enable && netmanager_base_edm_enable && 58 netmanager_ext_edm_enable) { 59 external_deps += [ 60 "netmanager_base:net_conn_manager_if", 61 "os_account:os_account_innerkits", 62 ] 63 sources += [ 64 "./proxy/account_manager_proxy_test.cpp", 65 "./proxy/bundle_manager_proxy_test.cpp", 66 "./proxy/device_info_proxy_test.cpp", 67 "./proxy/enterprise_device_mgr_proxy_test.cpp", 68 "./proxy/mock/src/enterprise_device_mgr_stub_mock.cpp", 69 "./proxy/network_manager_proxy_test.cpp", 70 "./proxy/security_manager_proxy_test.cpp", 71 "./proxy/system_manager_proxy_test.cpp", 72 "./proxy/update_policy_utils_test.cpp", 73 ] 74 defines += [ 75 "OS_ACCOUNT_EDM_ENABLE", 76 "NETMANAGER_BASE_EDM_ENABLE", 77 ] 78 } 79 80 if (os_account_edm_enable && netmanager_base_edm_enable && 81 netmanager_ext_edm_enable && ability_runtime_edm_enable) { 82 sources += [ "./proxy/application_manager_proxy_test.cpp" ] 83 } 84 85 if (os_account_edm_enable && netmanager_base_edm_enable && 86 netmanager_ext_edm_enable && bluetooth_edm_enable) { 87 sources += [ "./proxy/bluetooth_manager_proxy_test.cpp" ] 88 } 89 90 if (os_account_edm_enable && netmanager_base_edm_enable && 91 netmanager_ext_edm_enable && common_event_service_edm_enable) { 92 sources += [ "./proxy/browser_proxy_test.cpp" ] 93 } 94 95 if (time_service_edm_enable && os_account_edm_enable && 96 netmanager_base_edm_enable && netmanager_ext_edm_enable) { 97 sources += [ "./proxy/datetime_manager_proxy_test.cpp" ] 98 } 99 100 if (os_account_edm_enable && netmanager_base_edm_enable && 101 netmanager_ext_edm_enable && screenlock_mgr_edm_enable && 102 power_manager_edm_enable && update_service_edm_enable) { 103 sources += [ "./proxy/device_control_proxy_test.cpp" ] 104 } 105 106 if (os_account_edm_enable && netmanager_base_edm_enable && 107 netmanager_ext_edm_enable && certificate_manager_edm_enable) { 108 sources += [ "./proxy/device_settings_proxy_test.cpp" ] 109 } 110 111 if (os_account_edm_enable && netmanager_base_edm_enable && 112 netmanager_ext_edm_enable && location_edm_enable) { 113 sources += [ "./proxy/location_manager_proxy_test.cpp" ] 114 } 115 116 if (os_account_edm_enable && netmanager_base_edm_enable && 117 netmanager_ext_edm_enable && audio_framework_edm_enable) { 118 sources += [ "./proxy/restrictions_proxy_test.cpp" ] 119 } 120 121 if (os_account_edm_enable && netmanager_base_edm_enable && 122 netmanager_ext_edm_enable && drivers_interface_usb_edm_enable && 123 usb_manager_edm_enable && storage_service_edm_enable) { 124 external_deps += [ "usb_manager:usbsrv_client" ] 125 sources += [ "./proxy/usb_manager_proxy_test.cpp" ] 126 defines += [ "USB_EDM_ENABLE" ] 127 } 128 129 if (os_account_edm_enable && netmanager_base_edm_enable && 130 netmanager_ext_edm_enable && wifi_edm_enable) { 131 external_deps += [ "wifi:wifi_sdk" ] 132 sources += [ "./proxy/wifi_manager_proxy_test.cpp" ] 133 defines += [ "WIFI_EDM_ENABLE" ] 134 } 135 136 sanitize = { 137 boundary_sanitize = true 138 cfi = true 139 cfi_cross_dso = true 140 debug = false 141 integer_overflow = true 142 ubsan = true 143 blocklist = "../../cfi_blocklist.txt" 144 } 145 branch_protector_ret = "pac_ret" 146 subsystem_name = "customization" 147 part_name = "enterprise_device_management" 148} 149 150group("unittest") { 151 testonly = true 152 153 deps = [ 154 # deps file 155 ":EdmInnerApiUnitTest", 156 ] 157} 158