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