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/multimedia/player_framework/config.gni") 16 17module_output_path = "player_framework/screen_capture" 18 19ohos_unittest("screen_capture_native_unit_test") { 20 module_out_path = module_output_path 21 include_dirs = [ 22 "./", 23 "./screen_capture_unittest/include", 24 "./native/include", 25 "$MEDIA_PLAYER_ROOT_DIR/test/unittest/common/include", 26 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 27 ] 28 29 cflags = [ 30 "-Wall", 31 "-Werror", 32 ] 33 34 if (multimedia_player_framework_support_screen_capture) { 35 sources = [ 36 "native/screen_capture_mock_factory.cpp", 37 "native/src/screen_capture_native_mock.cpp", 38 "screen_capture_unittest/src/screen_capture_unit_test.cpp", 39 ] 40 } 41 42 external_deps = [ 43 "ability_base:base", 44 "ability_base:want", 45 "ability_base:zuri", 46 "ability_runtime:ability_manager", 47 "ability_runtime:app_manager", 48 "ability_runtime:mission_info", 49 "access_token:libaccesstoken_sdk", 50 "access_token:libnativetoken", 51 "access_token:libtoken_setproc", 52 "c_utils:utils", 53 "graphic_surface:surface", 54 "hilog:libhilog", 55 "player_framework:media_client", 56 "window_manager:libdm", 57 ] 58 59 resource_config_file = "../resources/ohos_test.xml" 60} 61 62################################################################################################################## 63 64ohos_unittest("screen_capture_capi_unit_test") { 65 module_out_path = module_output_path 66 include_dirs = [ 67 "./", 68 "./screen_capture_unittest/include", 69 "./capi/include", 70 "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c", 71 "$MEDIA_PLAYER_ROOT_DIR/test/unittest/common/include", 72 "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/common", 73 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 74 ] 75 76 cflags = [ 77 "-Wall", 78 "-Werror", 79 ] 80 81 if (multimedia_player_framework_support_screen_capture) { 82 sources = [ 83 "capi/screen_capture_mock_factory.cpp", 84 "capi/src/screen_capture_capi_mock.cpp", 85 "screen_capture_unittest/src/screen_capture_unit_test.cpp", 86 ] 87 } 88 89 deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:native_avscreen_capture" ] 90 91 external_deps = [ 92 "ability_base:base", 93 "ability_base:want", 94 "ability_base:zuri", 95 "ability_runtime:ability_manager", 96 "ability_runtime:app_manager", 97 "ability_runtime:mission_info", 98 "access_token:libaccesstoken_sdk", 99 "access_token:libnativetoken", 100 "access_token:libtoken_setproc", 101 "c_utils:utils", 102 "graphic_surface:surface", 103 "hilog:libhilog", 104 "player_framework:media_client", 105 "window_manager:libdm", 106 ] 107 108 resource_config_file = "../resources/ohos_test.xml" 109} 110