chromium/chromeos/ash/components/multidevice/mojom/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/chromeos/ui_mode.gni")
import("//mojo/public/tools/bindings/mojom.gni")

assert(is_chromeos_ash)

mojom("mojom") {
  sources = [ "multidevice_types.mojom" ]
  public_deps = [ "//mojo/public/mojom/base" ]

  webui_module_path =
      "chrome://resources/mojo/chromeos/ash/components/multidevice/mojom"

  # Used by ash/webui/common/resources/multidevice_setup, which is still using
  # JS + Closure.
  generate_webui_js_bindings = true

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "ash.multidevice.mojom.BeaconSeed"
          cpp = "::ash::multidevice::BeaconSeed"
        },
        {
          mojom = "ash.multidevice.mojom.RemoteDevice"
          cpp = "::ash::multidevice::RemoteDevice"
        },
        {
          mojom = "ash.multidevice.mojom.SoftwareFeature"
          cpp = "::ash::multidevice::SoftwareFeature"
        },
      ]
      traits_headers = [ "multidevice_mojom_traits.h" ]
      traits_sources = [ "multidevice_mojom_traits.cc" ]
      traits_public_deps = [
        "//base",
        "//chromeos/ash/components/multidevice",
      ]
      traits_deps = [
        "//chromeos/ash/components/multidevice/logging",
        "//chromeos/ash/services/device_sync/proto",
        "//device/bluetooth/public/cpp",
      ]
    },
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [ "multidevice_mojom_traits_unittest.cc" ]

  deps = [
    ":mojom",
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/components/multidevice",
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gtest",
  ]
}