• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("../../../../config.gni")
16
17module_output_path = "webview/webview"
18
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "../../../../ohos_adapter/media_adapter/include",
24    "../../../../ohos_adapter/graphic_adapter/include",
25    "../../../../ohos_nweb/include",
26  ]
27  cflags_cc = [ "--coverage" ]
28  ldflags = [ "--coverage" ]
29}
30
31ohos_unittest("nweb_media_adapter_test") {
32  module_out_path = module_output_path
33
34  sources = [
35    "audio_cenc_info_adapter_impl_test.cpp",
36    "buffer_info_adapter_impl_test.cpp",
37    "capability_data_adapter_impl_test.cpp",
38    "codec_format_adapter_impl_test.cpp",
39    "media_avsession_adapter_impl_test.cpp",
40    "media_codec_decoder_adapter_impl_test.cpp",
41    "media_codec_encoder_adapter_impl_test.cpp",
42    "ohos_buffer_adapter_impl_test.cpp",
43    "player_framework_adapter_impl_test.cpp",
44  ]
45
46  configs = [ ":module_private_config" ]
47  include_dirs = [ "../../../../ohos_nweb/include" ]
48
49  deps = [ "../../../../ohos_adapter:nweb_ohos_adapter" ]
50
51  external_deps = [
52    "c_utils:utils",
53    "googletest:gmock_main",
54    "googletest:gtest_main",
55    "graphic_surface:surface",
56    "hilog:libhilog",
57  ]
58
59  if (webview_drm_enable) {
60    external_deps += [ "drm_framework:native_drm" ]
61    sources += [ "drm_adapter_impl_test.cpp" ]
62    sources += [ "audio_codec_decoder_adapter_impl_test.cpp" ]
63  }
64
65  if (webview_avcodec_enable) {
66    external_deps += [
67      "av_codec:av_codec_client",
68      "av_codec:native_media_codecbase",
69      "media_foundation:media_foundation",
70      "media_foundation:native_media_core",
71    ]
72  }
73
74  if (webview_media_player_enable) {
75    external_deps += [ "player_framework:media_client" ]
76  }
77
78  if (webview_media_avsession_enable) {
79    external_deps += [
80      "ability_base:want",
81      "ability_runtime:app_context",
82      "ability_runtime:wantagent_innerkits",
83      "av_session:avsession_client",
84      "input:libmmi-client",
85    ]
86  }
87}
88
89group("unittest") {
90  testonly = true
91  deps = []
92  if (webview_media_player_enable) {
93    deps += [ ":nweb_media_adapter_test" ]
94  }
95}
96