chromium/chromeos/services/chromebox_for_meetings/public/cpp/BUILD.gn

# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromebox_for_meetings/buildflags.gni")
import("//build/config/chromeos/ui_mode.gni")

assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos")

component("cpp") {
  sources = [
    "appid_util.cc",
    "appid_util.h",
    "service_adaptor.cc",
    "service_adaptor.h",
    "service_connection.cc",
    "service_connection.h",
  ]
  defines = [ "IS_CHROMEOS_CFMSERVICE_IMPL" ]
  deps = [
    "//base",
    "//chromeos/services/chromebox_for_meetings/public/mojom",
  ]

  if (is_cfm && is_chromeos_ash) {
    sources += [ "../../cpp/ash/service_connection_cfm_ash.cc" ]
    deps += [
      "//chromeos/ash/components/chromebox_for_meetings",
      "//chromeos/ash/components/dbus/chromebox_for_meetings",
    ]
  } else if (is_chromeos_lacros) {
    sources += [ "../../cpp/lacros/service_connection_lacros.cc" ]
    deps += [
      "//chromeos/lacros",
      "//mojo/public/cpp/bindings",
    ]
  } else {  # non-cfm ash
    sources += [ "../../cpp/ash/service_connection_ash.cc" ]
  }
}

source_set("test_support") {
  testonly = true
  sources = [
    "fake_service_connection.cc",
    "fake_service_connection.h",
    "fake_service_context.cc",
    "fake_service_context.h",
  ]
  deps = [
    "//base",
    "//chromeos/services/chromebox_for_meetings/public/mojom",
    "//mojo/public/cpp/bindings",
  ]
  public_deps = [ ":cpp" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "appid_util_unittest.cc",
    "service_adaptor_unittest.cc",
    "service_connection_unittest.cc",
  ]
  deps = [
    ":cpp",
    ":test_support",
    "//base/test:test_support",
    "//chromeos/services/chromebox_for_meetings/public/mojom",
    "//mojo/core/embedder",
    "//mojo/public/cpp/bindings",
    "//testing/gtest",
  ]
}