1# Copyright (c) 2022 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("//base/update/updater/updater_default_cfg.gni") 15import("//build/test.gni") 16 17MODULE_OUTPUT_PATH = "updater/updater_test" 18updater_path = rebase_path("${updater_absolutely_path}", ".") 19 20ohos_unittest("ui_unittest") { 21 testonly = true 22 resource_config_file = "${updater_path}/test/unittest/test_data/ohos_test.xml" 23 module_out_path = MODULE_OUTPUT_PATH 24 defines = [ 25 "UPDATER_UT", 26 "UPDATER_UI_SUPPORT", 27 "ENABLE_BITMAP_FONT = 0", 28 "ENABLE_ICU = 0", 29 "ENABLE_MULTI_FONT = 0", 30 "ENABLE_SHAPING = 0", 31 "ENABLE_STATIC_FONT = 0", 32 "ENABLE_VECTOR_FONT = 1", 33 ] 34 sources = [ 35 "lang/ui_language_unittest.cpp", 36 "strategy/ui_strategy_unittest.cpp", 37 "view/ui_component_unittest.cpp", 38 "view/ui_layout_unittest.cpp", 39 "view/ui_page_manager_unittest.cpp", 40 "view/ui_view_api_unittest.cpp", 41 "view/ui_view_proxy_unittest.cpp", 42 ] 43 sources += [ 44 "${updater_path}/services/ui/language/language_ui.cpp", 45 "${updater_path}/services/ui/strategy/ui_strategy.cpp", 46 "${updater_path}/services/ui/view/component/box_progress_adapter.cpp", 47 "${updater_path}/services/ui/view/component/component_factory.cpp", 48 "${updater_path}/services/ui/view/component/img_view_adapter.cpp", 49 "${updater_path}/services/ui/view/component/label_btn_adapter.cpp", 50 "${updater_path}/services/ui/view/component/text_label_adapter.cpp", 51 "${updater_path}/services/ui/view/layout/auto_layout.cpp", 52 "${updater_path}/services/ui/view/layout/layout_parser.cpp", 53 "${updater_path}/services/ui/view/page/base_page.cpp", 54 "${updater_path}/services/ui/view/page/page.cpp", 55 "${updater_path}/services/ui/view/page/page_manager.cpp", 56 "${updater_path}/services/ui/view/page/sub_page.cpp", 57 "${updater_path}/services/ui/view/view_api.cpp", 58 ] 59 60 include_dirs = [ 61 "//third_party/libpng", 62 "//third_party/libdrm/include/drm", 63 "//third_party/libdrm", 64 "${updater_path}/services/include/log", 65 "${updater_path}/services/include", 66 "//drivers/hdf_core/framework/ability/sbuf/include", 67 "//drivers/hdf_core/framework/include/platform", 68 "//drivers/hdf_core/framework/include/core", 69 "//drivers/hdf_core/framework/include/osal", 70 "//drivers/hdf_core/framework/include/utils", 71 "//drivers/hdf_core/framework/include/config", 72 "//drivers/hdf_core/framework/include", 73 "//drivers/hdf_core/adapter/uhdf2/hdi", 74 "//drivers/peripheral/input/hal/include", 75 "//drivers/peripheral/input/interfaces/include", 76 "${updater_path}/utils/include", 77 "${updater_path}/utils/json", 78 "${updater_path}/services", 79 "${updater_path}/interfaces/kits/include", 80 "${updater_path}/services/ui", 81 "${updater_path}/services/ui/include", 82 "${updater_path}/services/ui/control", 83 "${updater_path}/services/ui/driver", 84 "${updater_path}/services/ui/strategy", 85 "${updater_path}/services/ui/view", 86 "${updater_path}/services/ui/language", 87 "${updater_path}/test/unittest/updater_ui_test", 88 ] 89 deps = [ 90 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 91 "${updater_path}/interfaces/kits/packages:libpackageExt", 92 "${updater_path}/services/log:libupdaterlog", 93 "${updater_path}/utils:libutils", 94 "//drivers/peripheral/input/hal:hdi_input", 95 "//third_party/bounds_checking_function:libsec_static", 96 "//third_party/cJSON:cjson", 97 "//third_party/googletest:gmock_main", 98 "//third_party/googletest:gtest_main", 99 "//third_party/libdrm:libdrm", 100 "//third_party/libpng:libpng", 101 ] 102 configs = [ "${updater_path}/test/unittest:utest_config" ] 103 external_deps = [ 104 "c_utils:utils", 105 "hilog:libhilog", 106 "ui_lite:libupdater_layout", 107 ] 108 install_enable = true 109 part_name = "updater" 110} 111