1# Copyright (c) 2022-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("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni") 16 17config("config_svg_parse_test") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "$ace_root", 21 "$ace_root/frameworks", 22 ] 23} 24 25ohos_unittest("parse_test_ng") { 26 module_out_path = svg_test_output_path 27 sources = [ 28 "$ace_root/frameworks/base/base64/base64_util.cpp", 29 "$ace_root/frameworks/bridge/common/dom/dom_type.cpp", 30 "$ace_root/frameworks/bridge/common/utils/utils.cpp", 31 "$ace_root/frameworks/bridge/js_frontend/engine/common/js_constants.cpp", 32 "$ace_root/frameworks/core/animation/svg_animate.cpp", 33 "$ace_root/frameworks/core/components/svg/svg_transform.cpp", 34 "$ace_root/frameworks/core/components_ng/pattern/overlay/dialog_manager.cpp", 35 "$ace_root/frameworks/core/components_ng/pattern/overlay/sheet_manager.cpp", 36 "$ace_root/frameworks/core/components_ng/svg/parse/svg_animation.cpp", 37 "$ace_root/frameworks/core/components_ng/svg/parse/svg_attributes_parser.cpp", 38 "$ace_root/frameworks/core/components_ng/svg/parse/svg_circle.cpp", 39 "$ace_root/frameworks/core/components_ng/svg/parse/svg_clip_path.cpp", 40 "$ace_root/frameworks/core/components_ng/svg/parse/svg_constants.cpp", 41 "$ace_root/frameworks/core/components_ng/svg/parse/svg_ellipse.cpp", 42 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe.cpp", 43 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_blend.cpp", 44 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_color_matrix.cpp", 45 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_composite.cpp", 46 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_flood.cpp", 47 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_gaussian_blur.cpp", 48 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_offset.cpp", 49 "$ace_root/frameworks/core/components_ng/svg/parse/svg_filter.cpp", 50 "$ace_root/frameworks/core/components_ng/svg/parse/svg_g.cpp", 51 "$ace_root/frameworks/core/components_ng/svg/parse/svg_gradient.cpp", 52 "$ace_root/frameworks/core/components_ng/svg/parse/svg_graphic.cpp", 53 "$ace_root/frameworks/core/components_ng/svg/parse/svg_image.cpp", 54 "$ace_root/frameworks/core/components_ng/svg/parse/svg_line.cpp", 55 "$ace_root/frameworks/core/components_ng/svg/parse/svg_linear_gradient.cpp", 56 "$ace_root/frameworks/core/components_ng/svg/parse/svg_mask.cpp", 57 "$ace_root/frameworks/core/components_ng/svg/parse/svg_node.cpp", 58 "$ace_root/frameworks/core/components_ng/svg/parse/svg_path.cpp", 59 "$ace_root/frameworks/core/components_ng/svg/parse/svg_pattern.cpp", 60 "$ace_root/frameworks/core/components_ng/svg/parse/svg_polygon.cpp", 61 "$ace_root/frameworks/core/components_ng/svg/parse/svg_radial_gradient.cpp", 62 "$ace_root/frameworks/core/components_ng/svg/parse/svg_rect.cpp", 63 "$ace_root/frameworks/core/components_ng/svg/parse/svg_stop.cpp", 64 "$ace_root/frameworks/core/components_ng/svg/parse/svg_style.cpp", 65 "$ace_root/frameworks/core/components_ng/svg/parse/svg_svg.cpp", 66 "$ace_root/frameworks/core/components_ng/svg/parse/svg_transform.cpp", 67 "$ace_root/frameworks/core/components_ng/svg/parse/svg_use.cpp", 68 "$ace_root/frameworks/core/components_ng/svg/svg_context.cpp", 69 "$ace_root/frameworks/core/components_ng/svg/svg_dom.cpp", 70 "$ace_root/test/mock/adapter/mock_drawing_color_filter_ohos.cpp", 71 "$ace_root/test/mock/core/svg/moc_svg_colorfilter_effect.cpp", 72 "$ace_root/test/mock/core/svg/mock_image_painter_utils.cpp", 73 "$ace_root/test/mock/core/svg/mock_rosen_svg_painter.cpp", 74 "$ace_root/test/mock/core/svg/mock_shared_transition_effect.cpp", 75 "$ace_root/test/mock/core/svg/mock_svg_fit_convertor.cpp", 76 "$ace_root/test/mock/core/svg/mock_svg_utils.cpp", 77 "parse_test_ng.cpp", 78 "parse_testthree_ng.cpp", 79 "parse_testtwo_ng.cpp", 80 "parse_transform_test_ng.cpp", 81 "svg_manager_test_ng.cpp", 82 ] 83 defines = [ "USE_ROSEN_DRAWING" ] 84 if (ace_use_rosen_drawing) { 85 defines += [ 86 "ACE_ENABLE_GPU", 87 "NEW_SKIA", 88 ] 89 } 90 if (ace_engine_feature_enable_upgrade_skia) { 91 defines += [ "USE_NEW_SKIA" ] 92 } 93 94 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 95 96 external_deps = [ 97 "bounds_checking_function:libsec_static", 98 "eventhandler:libeventhandler", 99 "googletest:gmock", 100 "googletest:gtest_main", 101 "graphic_2d:librender_service_base", 102 "graphic_2d:librender_service_client", 103 ] 104 105 deps = [ 106 "$ace_root/test/unittest:ace_base", 107 "$ace_root/test/unittest:ace_components_base", 108 "$ace_root/test/unittest:ace_components_mock", 109 "$ace_root/test/unittest:ace_components_render", 110 "$ace_root/test/unittest:ace_core_animation", 111 "$ace_root/test/unittest:ace_core_extra", 112 ] 113 114 if (ability_runtime_graphics) { 115 external_deps += [ 116 "ability_runtime:runtime", 117 "image_framework:image_native", 118 "window_manager:libdm", 119 ] 120 } 121} 122 123ohos_unittest("svg_dom_test_ng") { 124 module_out_path = svg_test_output_path 125 126 sources = [ 127 "$ace_root/frameworks/bridge/common/dom/dom_type.cpp", 128 "$ace_root/frameworks/bridge/common/utils/utils.cpp", 129 "$ace_root/frameworks/bridge/js_frontend/engine/common/js_constants.cpp", 130 "$ace_root/frameworks/core/animation/svg_animate.cpp", 131 "$ace_root/frameworks/core/components/svg/svg_transform.cpp", 132 "$ace_root/frameworks/core/components_ng/pattern/overlay/dialog_manager.cpp", 133 "$ace_root/frameworks/core/components_ng/pattern/overlay/sheet_manager.cpp", 134 "$ace_root/frameworks/core/components_ng/svg/effect/svg_colorfilter_effect.cpp", 135 "$ace_root/frameworks/core/components_ng/svg/parse/svg_animation.cpp", 136 "$ace_root/frameworks/core/components_ng/svg/parse/svg_attributes_parser.cpp", 137 "$ace_root/frameworks/core/components_ng/svg/parse/svg_circle.cpp", 138 "$ace_root/frameworks/core/components_ng/svg/parse/svg_clip_path.cpp", 139 "$ace_root/frameworks/core/components_ng/svg/parse/svg_constants.cpp", 140 "$ace_root/frameworks/core/components_ng/svg/parse/svg_ellipse.cpp", 141 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe.cpp", 142 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_blend.cpp", 143 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_color_matrix.cpp", 144 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_composite.cpp", 145 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_flood.cpp", 146 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_gaussian_blur.cpp", 147 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_offset.cpp", 148 "$ace_root/frameworks/core/components_ng/svg/parse/svg_filter.cpp", 149 "$ace_root/frameworks/core/components_ng/svg/parse/svg_g.cpp", 150 "$ace_root/frameworks/core/components_ng/svg/parse/svg_gradient.cpp", 151 "$ace_root/frameworks/core/components_ng/svg/parse/svg_graphic.cpp", 152 "$ace_root/frameworks/core/components_ng/svg/parse/svg_image.cpp", 153 "$ace_root/frameworks/core/components_ng/svg/parse/svg_line.cpp", 154 "$ace_root/frameworks/core/components_ng/svg/parse/svg_linear_gradient.cpp", 155 "$ace_root/frameworks/core/components_ng/svg/parse/svg_mask.cpp", 156 "$ace_root/frameworks/core/components_ng/svg/parse/svg_node.cpp", 157 "$ace_root/frameworks/core/components_ng/svg/parse/svg_path.cpp", 158 "$ace_root/frameworks/core/components_ng/svg/parse/svg_pattern.cpp", 159 "$ace_root/frameworks/core/components_ng/svg/parse/svg_polygon.cpp", 160 "$ace_root/frameworks/core/components_ng/svg/parse/svg_radial_gradient.cpp", 161 "$ace_root/frameworks/core/components_ng/svg/parse/svg_rect.cpp", 162 "$ace_root/frameworks/core/components_ng/svg/parse/svg_stop.cpp", 163 "$ace_root/frameworks/core/components_ng/svg/parse/svg_style.cpp", 164 "$ace_root/frameworks/core/components_ng/svg/parse/svg_svg.cpp", 165 "$ace_root/frameworks/core/components_ng/svg/parse/svg_transform.cpp", 166 "$ace_root/frameworks/core/components_ng/svg/parse/svg_use.cpp", 167 "$ace_root/frameworks/core/components_ng/svg/svg_context.cpp", 168 "$ace_root/frameworks/core/components_ng/svg/svg_dom.cpp", 169 "$ace_root/frameworks/core/components_ng/svg/svg_utils.cpp", 170 "$ace_root/test/mock/adapter/mock_drawing_color_filter_ohos.cpp", 171 "$ace_root/test/mock/core/svg/mock_image_painter_utils.cpp", 172 "$ace_root/test/mock/core/svg/mock_rosen_svg_painter.cpp", 173 "$ace_root/test/mock/core/svg/mock_shared_transition_effect.cpp", 174 "$ace_root/test/mock/core/svg/mock_svg_fit_convertor.cpp", 175 "svg_dom_test_ng.cpp", 176 ] 177 178 defines = [ "USE_ROSEN_DRAWING" ] 179 180 configs = [ 181 ":config_svg_parse_test", 182 "$ace_root/test/unittest:ace_unittest_config", 183 ] 184 185 external_deps = [ 186 "bounds_checking_function:libsec_static", 187 "eventhandler:libeventhandler", 188 "googletest:gmock", 189 "googletest:gtest_main", 190 "graphic_2d:librender_service_base", 191 "graphic_2d:librender_service_client", 192 ] 193 194 deps = [ 195 "$ace_root/test/unittest:ace_base", 196 "$ace_root/test/unittest:ace_components_base", 197 "$ace_root/test/unittest:ace_components_mock", 198 "$ace_root/test/unittest:ace_components_render", 199 "$ace_root/test/unittest:ace_core_animation", 200 "$ace_root/test/unittest:ace_core_extra", 201 ] 202} 203 204ohos_unittest("svg_utils_test_ng") { 205 module_out_path = svg_test_output_path 206 207 sources = [ 208 "$ace_root/frameworks/core/components_ng/pattern/overlay/dialog_manager.cpp", 209 "$ace_root/frameworks/core/components_ng/pattern/overlay/sheet_manager.cpp", 210 "$ace_root/frameworks/core/components_ng/svg/svg_utils.cpp", 211 "svg_utils_test_ng.cpp", 212 ] 213 214 defines = [ "USE_ROSEN_DRAWING" ] 215 216 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 217 218 external_deps = [ 219 "bounds_checking_function:libsec_static", 220 "eventhandler:libeventhandler", 221 "googletest:gmock", 222 "googletest:gtest_main", 223 "graphic_2d:librender_service_base", 224 "graphic_2d:librender_service_client", 225 ] 226 227 deps = [ 228 "$ace_root/test/unittest:ace_base", 229 "$ace_root/test/unittest:ace_components_base", 230 "$ace_root/test/unittest:ace_components_mock", 231 "$ace_root/test/unittest:ace_components_render", 232 "$ace_root/test/unittest:ace_core_animation", 233 "$ace_root/test/unittest:ace_core_extra", 234 ] 235} 236 237ohos_unittest("svg_context_test_ng") { 238 module_out_path = svg_test_output_path 239 240 sources = [ 241 "$ace_root/frameworks/base/base64/base64_util.cpp", 242 "$ace_root/frameworks/bridge/common/dom/dom_type.cpp", 243 "$ace_root/frameworks/core/animation/svg_animate.cpp", 244 "$ace_root/frameworks/core/components/svg/svg_transform.cpp", 245 "$ace_root/frameworks/core/components_ng/pattern/overlay/dialog_manager.cpp", 246 "$ace_root/frameworks/core/components_ng/pattern/overlay/sheet_manager.cpp", 247 "$ace_root/frameworks/core/components_ng/svg/effect/svg_colorfilter_effect.cpp", 248 "$ace_root/frameworks/core/components_ng/svg/parse/svg_animation.cpp", 249 "$ace_root/frameworks/core/components_ng/svg/parse/svg_attributes_parser.cpp", 250 "$ace_root/frameworks/core/components_ng/svg/parse/svg_circle.cpp", 251 "$ace_root/frameworks/core/components_ng/svg/parse/svg_clip_path.cpp", 252 "$ace_root/frameworks/core/components_ng/svg/parse/svg_constants.cpp", 253 "$ace_root/frameworks/core/components_ng/svg/parse/svg_ellipse.cpp", 254 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe.cpp", 255 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_blend.cpp", 256 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_color_matrix.cpp", 257 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_composite.cpp", 258 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_flood.cpp", 259 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_gaussian_blur.cpp", 260 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_offset.cpp", 261 "$ace_root/frameworks/core/components_ng/svg/parse/svg_filter.cpp", 262 "$ace_root/frameworks/core/components_ng/svg/parse/svg_g.cpp", 263 "$ace_root/frameworks/core/components_ng/svg/parse/svg_gradient.cpp", 264 "$ace_root/frameworks/core/components_ng/svg/parse/svg_graphic.cpp", 265 "$ace_root/frameworks/core/components_ng/svg/parse/svg_image.cpp", 266 "$ace_root/frameworks/core/components_ng/svg/parse/svg_line.cpp", 267 "$ace_root/frameworks/core/components_ng/svg/parse/svg_mask.cpp", 268 "$ace_root/frameworks/core/components_ng/svg/parse/svg_node.cpp", 269 "$ace_root/frameworks/core/components_ng/svg/parse/svg_path.cpp", 270 "$ace_root/frameworks/core/components_ng/svg/parse/svg_pattern.cpp", 271 "$ace_root/frameworks/core/components_ng/svg/parse/svg_polygon.cpp", 272 "$ace_root/frameworks/core/components_ng/svg/parse/svg_rect.cpp", 273 "$ace_root/frameworks/core/components_ng/svg/parse/svg_stop.cpp", 274 "$ace_root/frameworks/core/components_ng/svg/parse/svg_style.cpp", 275 "$ace_root/frameworks/core/components_ng/svg/parse/svg_svg.cpp", 276 "$ace_root/frameworks/core/components_ng/svg/parse/svg_transform.cpp", 277 "$ace_root/frameworks/core/components_ng/svg/parse/svg_use.cpp", 278 "$ace_root/frameworks/core/components_ng/svg/svg_context.cpp", 279 "$ace_root/frameworks/core/components_ng/svg/svg_dom.cpp", 280 "$ace_root/frameworks/core/components_ng/svg/svg_fit_convertor.cpp", 281 "$ace_root/frameworks/core/components_ng/svg/svg_utils.cpp", 282 "$ace_root/test/mock/core/svg/mock_image_painter_utils.cpp", 283 "$ace_root/test/mock/core/svg/mock_rosen_svg_painter.cpp", 284 "svg_context_test_ng.cpp", 285 ] 286 287 defines = [ "USE_ROSEN_DRAWING" ] 288 289 if (ace_engine_feature_enable_upgrade_skia) { 290 defines += [ "USE_NEW_SKIA" ] 291 } 292 293 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 294 295 external_deps = [ 296 "bounds_checking_function:libsec_static", 297 "eventhandler:libeventhandler", 298 "googletest:gmock", 299 "googletest:gtest_main", 300 "graphic_2d:librender_service_base", 301 "graphic_2d:librender_service_client", 302 ] 303 304 deps = [ 305 "$ace_root/test/unittest:ace_base", 306 "$ace_root/test/unittest:ace_components_base", 307 "$ace_root/test/unittest:ace_components_mock", 308 "$ace_root/test/unittest:ace_components_render", 309 "$ace_root/test/unittest:ace_core_animation", 310 "$ace_root/test/unittest:ace_core_extra", 311 ] 312} 313 314ohos_unittest("svg_node_test_ng") { 315 module_out_path = svg_test_output_path 316 317 sources = [ 318 "$ace_root/frameworks/base/base64/base64_util.cpp", 319 "$ace_root/frameworks/bridge/common/dom/dom_type.cpp", 320 "$ace_root/frameworks/bridge/common/utils/utils.cpp", 321 "$ace_root/frameworks/core/animation/svg_animate.cpp", 322 "$ace_root/frameworks/core/components/svg/svg_transform.cpp", 323 "$ace_root/frameworks/core/components_ng/pattern/overlay/dialog_manager.cpp", 324 "$ace_root/frameworks/core/components_ng/pattern/overlay/sheet_manager.cpp", 325 "$ace_root/frameworks/core/components_ng/svg/effect/svg_colorfilter_effect.cpp", 326 "$ace_root/frameworks/core/components_ng/svg/parse/svg_animation.cpp", 327 "$ace_root/frameworks/core/components_ng/svg/parse/svg_attributes_parser.cpp", 328 "$ace_root/frameworks/core/components_ng/svg/parse/svg_circle.cpp", 329 "$ace_root/frameworks/core/components_ng/svg/parse/svg_clip_path.cpp", 330 "$ace_root/frameworks/core/components_ng/svg/parse/svg_constants.cpp", 331 "$ace_root/frameworks/core/components_ng/svg/parse/svg_ellipse.cpp", 332 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe.cpp", 333 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_blend.cpp", 334 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_color_matrix.cpp", 335 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_composite.cpp", 336 "$ace_root/frameworks/core/components_ng/svg/parse/svg_fe_offset.cpp", 337 "$ace_root/frameworks/core/components_ng/svg/parse/svg_filter.cpp", 338 "$ace_root/frameworks/core/components_ng/svg/parse/svg_g.cpp", 339 "$ace_root/frameworks/core/components_ng/svg/parse/svg_gradient.cpp", 340 "$ace_root/frameworks/core/components_ng/svg/parse/svg_graphic.cpp", 341 "$ace_root/frameworks/core/components_ng/svg/parse/svg_image.cpp", 342 "$ace_root/frameworks/core/components_ng/svg/parse/svg_line.cpp", 343 "$ace_root/frameworks/core/components_ng/svg/parse/svg_linear_gradient.cpp", 344 "$ace_root/frameworks/core/components_ng/svg/parse/svg_mask.cpp", 345 "$ace_root/frameworks/core/components_ng/svg/parse/svg_node.cpp", 346 "$ace_root/frameworks/core/components_ng/svg/parse/svg_path.cpp", 347 "$ace_root/frameworks/core/components_ng/svg/parse/svg_pattern.cpp", 348 "$ace_root/frameworks/core/components_ng/svg/parse/svg_polygon.cpp", 349 "$ace_root/frameworks/core/components_ng/svg/parse/svg_radial_gradient.cpp", 350 "$ace_root/frameworks/core/components_ng/svg/parse/svg_rect.cpp", 351 "$ace_root/frameworks/core/components_ng/svg/parse/svg_stop.cpp", 352 "$ace_root/frameworks/core/components_ng/svg/parse/svg_svg.cpp", 353 "$ace_root/frameworks/core/components_ng/svg/parse/svg_transform.cpp", 354 "$ace_root/frameworks/core/components_ng/svg/parse/svg_use.cpp", 355 "$ace_root/frameworks/core/components_ng/svg/svg_context.cpp", 356 "$ace_root/frameworks/core/components_ng/svg/svg_dom.cpp", 357 "$ace_root/frameworks/core/components_ng/svg/svg_fit_convertor.cpp", 358 "$ace_root/frameworks/core/components_ng/svg/svg_utils.cpp", 359 "$ace_root/test/mock/adapter/mock_drawing_color_filter_ohos.cpp", 360 "$ace_root/test/mock/core/svg/mock_image_painter_utils.cpp", 361 "$ace_root/test/mock/core/svg/mock_rosen_svg_painter.cpp", 362 "$ace_root/test/mock/core/svg/mock_shared_transition_effect.cpp", 363 "svg_node_test_ng.cpp", 364 ] 365 366 defines = [ "USE_ROSEN_DRAWING" ] 367 368 if (ace_engine_feature_enable_upgrade_skia) { 369 defines += [ "USE_NEW_SKIA" ] 370 } 371 372 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 373 374 external_deps = [ 375 "bounds_checking_function:libsec_static", 376 "eventhandler:libeventhandler", 377 "googletest:gmock", 378 "googletest:gtest_main", 379 "graphic_2d:librender_service_base", 380 "graphic_2d:librender_service_client", 381 ] 382 383 deps = [ 384 "$ace_root/test/unittest:ace_base", 385 "$ace_root/test/unittest:ace_components_base", 386 "$ace_root/test/unittest:ace_components_mock", 387 "$ace_root/test/unittest:ace_components_render", 388 "$ace_root/test/unittest:ace_core_animation", 389 "$ace_root/test/unittest:ace_core_extra", 390 ] 391} 392 393group("core_svg_unittest") { 394 testonly = true 395 deps = [ 396 ":parse_test_ng", 397 ":svg_context_test_ng", 398 ":svg_dom_test_ng", 399 ":svg_node_test_ng", 400 ":svg_utils_test_ng", 401 ] 402} 403