chromium/chromeos/ash/components/local_search_service/public/mojom/BUILD.gn

# Copyright 2020 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 = [
    "index.mojom",
    "local_search_service.mojom",
    "types.mojom",
  ]

  webui_module_path = "/"

  # Used by the help app UI, which is still using JS + Closure.
  generate_webui_js_bindings = true

  public_deps = [
    "//mojo/public/mojom/base",
    "//sandbox/policy/mojom",
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "ash.local_search_service.mojom.IndexId"
          cpp = "::ash::local_search_service::IndexId"
        },
        {
          mojom = "ash.local_search_service.mojom.Content"
          cpp = "::ash::local_search_service::Content"
        },
        {
          mojom = "ash.local_search_service.mojom.Data"
          cpp = "::ash::local_search_service::Data"
        },
        {
          mojom = "ash.local_search_service.mojom.SearchParams"
          cpp = "::ash::local_search_service::SearchParams"
        },
        {
          mojom = "ash.local_search_service.mojom.Position"
          cpp = "::ash::local_search_service::Position"
        },
        {
          mojom = "ash.local_search_service.mojom.Result"
          cpp = "::ash::local_search_service::Result"
        },
        {
          mojom = "ash.local_search_service.mojom.ResponseStatus"
          cpp = "::ash::local_search_service::ResponseStatus"
        },
        {
          mojom = "ash.local_search_service.mojom.Backend"
          cpp = "::ash::local_search_service::Backend"
        },
      ]
      traits_headers = [ "//chromeos/ash/components/local_search_service/public/mojom/types_mojom_traits.h" ]
      traits_sources = [ "//chromeos/ash/components/local_search_service/public/mojom/types_mojom_traits.cc" ]
    },
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [ "types_mojom_traits_unittest.cc" ]

  deps = [
    ":mojom",
    "//base",
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gmock:gmock",
    "//testing/gtest",
  ]
}