chromium/components/content_capture/common/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("//mojo/public/tools/bindings/mojom.gni")

source_set("common") {
  sources = [
    "content_capture_data.cc",
    "content_capture_data.h",
    "content_capture_features.cc",
    "content_capture_features.h",
  ]

  deps = [
    "//base",
    "//ui/gfx/geometry",
  ]
}

mojom("mojo_interfaces") {
  sources = [ "content_capture.mojom" ]

  public_deps = [
    ":mojo_types",
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
  ]
}

mojom("mojo_types") {
  sources = [ "content_capture_data.mojom" ]

  public_deps = [
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "content_capture.mojom.ContentCaptureData"
          cpp = "::content_capture::ContentCaptureData"
        },
      ]
      traits_headers = [ "content_capture_mojom_traits.h" ]
      traits_sources = [ "content_capture_mojom_traits.cc" ]
      traits_public_deps = [
        ":common",
        "//base",
        "//ui/gfx/geometry/mojom:mojom_traits",
      ]
    },
  ]
}

mojom("mojo_test_types") {
  testonly = true
  sources = [ "traits_test_service.test-mojom" ]

  public_deps = [ ":mojo_types" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "content_capture_mojom_traits_unittest.cc" ]

  public_deps = [ ":mojo_test_types" ]

  deps = [
    ":common",
    "//base",
    "//base/test:test_support",
    "//mojo/public/cpp/bindings",
    "//testing/gtest",
  ]
}