1# Copyright (c) 2024-2025 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("//foundation/multimedia/player_framework/config.gni") 16 17module_output_path = "player_framework/audio_framework_policy" 18 19ohos_unittest("audio_haptic_unit_test") { 20 module_out_path = module_output_path 21 include_dirs = [ 22 "./", 23 "./../../../frameworks/native/audio_haptic", 24 "./../../../interfaces/inner_api/native", 25 "./../../../interfaces/inner_api/native/audio_haptic/include", 26 "./../common/include", 27 ] 28 29 cflags = [ 30 "-Wall", 31 "-Werror", 32 "-fno-access-control", 33 ] 34 35 sources = [ 36 "audio_haptic_manager_impl_unit_test.cpp", 37 "audio_haptic_unit_test.cpp", 38 "./../common/src/audio_haptic_test_common.cpp", 39 ] 40 41 deps = [ 42 "./../../../frameworks/native/audio_haptic:audio_haptic", 43 "./../../../frameworks/native/soundpool:soundpool_client", 44 "./../../../interfaces/inner_api/native:media_client", 45 ] 46 47 external_deps = [ 48 "access_token:libaccesstoken_sdk", 49 "access_token:libnativetoken_shared", 50 "access_token:libtokensetproc_shared", 51 "audio_framework:audio_client", 52 "graphic_surface:surface", 53 "hilog:libhilog", 54 ] 55 56 resource_config_file = "./../resources/ohos_test.xml" 57} 58 59ohos_unittest("audio_haptic_sound_normal_impl_unit_test") { 60 module_out_path = module_output_path 61 include_dirs = [ 62 "./", 63 "./../../../frameworks/native/audio_haptic", 64 ] 65 66 cflags = [ 67 "-Wall", 68 "-Werror", 69 "-fno-access-control", 70 ] 71 72 sources = [ "audio_haptic_sound_normal_impl_unit_test.cpp" ] 73 74 deps = [ 75 "./../../../frameworks/native/audio_haptic:audio_haptic", 76 "./../../../frameworks/native/soundpool:soundpool_client", 77 "./../../../interfaces/inner_api/native:media_client", 78 ] 79 80 external_deps = [ 81 "access_token:libaccesstoken_sdk", 82 "access_token:libnativetoken_shared", 83 "access_token:libtokensetproc_shared", 84 "audio_framework:audio_client", 85 "graphic_surface:surface", 86 "hilog:libhilog", 87 ] 88 89 resource_config_file = "./../resources/ohos_test.xml" 90} 91 92ohos_unittest("audio_haptic_sound_low_latency_impl_unit_test") { 93 module_out_path = module_output_path 94 include_dirs = [ 95 "./", 96 "./../../../frameworks/native/audio_haptic", 97 "./../../../interfaces/inner_api/native/soundpool/include", 98 ] 99 100 cflags = [ 101 "-Wall", 102 "-Werror", 103 "-fno-access-control", 104 ] 105 106 sources = [ "audio_haptic_sound_low_latency_impl_unit_test.cpp" ] 107 108 deps = [ 109 "./../../../frameworks/native/audio_haptic:audio_haptic", 110 "./../../../frameworks/native/soundpool:soundpool_client", 111 "./../../../interfaces/inner_api/native:media_client", 112 ] 113 114 external_deps = [ 115 "access_token:libaccesstoken_sdk", 116 "access_token:libnativetoken_shared", 117 "access_token:libtokensetproc_shared", 118 "audio_framework:audio_client", 119 "graphic_surface:surface", 120 "hilog:libhilog", 121 ] 122 123 resource_config_file = "./../resources/ohos_test.xml" 124} 125 126ohos_unittest("audio_haptic_player_impl_unit_test") { 127 module_out_path = module_output_path 128 include_dirs = [ 129 "./", 130 "./../../../frameworks/native/audio_haptic", 131 ] 132 133 cflags = [ 134 "-Wall", 135 "-Werror", 136 "-fno-access-control", 137 ] 138 139 sources = [ "audio_haptic_player_impl_unit_test.cpp" ] 140 141 deps = [ 142 "./../../../frameworks/native/audio_haptic:audio_haptic", 143 "./../../../frameworks/native/soundpool:soundpool_client", 144 "./../../../interfaces/inner_api/native:media_client", 145 ] 146 147 external_deps = [ 148 "access_token:libaccesstoken_sdk", 149 "access_token:libnativetoken_shared", 150 "access_token:libtokensetproc_shared", 151 "audio_framework:audio_client", 152 "graphic_surface:surface", 153 "hilog:libhilog", 154 "miscdevice:vibrator_interface_native", 155 ] 156 157 resource_config_file = "./../resources/ohos_test.xml" 158} 159 160ohos_unittest("audio_haptic_vibrator_impl_unit_test") { 161 module_out_path = module_output_path 162 include_dirs = [ 163 "./", 164 "./../../../frameworks/native/audio_haptic", 165 "./../common/include", 166 ] 167 168 cflags = [ 169 "-Wall", 170 "-Werror", 171 "-fno-access-control", 172 ] 173 174 sources = [ 175 "audio_haptic_vibrator_impl_unit_test.cpp", 176 "./../common/src/audio_haptic_test_common.cpp", 177 ] 178 179 deps = [ 180 "./../../../frameworks/native/audio_haptic:audio_haptic", 181 "./../../../frameworks/native/soundpool:soundpool_client", 182 "./../../../interfaces/inner_api/native:media_client", 183 ] 184 185 external_deps = [ 186 "access_token:libaccesstoken_sdk", 187 "access_token:libnativetoken_shared", 188 "access_token:libtokensetproc_shared", 189 "audio_framework:audio_client", 190 "graphic_surface:surface", 191 "hilog:libhilog", 192 "miscdevice:vibrator_interface_native", 193 ] 194 195 defines = [ "SUPPORT_VIBRATOR" ] 196 197 resource_config_file = "./../resources/ohos_test.xml" 198} 199