1# Copyright (c) 2022-2025 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/ability/ability_runtime/ability_runtime.gni") 16 17module_output_path = "ability_runtime/ability_runtime/service_extension" 18 19ohos_unittest("js_service_extension_test") { 20 module_out_path = module_output_path 21 22 include_dirs = [ 23 "${ability_runtime_innerkits_path}/app_manager/include/appmgr", 24 "${ability_runtime_native_path}/runtime", 25 "${ability_runtime_native_path}/runtime/utils/include", 26 "${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime", 27 "${ability_runtime_path}/interfaces/kits/native/appkit/app", 28 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", 29 ] 30 31 sources = [ 32 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_insight_intent_executor_mgr.cpp", 33 "js_service_extension_test.cpp", 34 ] 35 36 configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] 37 deps = [ 38 "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub", 39 "${ability_runtime_native_path}/ability/native:abilitykit_utils", 40 "${ability_runtime_native_path}/ability/native:insight_intent_executor", 41 "${ability_runtime_native_path}/insight_intent/insight_intent_context:insightintentcontext", 42 "${ability_runtime_path}/services/abilitymgr:abilityms_target", 43 ] 44 45 external_deps = [ 46 "ability_base:base", 47 "ability_base:configuration", 48 "ability_base:want", 49 "ability_runtime:ability_manager", 50 "ability_runtime:app_context", 51 "ability_runtime:appkit_native", 52 "ability_runtime:extensionkit_native", 53 "ability_runtime:runtime", 54 "ability_runtime:service_extension", 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "ets_runtime:libark_jsruntime", 59 "eventhandler:libeventhandler", 60 "googletest:gmock_main", 61 "googletest:gtest_main", 62 "hilog:libhilog", 63 "i18n:intl_util", 64 "icu:shared_icuuc", 65 "init:libbegetutil", 66 "ipc:ipc_core", 67 "ipc:ipc_napi", 68 "json:nlohmann_json_static", 69 "napi:ace_napi", 70 "resource_management:global_resmgr", 71 ] 72 73 if (ability_runtime_graphics) { 74 external_deps += [ 75 "image_framework:image", 76 "window_manager:libdm", 77 "window_manager:libwm", 78 ] 79 } 80} 81 82group("unittest") { 83 testonly = true 84 85 deps = [ ":js_service_extension_test" ] 86} 87