chromium/ash/webui/shimless_rma/mojom/BUILD.gn

# Copyright 2021 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 = [ "shimless_rma.mojom" ]

  webui_module_path = "/ash/webui/shimless_rma"

  public_deps = [ "//mojo/public/mojom/base" ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "ash.shimless_rma.mojom.OsUpdateOperation"
          cpp = "::update_engine::Operation"
        },
        {
          mojom = "ash.shimless_rma.mojom.ComponentRepairStatus"
          cpp =
              "::rmad::ComponentsRepairState_ComponentRepairStatus_RepairStatus"
        },
        {
          mojom = "ash.shimless_rma.mojom.ComponentType"
          cpp = "::rmad::RmadComponent"
        },
        {
          mojom = "ash.shimless_rma.mojom.Component"
          cpp = "::rmad::ComponentsRepairState_ComponentRepairStatus"
        },
        {
          mojom = "ash.shimless_rma.mojom.WriteProtectDisableCompleteAction"
          cpp = "::rmad::WriteProtectDisableCompleteState_Action"
        },
        {
          mojom = "ash.shimless_rma.mojom.ProvisioningStatus"
          cpp = "::rmad::ProvisionStatus_Status"
        },
        {
          mojom = "ash.shimless_rma.mojom.ProvisioningError"
          cpp = "::rmad::ProvisionStatus_Error"
        },
        {
          mojom = "ash.shimless_rma.mojom.RmadErrorCode"
          cpp = "::rmad::RmadErrorCode"
        },
        {
          mojom = "ash.shimless_rma.mojom.CalibrationSetupInstruction"
          cpp = "::rmad::CalibrationSetupInstruction"
        },
        {
          mojom = "ash.shimless_rma.mojom.CalibrationOverallStatus"
          cpp = "::rmad::CalibrationOverallStatus"
        },
        {
          mojom = "ash.shimless_rma.mojom.CalibrationStatus"
          cpp = "::rmad::CalibrationComponentStatus_CalibrationStatus"
        },
        {
          mojom = "ash.shimless_rma.mojom.CalibrationComponentStatus"
          cpp = "::rmad::CalibrationComponentStatus"
        },
        {
          mojom = "ash.shimless_rma.mojom.FinalizationStatus"
          cpp = "::rmad::FinalizeStatus_Status"
        },
        {
          mojom = "ash.shimless_rma.mojom.FinalizationError"
          cpp = "::rmad::FinalizeStatus_Error"
        },
        {
          mojom = "ash.shimless_rma.mojom.UpdateRoFirmwareStatus"
          cpp = "::rmad::UpdateRoFirmwareStatus"
        },
        {
          mojom = "media.mojom.CdmKeyInformation"
          cpp = "::std::unique_ptr<::media::CdmKeyInformation>"
          move_only = true
        },
        {
          mojom = "media.mojom.CdmKeyStatus"
          cpp = "::media::CdmKeyInformation::KeyStatus"
        },
        {
          mojom = "ash.shimless_rma.mojom.UpdateErrorCode"
          cpp = "::update_engine::ErrorCode"
        },
        {
          mojom = "ash.shimless_rma.mojom.ShutdownMethod"
          cpp = "::rmad::RepairCompleteState_ShutdownMethod"
        },
        {
          mojom = "ash.shimless_rma.mojom.FeatureLevel"
          cpp = "::rmad::UpdateDeviceInfoState_FeatureLevel"
        },
      ]
      traits_headers = [
        "shimless_rma_mojom_traits.h",
        "//chromeos/ash/components/dbus/rmad/rmad.pb.h",
        "//chromeos/ash/components/dbus/update_engine/update_engine.pb.h",
        "//chromeos/ash/components/dbus/update_engine/update_engine_client.h",
      ]
      traits_sources = [ "shimless_rma_mojom_traits.cc" ]
      traits_public_deps = [
        "//chromeos/ash/components/dbus/rmad:rmad_proto",
        "//chromeos/ash/components/dbus/update_engine:proto",
        "//chromeos/ash/components/dbus/update_engine:update_engine",
        "//dbus",
      ]
    },
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [ "shimless_rma_mojom_traits_unittest.cc" ]

  deps = [
    ":mojom",
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/components/dbus/rmad",
    "//chromeos/ash/components/dbus/rmad:rmad_proto",
    "//chromeos/ash/components/dbus/update_engine",
    "//content/test:test_support",
    "//services/data_decoder/public/cpp:test_support",
    "//services/device/public/cpp:test_support",
    "//testing/gtest",
    "//ui/gfx",
    "//ui/shell_dialogs",
    "//ui/webui",
  ]
}