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