chromium/chromeos/ash/services/cros_healthd/public/cpp/BUILD.gn

# Copyright 2019 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/chromeos/args.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//chromeos/features.gni")

assert(is_chromeos_ash)

source_set("cpp") {
  defines = []
  if (is_chromeos_device) {
    defines += [ "USE_EVDEV_GESTURES" ]
  }
  if (use_libinput) {
    defines += [ "USE_LIBINPUT" ]
  }
  sources = [
    "service_connection.cc",
    "service_connection.h",
  ]
  public_deps = [
    "//chromeos/services/network_health/public/mojom",
    "//chromeos/services/network_health/public/mojom:types",
  ]
  deps = [
    "//ash/constants",
    "//base",
    "//chromeos/ash/components/mojo_service_manager",
    "//chromeos/ash/services/cros_healthd/public/mojom",
    "//third_party/abseil-cpp:absl",
    "//ui/events/ozone/evdev:event_device_info",
  ]
}

source_set("fakes") {
  sources = [
    "fake_ash_event_reporter.cc",
    "fake_ash_event_reporter.h",
    "fake_cros_healthd.cc",
    "fake_cros_healthd.h",
    "fake_routine_control.cc",
    "fake_routine_control.h",
  ]
  public_deps = [
    ":cpp",
    "//ash/system/diagnostics/mojom",
    "//chromeos/ash/components/mojo_service_manager:mojo_service_manager",
    "//chromeos/ash/services/cros_healthd/public/mojom",
    "//chromeos/ash/services/cros_healthd/public/mojom:event_reporter",
  ]
}

static_library("test_support") {
  testonly = true
  public_deps = [ ":fakes" ]
}

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