chromium/chrome/browser/ash/power/ml/smart_dim/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/chromeos/crosier_tests.gni")
import("//build/config/chromeos/ui_mode.gni")

assert(is_chromeos_ash)

static_library("smart_dim") {
  friend = [ ":unit_tests" ]

  public = [
    "metrics.h",
    "ml_agent.h",
  ]

  sources = [
    "builtin_worker.cc",
    "builtin_worker.h",
    "download_worker.cc",
    "download_worker.h",
    "metrics.cc",
    "ml_agent.cc",
    "ml_agent.h",
    "ml_agent_util.cc",
    "ml_agent_util.h",
    "smart_dim_worker.cc",
    "smart_dim_worker.h",
  ]

  deps = [
    "//ash/constants",
    "//base",
    "//chrome/browser:resources",
    "//chrome/browser/ash/power/ml:user_activity_event_proto",
    "//chrome/browser/ash/power/ml:user_activity_ukm_logger_helpers",
    "//chrome/common:constants",
    "//chromeos",
    "//chromeos/services/machine_learning/public/cpp",
    "//chromeos/services/machine_learning/public/mojom",
    "//components/assist_ranker",
    "//components/assist_ranker/proto",
    "//components/sessions",
    "//services/data_decoder/public/cpp",
    "//ui/base",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "ml_agent_unittest.cc",
    "ml_agent_util_unittest.cc",
  ]

  deps = [
    ":smart_dim",
    "//ash/constants",
    "//base",
    "//chromeos:test_utils",
    "//chromeos/dbus/machine_learning",
    "//chromeos/services/machine_learning/public/cpp",
    "//chromeos/services/machine_learning/public/cpp:stub",
    "//components/assist_ranker/proto",
    "//content/test:test_support",
    "//services/data_decoder/public/cpp",
    "//services/data_decoder/public/cpp:test_support",
    "//testing/gtest",
  ]
}

if (is_chromeos_device) {
  crosier_tests("integration_tests") {
    sources = [ "smart_dim_integration_test.cc" ]

    sources_metadata = [ "smart_dim_integration_test.yaml" ]

    deps = [
      ":smart_dim",
      "//base/test:test_support",
      "//chrome/browser",
      "//chrome/browser:browser_process",
      "//chrome/browser/ash/power/ml",
      "//chrome/common",
      "//chrome/test:ash_integration_test_support",
      "//chromeos/ash/components/standalone_browser",
      "//components/component_updater",
      "//net:test_support",
      "//testing/gtest",
      "//ui/aura",
    ]
  }
}