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("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni") 15 16config("rosen_render_context_config") { 17 visibility = [ "./*" ] 18 include_dirs = [ 19 "$ace_root", 20 "$ace_root/frameworks", 21 "$root_out_dir/arkui/framework", 22 ] 23 24 cflags_cc = [ 25 "-Wno-unused-private-field", 26 "-Wno-thread-safety-attributes", 27 "-Wno-thread-safety-analysis", 28 "-Wno-non-c-typedef-for-linkage", 29 "-fvisibility-inlines-hidden", 30 ] 31 32 cflags = [ 33 "-fvisibility=hidden", 34 "-fdata-sections", 35 "-ffunction-sections", 36 "-g", 37 ] 38 39 ldflags = [ "-Wl,--gc-sections,--as-needed" ] 40 41 if (ace_engine_feature_enable_coverage) { 42 cflags += [ "--coverage" ] 43 ldflags += [ "--coverage" ] 44 } 45 46 defines = [ 47 "OHOS_STANDARD_SYSTEM", 48 "ENABLE_ROSEN_BACKEND", 49 ] 50} 51 52ohos_source_set("rosen_render_context_test_mock") { 53 testonly = true 54 subsystem_name = ace_engine_subsystem 55 part_name = ace_engine_part 56 sources = [ 57 "$ace_root/frameworks/core/components_ng/render/image_painter.cpp", 58 "$ace_root/test/mock/core/common/mock_theme_utils.cpp", 59 "$ace_root/test/unittest/core/rosen/mock_animated_image.cpp", 60 "$ace_root/test/unittest/core/rosen/mock_pixmap_image.cpp", 61 ] 62 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 63} 64 65ohos_unittest("arkui_rosen_render_context_test") { 66 module_out_path = adapter_test_output_path 67 sources = [ 68 "$ace_root/frameworks/core/animation/native_curve_helper.cpp", 69 "$ace_root/frameworks/core/common/font_manager.cpp", 70 "$ace_root/frameworks/core/components/common/painter/debug_boundary_painter.cpp", 71 "$ace_root/frameworks/core/components_ng/animation/geometry_transition.cpp", 72 "$ace_root/frameworks/core/components_ng/image_provider/image_state_manager.cpp", 73 "$ace_root/frameworks/core/components_ng/pattern/particle/particle_pattern.cpp", 74 "$ace_root/frameworks/core/components_ng/render/adapter/component_snapshot.cpp", 75 "$ace_root/frameworks/core/components_ng/render/adapter/gradient_style_modifier.cpp", 76 "$ace_root/frameworks/core/components_ng/render/adapter/moon_progress_modifier.cpp", 77 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.cpp", 78 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_image.cpp", 79 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp", 80 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_adapter.cpp", 81 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_property.cpp", 82 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_render_context.cpp", 83 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_transition_effect.cpp", 84 "$ace_root/frameworks/core/components_ng/render/border_image_painter.cpp", 85 "$ace_root/frameworks/core/components_ng/render/circle_painter.cpp", 86 "$ace_root/frameworks/core/components_ng/render/debug_boundary_painter.cpp", 87 "$ace_root/frameworks/core/components_ng/render/divider_painter.cpp", 88 "$ace_root/frameworks/core/components_ng/render/drawing_prop_convertor.cpp", 89 "$ace_root/frameworks/core/components_ng/render/ellipse_painter.cpp", 90 "$ace_root/frameworks/core/components_ng/render/line_painter.cpp", 91 "$ace_root/frameworks/core/components_ng/render/paint_wrapper.cpp", 92 "$ace_root/frameworks/core/components_ng/render/polygon_painter.cpp", 93 "$ace_root/frameworks/core/components_ng/render/rect_painter.cpp", 94 "$ace_root/frameworks/core/components_ng/render/render_context.cpp", 95 "$ace_root/frameworks/core/components_ng/render/render_context_creator.cpp", 96 "$ace_root/frameworks/core/components_ng/render/render_property.cpp", 97 "$ace_root/frameworks/core/components_ng/render/shape_painter.cpp", 98 "$ace_root/test/mock/base/mock_ace_performance_check.cpp", 99 "$ace_root/test/mock/base/mock_ace_performance_monitor.cpp", 100 "$ace_root/test/mock/base/mock_engine_helper.cpp", 101 "$ace_root/test/mock/base/mock_foldable_window.cpp", 102 "$ace_root/test/mock/base/mock_frame_trace_adapter.cpp", 103 "$ace_root/test/mock/base/mock_image_source.cpp", 104 "$ace_root/test/mock/base/mock_jank_frame_report.cpp", 105 "$ace_root/test/mock/base/mock_localization.cpp", 106 "$ace_root/test/mock/base/mock_pixel_map.cpp", 107 "$ace_root/test/mock/base/mock_ressched_report.cpp", 108 "$ace_root/test/mock/base/mock_subwindow.cpp", 109 "$ace_root/test/mock/base/mock_system_properties.cpp", 110 "$ace_root/test/mock/core/common/mock_ace_application_info.cpp", 111 "$ace_root/test/mock/core/common/mock_ace_engine.cpp", 112 "$ace_root/test/mock/core/common/mock_ace_engine_ext.cpp", 113 "$ace_root/test/mock/core/common/mock_clipboard.cpp", 114 "$ace_root/test/mock/core/common/mock_container.cpp", 115 "$ace_root/test/mock/core/common/mock_data_detector_adapter.cpp", 116 "$ace_root/test/mock/core/common/mock_font_loader_ng.cpp", 117 "$ace_root/test/mock/core/common/mock_image_analyzer_manager.cpp", 118 "$ace_root/test/mock/core/common/mock_interaction.cpp", 119 "$ace_root/test/mock/core/common/mock_layout_inspector.cpp", 120 "$ace_root/test/mock/core/common/mock_motion_path_evaluator.cpp", 121 "$ace_root/test/mock/core/common/mock_udmf.cpp", 122 "$ace_root/test/mock/core/event/mock_touch_event.cpp", 123 "$ace_root/test/mock/core/image_provider/mock_image_loading_context.cpp", 124 "$ace_root/test/mock/core/image_provider/mock_image_source_info.cpp", 125 "$ace_root/test/mock/core/pipeline/mock_element_register.cpp", 126 "$ace_root/test/mock/core/pipeline/mock_pipeline_context.cpp", 127 "$ace_root/test/mock/core/render/mock_font_collection.cpp", 128 "$ace_root/test/mock/core/render/mock_paragraph.cpp", 129 "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", 130 "$ace_root/test/unittest/core/pattern/text/mock/mock_text_layout_adapter.cpp", 131 "$ace_root/test/unittest/core/pipeline/mock_input_method_manager.cpp", 132 "$ace_root/test/unittest/core/rosen/mock_internal_resource.cpp", 133 "rosen_render_context_test.cpp", 134 "rosen_render_context_test_new.cpp", 135 ] 136 137 configs = [ ":rosen_render_context_config" ] 138 139 deps = [ 140 ":rosen_render_context_test_mock", 141 "$ace_root/test/unittest:ace_base", 142 "$ace_root/test/unittest:ace_components_base", 143 "$ace_root/test/unittest:ace_components_event", 144 "$ace_root/test/unittest:ace_components_gestures", 145 "$ace_root/test/unittest:ace_components_layout", 146 "$ace_root/test/unittest:ace_components_manager", 147 "$ace_root/test/unittest:ace_components_pattern", 148 "$ace_root/test/unittest:ace_components_property", 149 "$ace_root/test/unittest:ace_components_syntax", 150 "$ace_root/test/unittest:ace_core_animation", 151 "$ace_root/test/unittest:ace_core_extra", 152 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 153 "$ace_root/test/unittest:ace_unittest_log", 154 "$ace_root/test/unittest:ace_unittest_trace", 155 "//third_party/googletest:gmock_main", 156 ] 157 158 external_deps = [ 159 "graphic_2d:2d_graphics", 160 "graphic_2d:librender_service_client", 161 "skia:skia_canvaskit", 162 ] 163 if (defined(use_rosen_drawing) && use_rosen_drawing) { 164 defines = [ "USE_ROSEN_DRAWING" ] 165 } 166} 167 168ohos_unittest("gradient_style_modifier_test") { 169 module_out_path = adapter_test_output_path 170 sources = [ 171 "$ace_root/frameworks/core/animation/native_curve_helper.cpp", 172 "$ace_root/frameworks/core/common/font_manager.cpp", 173 "$ace_root/frameworks/core/components/common/painter/debug_boundary_painter.cpp", 174 "$ace_root/frameworks/core/components_ng/animation/geometry_transition.cpp", 175 "$ace_root/frameworks/core/components_ng/image_provider/image_state_manager.cpp", 176 "$ace_root/frameworks/core/components_ng/pattern/particle/particle_pattern.cpp", 177 "$ace_root/frameworks/core/components_ng/render/adapter/component_snapshot.cpp", 178 "$ace_root/frameworks/core/components_ng/render/adapter/gradient_style_modifier.cpp", 179 "$ace_root/frameworks/core/components_ng/render/adapter/moon_progress_modifier.cpp", 180 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.cpp", 181 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_image.cpp", 182 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp", 183 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_adapter.cpp", 184 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_property.cpp", 185 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_render_context.cpp", 186 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_transition_effect.cpp", 187 "$ace_root/frameworks/core/components_ng/render/border_image_painter.cpp", 188 "$ace_root/frameworks/core/components_ng/render/circle_painter.cpp", 189 "$ace_root/frameworks/core/components_ng/render/debug_boundary_painter.cpp", 190 "$ace_root/frameworks/core/components_ng/render/divider_painter.cpp", 191 "$ace_root/frameworks/core/components_ng/render/drawing_prop_convertor.cpp", 192 "$ace_root/frameworks/core/components_ng/render/ellipse_painter.cpp", 193 "$ace_root/frameworks/core/components_ng/render/image_painter.cpp", 194 "$ace_root/frameworks/core/components_ng/render/line_painter.cpp", 195 "$ace_root/frameworks/core/components_ng/render/paint_wrapper.cpp", 196 "$ace_root/frameworks/core/components_ng/render/polygon_painter.cpp", 197 "$ace_root/frameworks/core/components_ng/render/rect_painter.cpp", 198 "$ace_root/frameworks/core/components_ng/render/render_context.cpp", 199 "$ace_root/frameworks/core/components_ng/render/render_context_creator.cpp", 200 "$ace_root/frameworks/core/components_ng/render/render_property.cpp", 201 "$ace_root/frameworks/core/components_ng/render/shape_painter.cpp", 202 "$ace_root/test/mock/base/mock_ace_performance_check.cpp", 203 "$ace_root/test/mock/base/mock_ace_performance_monitor.cpp", 204 "$ace_root/test/mock/base/mock_engine_helper.cpp", 205 "$ace_root/test/mock/base/mock_foldable_window.cpp", 206 "$ace_root/test/mock/base/mock_frame_trace_adapter.cpp", 207 "$ace_root/test/mock/base/mock_image_source.cpp", 208 "$ace_root/test/mock/base/mock_jank_frame_report.cpp", 209 "$ace_root/test/mock/base/mock_localization.cpp", 210 "$ace_root/test/mock/base/mock_pixel_map.cpp", 211 "$ace_root/test/mock/base/mock_ressched_report.cpp", 212 "$ace_root/test/mock/base/mock_subwindow.cpp", 213 "$ace_root/test/mock/base/mock_system_properties.cpp", 214 "$ace_root/test/mock/core/common/mock_ace_application_info.cpp", 215 "$ace_root/test/mock/core/common/mock_ace_engine.cpp", 216 "$ace_root/test/mock/core/common/mock_ace_engine_ext.cpp", 217 "$ace_root/test/mock/core/common/mock_clipboard.cpp", 218 "$ace_root/test/mock/core/common/mock_container.cpp", 219 "$ace_root/test/mock/core/common/mock_data_detector_adapter.cpp", 220 "$ace_root/test/mock/core/common/mock_font_loader_ng.cpp", 221 "$ace_root/test/mock/core/common/mock_image_analyzer_manager.cpp", 222 "$ace_root/test/mock/core/common/mock_interaction.cpp", 223 "$ace_root/test/mock/core/common/mock_layout_inspector.cpp", 224 "$ace_root/test/mock/core/common/mock_motion_path_evaluator.cpp", 225 "$ace_root/test/mock/core/common/mock_theme_utils.cpp", 226 "$ace_root/test/mock/core/common/mock_udmf.cpp", 227 "$ace_root/test/mock/core/event/mock_touch_event.cpp", 228 "$ace_root/test/mock/core/image_provider/mock_image_loading_context.cpp", 229 "$ace_root/test/mock/core/image_provider/mock_image_source_info.cpp", 230 "$ace_root/test/mock/core/pipeline/mock_element_register.cpp", 231 "$ace_root/test/mock/core/pipeline/mock_pipeline_context.cpp", 232 "$ace_root/test/mock/core/render/mock_font_collection.cpp", 233 "$ace_root/test/mock/core/render/mock_paragraph.cpp", 234 "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", 235 "$ace_root/test/unittest/core/pattern/text/mock/mock_text_layout_adapter.cpp", 236 "$ace_root/test/unittest/core/pipeline/mock_input_method_manager.cpp", 237 "$ace_root/test/unittest/core/rosen/mock_internal_resource.cpp", 238 "gradient_style_modifier_test.cpp", 239 ] 240 241 configs = [ ":rosen_render_context_config" ] 242 243 deps = [ 244 "$ace_root/test/unittest:ace_base", 245 "$ace_root/test/unittest:ace_components_base", 246 "$ace_root/test/unittest:ace_components_event", 247 "$ace_root/test/unittest:ace_components_gestures", 248 "$ace_root/test/unittest:ace_components_layout", 249 "$ace_root/test/unittest:ace_components_manager", 250 "$ace_root/test/unittest:ace_components_pattern", 251 "$ace_root/test/unittest:ace_components_property", 252 "$ace_root/test/unittest:ace_components_syntax", 253 "$ace_root/test/unittest:ace_core_animation", 254 "$ace_root/test/unittest:ace_core_extra", 255 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 256 "$ace_root/test/unittest:ace_unittest_log", 257 "$ace_root/test/unittest:ace_unittest_trace", 258 "//third_party/googletest:gmock_main", 259 ] 260 261 external_deps = [ 262 "graphic_2d:2d_graphics", 263 "graphic_2d:librender_service_client", 264 "skia:skia_canvaskit", 265 ] 266 if (defined(use_rosen_drawing) && use_rosen_drawing) { 267 defines = [ "USE_ROSEN_DRAWING" ] 268 } 269} 270