| # Copyright 2018 The Chromium Authors. All rights reserved. | |
| # 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, "Non-ChromeOS builds cannot depend on //chromeos") | |
| source_set("cpp") { | |
| sources = [ | |
| "service_connection.cc", | |
| "service_connection.h", | |
| ] | |
| defines = [ "IS_CHROMEOS_MLSERVICE_IMPL" ] | |
| deps = [ | |
| "//base", | |
| "//chromeos/services/machine_learning/public/mojom", | |
| ] | |
| if (is_chromeos_ash) { | |
| sources += [ | |
| "../../cpp/ash/handwriting_model_loader.cc", | |
| "../../cpp/ash/handwriting_model_loader.h", | |
| "../../cpp/ash/service_connection_ash.cc", | |
| ] | |
| deps += [ | |
| "//ash/constants:constants", | |
| "//chromeos/dbus/dlcservice", | |
| "//chromeos/dbus/dlcservice:dlcservice_proto", | |
| "//chromeos/dbus/machine_learning", | |
| ] | |
| } else if (is_chromeos_lacros) { | |
| sources += [ "../../cpp/lacros/service_connection_lacros.cc" ] | |
| deps += [ | |
| "//chromeos/lacros", | |
| "//mojo/public/cpp/bindings", | |
| "//skia", | |
| ] | |
| } | |
| } | |
| component("stub") { | |
| sources = [ | |
| "fake_service_connection.cc", | |
| "fake_service_connection.h", | |
| ] | |
| defines = [ "IS_CHROMEOS_MLSERVICE_IMPL" ] | |
| deps = [ | |
| "//base", | |
| "//chromeos/services/machine_learning/public/mojom", | |
| "//mojo/public/cpp/bindings", | |
| ] | |
| public_deps = [ ":cpp" ] | |
| } | |
| source_set("unit_tests") { | |
| testonly = true | |
| sources = [ "service_connection_unittest.cc" ] | |
| deps = [ | |
| ":cpp", | |
| ":stub", | |
| "//base/test:test_support", | |
| "//chromeos/dbus/machine_learning", | |
| "//chromeos/services/machine_learning/public/mojom", | |
| "//mojo/core/embedder", | |
| "//mojo/public/cpp/bindings", | |
| "//testing/gtest", | |
| ] | |
| } | |
| if (is_chromeos_ash) { | |
| source_set("ash_unit_tests") { | |
| sources = [ "../../cpp/ash/handwriting_model_loader_unittest.cc" ] | |
| testonly = true | |
| deps = [ | |
| ":cpp", | |
| "//ash/constants:constants", | |
| "//base/test:test_support", | |
| "//chromeos/dbus/dlcservice", | |
| "//chromeos/services/machine_learning/public/cpp:stub", | |
| "//testing/gtest", | |
| ] | |
| } | |
| } | |