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/unittest/core/rosen/mock_animated_image.cpp", 59 "$ace_root/test/unittest/core/rosen/mock_pixmap_image.cpp", 60 ] 61 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 62} 63 64ohos_unittest("arkui_rosen_render_context_test") { 65 module_out_path = adapter_test_output_path 66 sources = [ 67 "$ace_root/frameworks/core/animation/native_curve_helper.cpp", 68 "$ace_root/frameworks/core/common/font_manager.cpp", 69 "$ace_root/frameworks/core/components/common/painter/debug_boundary_painter.cpp", 70 "$ace_root/frameworks/core/components_ng/animation/geometry_transition.cpp", 71 "$ace_root/frameworks/core/components_ng/image_provider/image_state_manager.cpp", 72 "$ace_root/frameworks/core/components_ng/pattern/particle/particle_pattern.cpp", 73 "$ace_root/frameworks/core/components_ng/render/adapter/component_snapshot.cpp", 74 "$ace_root/frameworks/core/components_ng/render/adapter/gradient_style_modifier.cpp", 75 "$ace_root/frameworks/core/components_ng/render/adapter/moon_progress_modifier.cpp", 76 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.cpp", 77 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_image.cpp", 78 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp", 79 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_adapter.cpp", 80 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_property.cpp", 81 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_render_context.cpp", 82 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_transition_effect.cpp", 83 "$ace_root/frameworks/core/components_ng/render/border_image_painter.cpp", 84 "$ace_root/frameworks/core/components_ng/render/circle_painter.cpp", 85 "$ace_root/frameworks/core/components_ng/render/debug_boundary_painter.cpp", 86 "$ace_root/frameworks/core/components_ng/render/divider_painter.cpp", 87 "$ace_root/frameworks/core/components_ng/render/drawing_prop_convertor.cpp", 88 "$ace_root/frameworks/core/components_ng/render/ellipse_painter.cpp", 89 "$ace_root/frameworks/core/components_ng/render/line_painter.cpp", 90 "$ace_root/frameworks/core/components_ng/render/paint_wrapper.cpp", 91 "$ace_root/frameworks/core/components_ng/render/polygon_painter.cpp", 92 "$ace_root/frameworks/core/components_ng/render/rect_painter.cpp", 93 "$ace_root/frameworks/core/components_ng/render/render_context.cpp", 94 "$ace_root/frameworks/core/components_ng/render/render_context_creator.cpp", 95 "$ace_root/frameworks/core/components_ng/render/render_property.cpp", 96 "$ace_root/frameworks/core/components_ng/render/shape_painter.cpp", 97 "$ace_root/test/mock/base/mock_ace_performance_check.cpp", 98 "$ace_root/test/mock/base/mock_ace_performance_monitor.cpp", 99 "$ace_root/test/mock/base/mock_engine_helper.cpp", 100 "$ace_root/test/mock/base/mock_event_report.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_text_translation_adapter.cpp", 122 "$ace_root/test/mock/core/common/mock_udmf.cpp", 123 "$ace_root/test/mock/core/event/mock_statusbar_event_proxy.cpp", 124 "$ace_root/test/mock/core/event/mock_touch_event.cpp", 125 "$ace_root/test/mock/core/image_provider/mock_image_loading_context.cpp", 126 "$ace_root/test/mock/core/image_provider/mock_image_source_info.cpp", 127 "$ace_root/test/mock/core/pipeline/mock_element_register.cpp", 128 "$ace_root/test/mock/core/pipeline/mock_pipeline_context.cpp", 129 "$ace_root/test/mock/core/render/mock_font_collection.cpp", 130 "$ace_root/test/mock/core/render/mock_paragraph.cpp", 131 "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", 132 "$ace_root/test/unittest/core/pattern/text/mock/mock_text_layout_adapter.cpp", 133 "$ace_root/test/unittest/core/pipeline/mock_input_method_manager.cpp", 134 "$ace_root/test/unittest/core/rosen/mock_internal_resource.cpp", 135 "rosen_render_context_test.cpp", 136 "rosen_render_context_test_new.cpp", 137 ] 138 139 configs = [ ":rosen_render_context_config" ] 140 141 deps = [ 142 ":rosen_render_context_test_mock", 143 "$ace_root/test/unittest:ace_base", 144 "$ace_root/test/unittest:ace_components_base", 145 "$ace_root/test/unittest:ace_components_event", 146 "$ace_root/test/unittest:ace_components_gestures", 147 "$ace_root/test/unittest:ace_components_layout", 148 "$ace_root/test/unittest:ace_components_manager", 149 "$ace_root/test/unittest:ace_components_pattern", 150 "$ace_root/test/unittest:ace_components_property", 151 "$ace_root/test/unittest:ace_components_syntax", 152 "$ace_root/test/unittest:ace_core_animation", 153 "$ace_root/test/unittest:ace_core_extra", 154 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 155 "$ace_root/test/unittest:ace_unittest_log", 156 "$ace_root/test/unittest:ace_unittest_trace", 157 "//third_party/googletest:gmock_main", 158 ] 159 160 external_deps = [ 161 "graphic_2d:2d_graphics", 162 "graphic_2d:librender_service_client", 163 "skia:skia_canvaskit", 164 "window_manager:libwm", 165 ] 166 if (defined(use_rosen_drawing) && use_rosen_drawing) { 167 defines = [ "USE_ROSEN_DRAWING" ] 168 } 169} 170 171ohos_unittest("gradient_style_modifier_test") { 172 module_out_path = adapter_test_output_path 173 sources = [ 174 "$ace_root/frameworks/core/animation/native_curve_helper.cpp", 175 "$ace_root/frameworks/core/common/font_manager.cpp", 176 "$ace_root/frameworks/core/components/common/painter/debug_boundary_painter.cpp", 177 "$ace_root/frameworks/core/components_ng/animation/geometry_transition.cpp", 178 "$ace_root/frameworks/core/components_ng/image_provider/image_state_manager.cpp", 179 "$ace_root/frameworks/core/components_ng/pattern/particle/particle_pattern.cpp", 180 "$ace_root/frameworks/core/components_ng/render/adapter/component_snapshot.cpp", 181 "$ace_root/frameworks/core/components_ng/render/adapter/gradient_style_modifier.cpp", 182 "$ace_root/frameworks/core/components_ng/render/adapter/moon_progress_modifier.cpp", 183 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.cpp", 184 "$ace_root/frameworks/core/components_ng/render/adapter/rosen/drawing_image.cpp", 185 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp", 186 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_adapter.cpp", 187 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_modifier_property.cpp", 188 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_render_context.cpp", 189 "$ace_root/frameworks/core/components_ng/render/adapter/rosen_transition_effect.cpp", 190 "$ace_root/frameworks/core/components_ng/render/border_image_painter.cpp", 191 "$ace_root/frameworks/core/components_ng/render/circle_painter.cpp", 192 "$ace_root/frameworks/core/components_ng/render/debug_boundary_painter.cpp", 193 "$ace_root/frameworks/core/components_ng/render/divider_painter.cpp", 194 "$ace_root/frameworks/core/components_ng/render/drawing_prop_convertor.cpp", 195 "$ace_root/frameworks/core/components_ng/render/ellipse_painter.cpp", 196 "$ace_root/frameworks/core/components_ng/render/image_painter.cpp", 197 "$ace_root/frameworks/core/components_ng/render/line_painter.cpp", 198 "$ace_root/frameworks/core/components_ng/render/paint_wrapper.cpp", 199 "$ace_root/frameworks/core/components_ng/render/polygon_painter.cpp", 200 "$ace_root/frameworks/core/components_ng/render/rect_painter.cpp", 201 "$ace_root/frameworks/core/components_ng/render/render_context.cpp", 202 "$ace_root/frameworks/core/components_ng/render/render_context_creator.cpp", 203 "$ace_root/frameworks/core/components_ng/render/render_property.cpp", 204 "$ace_root/frameworks/core/components_ng/render/shape_painter.cpp", 205 "$ace_root/test/mock/base/mock_ace_performance_check.cpp", 206 "$ace_root/test/mock/base/mock_ace_performance_monitor.cpp", 207 "$ace_root/test/mock/base/mock_engine_helper.cpp", 208 "$ace_root/test/mock/base/mock_foldable_window.cpp", 209 "$ace_root/test/mock/base/mock_frame_trace_adapter.cpp", 210 "$ace_root/test/mock/base/mock_image_source.cpp", 211 "$ace_root/test/mock/base/mock_jank_frame_report.cpp", 212 "$ace_root/test/mock/base/mock_localization.cpp", 213 "$ace_root/test/mock/base/mock_pixel_map.cpp", 214 "$ace_root/test/mock/base/mock_ressched_report.cpp", 215 "$ace_root/test/mock/base/mock_subwindow.cpp", 216 "$ace_root/test/mock/base/mock_system_properties.cpp", 217 "$ace_root/test/mock/core/common/mock_ace_application_info.cpp", 218 "$ace_root/test/mock/core/common/mock_ace_engine.cpp", 219 "$ace_root/test/mock/core/common/mock_ace_engine_ext.cpp", 220 "$ace_root/test/mock/core/common/mock_clipboard.cpp", 221 "$ace_root/test/mock/core/common/mock_container.cpp", 222 "$ace_root/test/mock/core/common/mock_data_detector_adapter.cpp", 223 "$ace_root/test/mock/core/common/mock_font_loader_ng.cpp", 224 "$ace_root/test/mock/core/common/mock_image_analyzer_manager.cpp", 225 "$ace_root/test/mock/core/common/mock_interaction.cpp", 226 "$ace_root/test/mock/core/common/mock_layout_inspector.cpp", 227 "$ace_root/test/mock/core/common/mock_motion_path_evaluator.cpp", 228 "$ace_root/test/mock/core/common/mock_text_translation_adapter.cpp", 229 "$ace_root/test/mock/core/common/mock_udmf.cpp", 230 "$ace_root/test/mock/core/event/mock_touch_event.cpp", 231 "$ace_root/test/mock/core/image_provider/mock_image_loading_context.cpp", 232 "$ace_root/test/mock/core/image_provider/mock_image_source_info.cpp", 233 "$ace_root/test/mock/core/pipeline/mock_element_register.cpp", 234 "$ace_root/test/mock/core/pipeline/mock_pipeline_context.cpp", 235 "$ace_root/test/mock/core/render/mock_font_collection.cpp", 236 "$ace_root/test/mock/core/render/mock_paragraph.cpp", 237 "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", 238 "$ace_root/test/unittest/core/pattern/text/mock/mock_text_layout_adapter.cpp", 239 "$ace_root/test/unittest/core/pipeline/mock_input_method_manager.cpp", 240 "$ace_root/test/unittest/core/rosen/mock_internal_resource.cpp", 241 "gradient_style_modifier_test.cpp", 242 ] 243 244 configs = [ ":rosen_render_context_config" ] 245 246 deps = [ 247 "$ace_root/test/unittest:ace_base", 248 "$ace_root/test/unittest:ace_components_base", 249 "$ace_root/test/unittest:ace_components_event", 250 "$ace_root/test/unittest:ace_components_gestures", 251 "$ace_root/test/unittest:ace_components_layout", 252 "$ace_root/test/unittest:ace_components_manager", 253 "$ace_root/test/unittest:ace_components_pattern", 254 "$ace_root/test/unittest:ace_components_property", 255 "$ace_root/test/unittest:ace_components_syntax", 256 "$ace_root/test/unittest:ace_core_animation", 257 "$ace_root/test/unittest:ace_core_extra", 258 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 259 "$ace_root/test/unittest:ace_unittest_log", 260 "$ace_root/test/unittest:ace_unittest_trace", 261 "//third_party/googletest:gmock_main", 262 ] 263 264 external_deps = [ 265 "graphic_2d:2d_graphics", 266 "graphic_2d:librender_service_client", 267 "skia:skia_canvaskit", 268 "window_manager:libwm", 269 ] 270 if (defined(use_rosen_drawing) && use_rosen_drawing) { 271 defines = [ "USE_ROSEN_DRAWING" ] 272 } 273} 274