chromium/ash/webui/diagnostics_ui/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 = [
    "input_data_provider.mojom",
    "network_health_provider.mojom",
    "system_data_provider.mojom",
    "system_routine_controller.mojom",
  ]

  webui_module_path = "/ash/webui/diagnostics_ui"

  # Generate WebUI bindings in JavaScript instead of TypeScript.
  generate_webui_js_bindings = true

  public_deps = [
    "//ash/system/diagnostics/mojom",
    "//mojo/public/mojom/base",
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "ash.diagnostics.mojom.SecurityType"
          cpp = "::ash::diagnostics::mojom::SecurityType"
        },
        {
          mojom = "ash.diagnostics.mojom.AuthenticationType"
          cpp = "::ash::diagnostics::mojom::AuthenticationType"
        },
      ]
      traits_headers = [ "network_provider_mojom_traits.h" ]
      traits_sources = [ "network_provider_mojom_traits.cc" ]
      traits_public_deps = [ "//chromeos/services/network_config/public/mojom" ]
    },
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "network_provider_mojom_traits_unittest.cc" ]
  deps = [
    ":mojom",
    "//base",
    "//base/test:test_support",
    "//chromeos/services/network_config/public/mojom",
    "//mojo/public/cpp/test_support:test_utils",
    "//services/data_decoder/public/cpp:test_support",
    "//services/device/public/cpp:test_support",
    "//testing/gtest",
  ]
}