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("//build/test.gni")
15import("../../../config.gni")
16
17module_output_path = "web/webview"
18
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  if (webview_audio_enable) {
23    defines = [ "NWEB_AUDIO_ENABLE" ]
24  }
25
26  include_dirs = [ "../../../ohos_adapter/audio_adapter/include" ]
27}
28
29ohos_unittest("nweb_audio_adapter_test") {
30  module_out_path = module_output_path
31
32  sources = [ "audio_adapter_impl_test.cpp" ]
33
34  configs = [ ":module_private_config" ]
35
36  deps = [
37    "../../../ohos_adapter:nweb_ohos_adapter",
38    "//third_party/googletest:gmock_main",
39    "//third_party/googletest:gtest_main",
40  ]
41
42  external_deps = [
43    "ability_runtime:app_context",
44    "ability_runtime:app_manager",
45    "access_token:libaccesstoken_sdk",
46    "access_token:libnativetoken",
47    "access_token:libtoken_setproc",
48    "audio_framework:audio_capturer",
49    "bundle_framework:appexecfwk_core",
50    "c_utils:utils",
51    "hilog:libhilog",
52  ]
53
54  if (webview_audio_enable) {
55    external_deps += [
56      "audio_framework:audio_client",
57      "audio_framework:audio_renderer",
58    ]
59  }
60}
61
62group("unittest") {
63  testonly = true
64  deps = []
65  if (webview_audio_enable) {
66    deps += [ ":nweb_audio_adapter_test" ]
67  }
68}
69