chromium/chromeos/ash/services/ime/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")

assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //ash")

component("constants") {
  output_name = "ash_ime_constants"
  defines = [ "IS_ASH_IME_CONSTANTS_IMPL" ]
  deps = [
    "//base",
    "//build:branding_buildflags",
  ]
  sources = [
    "constants.cc",
    "constants.h",
  ]
}

source_set("ime_shared_library") {
  sources = [
    "ime_shared_library_wrapper.cc",
    "ime_shared_library_wrapper.h",
  ]

  deps = [
    ":constants",
    "//ash/constants",
    "//base",
    "//chromeos/ash/services/ime/public/cpp/shared_lib:interfaces",
  ]
}

source_set("lib") {
  sources = [
    "decoder/decoder_engine.cc",
    "decoder/decoder_engine.h",
    "decoder/system_engine.cc",
    "decoder/system_engine.h",
    "ime_service.cc",
    "ime_service.h",
    "input_method_user_data_service_impl.cc",
    "input_method_user_data_service_impl.h",
    "user_data/japanese_dictionary.cc",
    "user_data/japanese_dictionary.h",
    "user_data/japanese_legacy_config.cc",
    "user_data/japanese_legacy_config.h",
    "user_data_c_api_impl.cc",
    "user_data_c_api_impl.h",
    "user_data_c_api_interface.h",
  ]

  deps = [
    ":constants",
    ":ime_shared_library",
    "//ash/constants",
    "//base",
    "//chromeos/ash/components/standalone_browser",
    "//chromeos/ash/services/ime/public/cpp/shared_lib:interfaces",
    "//chromeos/ash/services/ime/public/cpp/shared_lib/proto:proto",
    "//chromeos/ash/services/ime/public/mojom",
  ]
}

source_set("sandbox_hook") {
  sources = [
    "ime_sandbox_hook.cc",
    "ime_sandbox_hook.h",
  ]

  deps = [
    ":constants",
    ":ime_shared_library",
    "//base",
    "//sandbox/linux:sandbox_services",
    "//sandbox/policy",
  ]
}

source_set("services_unittests") {
  testonly = true
  deps = [
    ":ime_shared_library",
    ":lib",
    ":test_support",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/services/ime/public/cpp/shared_lib:interfaces",
    "//chromeos/ash/services/ime/public/cpp/shared_lib/proto:proto",
    "//chromeos/ash/services/ime/public/mojom",
    "//mojo/public/cpp/bindings",
    "//services/network:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
  sources = [
    "ime_service_unittest.cc",
    "input_method_user_data_service_impl_unittest.cc",
    "user_data/japanese_dictionary_unittest.cc",
    "user_data/japanese_legacy_config_unittest.cc",
    "user_data_c_api_impl_unittest.cc",
  ]
}

static_library("test_support") {
  testonly = true
  sources = [
    "mock_input_channel.cc",
    "mock_input_channel.h",
  ]
  deps = [
    "//chromeos/ash/services/ime/public/mojom",
    "//testing/gmock",
  ]
}