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 = "web/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  ]
26  cflags_cc = [ "--coverage" ]
27  ldflags = [ "--coverage" ]
28}
29
30ohos_unittest("nweb_media_adapter_test") {
31  module_out_path = module_output_path
32
33  sources = [
34    "media_avsession_adapter_impl_test.cpp",
35    "media_codec_decoder_adapter_impl_test.cpp",
36    "media_codec_encoder_adapter_impl_test.cpp",
37    "player_framework_adapter_impl_test.cpp",
38  ]
39
40  configs = [ ":module_private_config" ]
41
42  deps = [
43    "../../../../ohos_adapter:nweb_ohos_adapter",
44    "//third_party/googletest:gmock_main",
45    "//third_party/googletest:gtest_main",
46  ]
47
48  external_deps = [
49    "c_utils:utils",
50    "graphic_surface:surface",
51    "hilog:libhilog",
52  ]
53
54  if (webview_avcodec_enable) {
55    external_deps += [
56      "av_codec:av_codec_client",
57      "media_foundation:media_foundation",
58    ]
59  }
60
61  if (webview_media_player_enable) {
62    external_deps += [ "player_framework:media_client" ]
63  }
64
65  if (webview_media_avsession_enable) {
66    external_deps += [
67      "ability_base:want",
68      "ability_runtime:app_context",
69      "ability_runtime:wantagent_innerkits",
70      "av_session:avsession_client",
71      "input:libmmi-client",
72    ]
73  }
74}
75
76group("unittest") {
77  testonly = true
78  deps = []
79  if (webview_media_player_enable) {
80    deps += [ ":nweb_media_adapter_test" ]
81  }
82}
83