1# Copyright (c) 2023 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 17ohos_unittest("viewport_config_test") { 18 module_out_path = "$interface_test_output_path/inner_api" 19 20 sources = [ "viewport_config_test.cpp" ] 21 22 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 23} 24 25ohos_unittest("ui_content_test") { 26 module_out_path = "$interface_test_output_path/inner_api" 27 28 sources = [ 29 "$ace_root/interfaces/inner_api/ace/ui_content.cpp", 30 "ui_content_test.cpp", 31 ] 32 33 include_dirs = [ 34 "$window_manager_path/interfaces/innerkits", 35 "$window_manager_path/interfaces/innerkits/wm", 36 "$window_manager_path/wm/include", 37 ] 38 39 deps = [ 40 "$ace_root/frameworks/base:ace_memory_monitor_ohos", 41 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 42 "$ace_root/test/unittest:ace_unittest_log", 43 "$ace_root/test/unittest:ace_unittest_trace", 44 "$cjson_root:cjson", 45 "$graphic_2d_path/rosen/modules/render_service_client:librender_service_client", 46 "//third_party/googletest:gmock_main", 47 ] 48 49 external_deps = [ 50 "ability_runtime:abilitykit_native", 51 "image_framework:image", 52 "input:libmmi-client", 53 "ipc:ipc_single", 54 "window_manager:libdm", 55 "window_manager:libwm", 56 "window_manager:scene_session", 57 "window_manager:scene_session_manager", 58 ] 59 60 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 61} 62 63ohos_unittest("form_render_test") { 64 module_out_path = "$interface_test_output_path/inner_api" 65 include_dirs = [ "$ace_root/interfaces/inner_api/form_render/include" ] 66 sources = [ 67 # mock 68 "$ace_root/frameworks/core/components/common/properties/color.cpp", 69 "$ace_root/frameworks/core/pipeline_ng/test/mock/mock_pipeline_base.cpp", 70 "$ace_root/test/mock/interfaces/mock_uicontent_creator.cpp", 71 72 # self 73 "$ace_root/interfaces/inner_api/form_render/src/form_renderer.cpp", 74 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_delegate_impl.cpp", 75 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_delegate_proxy.cpp", 76 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_delegate_stub.cpp", 77 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_dispatcher_impl.cpp", 78 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_dispatcher_proxy.cpp", 79 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_dispatcher_stub.cpp", 80 "$ace_root/interfaces/inner_api/form_render/src/form_renderer_group.cpp", 81 "form_render_test.cpp", 82 ] 83 84 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 85 86 deps = [ 87 "$ace_root/frameworks/base:ace_memory_monitor_ohos", 88 "$ace_root/test/unittest:ace_unittest_log", 89 "$ace_root/test/unittest:ace_unittest_trace", 90 "$cjson_root:cjson", 91 "$graphic_2d_path/rosen/modules/render_service_client:librender_service_client", 92 "//third_party/googletest:gmock_main", 93 ] 94 95 external_deps = [ 96 "ability_base:want", 97 "ability_runtime:ability_context_native", 98 "ability_runtime:ability_manager", 99 "ability_runtime:runtime", 100 "ace_engine:ace_uicontent", 101 "c_utils:utils", 102 "eventhandler:libeventhandler", 103 "form_fwk:form_manager", 104 "graphic_2d:surface", 105 "hilog:libhilog", 106 "input:libmmi-client", 107 "ipc:ipc_core", 108 "napi:ace_napi", 109 ] 110} 111 112ohos_unittest("drawable_descriptor_test") { 113 module_out_path = "$interface_test_output_path/inner_api" 114 115 sources = [ 116 "$ace_root/interfaces/inner_api/drawable_descriptor/drawable_descriptor.cpp", 117 "$ace_root/interfaces/inner_api/drawable_descriptor/image_converter.cpp", 118 "drawable_descriptor_test.cpp", 119 ] 120 121 configs = [ "$ace_root/test/unittest:ace_unittest_config" ] 122 123 deps = [ 124 "$cjson_root:cjson", 125 "//third_party/googletest:gmock_main", 126 ] 127 128 if (ace_use_new_skia) { 129 deps += [ "$skia_root_new:skia_ohos" ] 130 defines = [ "NEW_SKIA" ] 131 } else { 132 deps += [ "$ace_flutter_engine_root/skia:ace_skia_ohos" ] 133 } 134 135 public_deps = [ 136 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics", 137 "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", 138 ] 139 140 external_deps = [ 141 "c_utils:utils", 142 "hilog:libhilog", 143 "image_framework:image", 144 "image_framework:image_native", 145 "napi:ace_napi", 146 "resource_management:global_resmgr", 147 ] 148} 149 150group("interfaces_unittest") { 151 testonly = true 152 deps = [ 153 ":drawable_descriptor_test", 154 ":form_render_test", 155 ":ui_content_test", 156 ":viewport_config_test", 157 ] 158} 159